Lab 5.3 - Update User Password from the Secret

1. Login as admin user

oc login -u admin -p rahasia https://api.openshift.podX.io:6443

2. Generate a random user password.

openssl rand -hex 15

3. Store the password created in MANAGER_PASSWD env

MANAGER_PASSWD='c4cc6cf37816e7c88dc341107ff150'
echo $MANAGER_PASSWD

4. Update the manager user with the password

htpasswd -b /root/temp manager ${MANAGER_PASSWD}

5. Update the secret

oc create secret generic htp-secret \
  --from-file htpasswd=/root/temp --dry-run=client -o yaml \
  | oc replace -n openshift-config -f -

6. Log in as the manager user to verify the updated password

oc login -u manager -p ${MANAGER_PASSWD} https://api.openshift.podX.io:6443

Daftar Materi