Something i’ve been doing a lot of recently and i’m sure i will need a pointer back to it. When OpenShift is using htpasswd for its authentication provider, adding new users/credentials is easier than ever.
- shell with the
- OpenShift credentials with
- create an
htpasswdfile for the cluster. this should probably contain all the users you want to be in there, so make sure it has everything. if updating an old file, drop the
htpasswd -c -B -b ./openshift.htpasswd user1 secret
- Add more users as necessary.
- Create the manifest for the cluster secret. This is used by the authentication
provider to read the individual credentials, i am doing this as a dry run
to create a file for the manifest because the secret should exist already.
oc create secret generic htpasswd-secret \ --from-file=htpasswd=./openshift.htpasswd \ --namespace openshift-config \ --dry-run \ --output yaml > ./htpass-secret.yaml
- Replace the existing secret, this could be done as a pipe from the previous
oc replace --filename ./htpass-secret.yaml
If everything has worked, you should now be able to login as the newly identified user.