Configure the secrets

Follow below steps for configuring secrets for the installation of Openstack Operator on RHOCP cluster.

  1. Prepare the secret for installating the operators:

    Login with your Red Hat account and create a secret:

    podman login --username "My-RH-username" --password "My-Password" registry.redhat.io --authfile auth.json
    You need to replace My-RH-username and My-Password strings in the above command with the apporpriate value.
  2. Ensure that you observe the Login Succeeded! message in the output of the preceding command, then confirm the creation of the auth.json file.

    cat auth.json
  3. Create secret for the registry:

    oc create secret generic osp-operators-secret \
     -n openstack-operators \
     --from-file=.dockerconfigjson=auth.json \
     --type=kubernetes.io/dockerconfigjson
  4. Veify the secret is created:

    oc get secrets -n openstack-operators osp-operators-secret
    Sample Output
    NAME                   TYPE                             DATA   AGE
    osp-operators-secret   kubernetes.io/dockerconfigjson   1      10s
  5. Copy sample config from step #2 of section 3.2. Providing secure access to the Red Hat OpenStack Platform services of deployment guide.

    or

    Use ctlplane-secret.sample file.

  6. Create a copy of sample config to configure secret for openstack services.

    cp ctlplane-secret.sample osp-ng-ctlplane-secret.yaml
  7. Generate base64 password string for your desired password.

    You may change the string password in the below command with your desired password.

    echo -n password | base64
    Sample output
    cGFzc3dvcmQ=
  8. Replace your base64 password string in the ctlplane secret file.

    sed -i 's/<base64_password>/cGFzc3dvcmQ=/g' osp-ng-ctlplane-secret.yaml
    sed -i 's/<base64_password_heat>/cGFzc3dvcmQ=/g' osp-ng-ctlplane-secret.yaml
  9. Create the Secret:

    oc create -f osp-ng-ctlplane-secret.yaml
  10. Verify the Secret was created:

    oc describe secret osp-secret -n openstack