Skip to content

Instantly share code, notes, and snippets.

@welshstew
Last active June 17, 2019 15:13
Show Gist options
  • Save welshstew/67ee02ef3a53a048394370c56481de31 to your computer and use it in GitHub Desktop.
Save welshstew/67ee02ef3a53a048394370c56481de31 to your computer and use it in GitHub Desktop.
htpasswd -c -B -b users.htpasswd user1 password1!
htpasswd -B -b users.htpasswd user2 password2!
htpasswd -B -b users.htpasswd user3 password3!
htpasswd -B -b users.htpasswd user4 password4!
htpasswd -B -b users.htpasswd user5 password5!
echo "apiVersion: config.openshift.io/v1
kind: OAuth
metadata:
name: cluster
spec:
identityProviders:
- name: my_htpasswd_provider
mappingMethod: claim
type: HTPasswd
htpasswd:
fileData:
name: htpass-secret
" | oc replace -f -
oc delete secret htpass-secret -n openshift-config
oc create secret generic htpass-secret --from-file=htpasswd=users.htpasswd -n openshift-config
[user@somehost temp]$ oc get routes -n openshift-console
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
console console-openshift-console.apps-crc.testing console https reencrypt/Redirect None
downloads downloads-openshift-console.apps-crc.testing downloads http edge None
oc adm policy add-cluster-role-to-user cluster-admin user1 --rolebinding-name=cluster-admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment