selflink : https://bit.ly/3zxs2Kv
- Red Hat registry pull secret (can be recovered from
cloud.redhat.com
) - credentials for AWS (or any other supported cloud)
oc
accessible in your PATH ( https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz )openshift-install
accessible in your PATH ( https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-install-linux.tar.gz )
openshift-install create --dir=mycluster --log-level=info install-config
openshift-install create --dir=mycluster --log-level=info manifests
openshift-install create cluster --dir=mycluster --log-level=info
You'll need to run this script on a users.list
file of your chosing, then load the resulting htpasswd file as an oauth identity provider.
#!/bin/bash
FILE="${1:-users.list}"
HTFILE=users.htpasswd
gen() {
> $HTFILE
cat $FILE | while read USER PASS ; do
htpasswd -B -b $HTFILE "$USER" "$PASS"
done
}
gen
student1 pass1
student2 pass2
...
#!/bin/bash
HTFILE=users.htpasswd
oc get secret -n openshift-config htpass-secret -o yaml >htpass-secret-backup.yaml
oc delete secret -n openshift-config htpass-secret
oc create secret generic htpass-secret --from-file=htpasswd=$HTFILE -n openshift-config
oc get oauth cluster -o yaml >oauth-backup.yaml
oc apply -f- <<EOF
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
EOF