Lab 3.4 - Review OpenShift Cluster using OC Command

1. Help sub-command

oc --help
oc <subcommand> --help
oc login --help

2. Login using kubeadmin user

YOUR_PASSWORD=`cat ocp47/auth/kubeadmin-password`
oc login -u kubeadmin -p ${YOUR_PASSWORD} https://api.openshift.podX.io:6443

3. Show users

oc whoami
oc get users

4. Logout user

oc logout

5. Review cluster version

oc get clusterversion
oc describe clusterversion

6. Review cluster operator

oc get clusteroperators

7. Collect debugging data

oc adm inspect clusteroperator/storage
ls inspect.local.3785924729341577118/

8. Gather debugging information

oc adm must-gather
ls /root/must-gather.local.176542636556680773/

9. Verify nodes

oc get nodes
oc describe nodes masterX.openshift.podX.io
oc describe nodes workerX.openshift.podX.io

10. Get nodes logs

oc adm node-logs -u crio masterX.openshift.podX.io
oc adm node-logs -u kubelet workerX.openshift.podX.io
oc adm node-logs masterX.openshift.podX.io

11. Check Pods

oc get pods
oc get pods --all-namespaces
oc get pods -n openshift-kube-apiserver

12. Show statistics resource

oc adm top nodes
oc adm top pods
oc adm top images

Daftar Materi