Troubleshooting OpenShift Flashcards

(34 cards)

1
Q

Display the list of nodes in a cluster

A

oc get nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Displays the current CPU and memory usage of each node

A

oc adm top nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Displays the resources used by a node

A

oc describe node my-node-name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Show the cluster version

A

oc get clusterversion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Show elaborated details about the cluster status

A

oc describe clusterversion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

List all cluster operators

A

oc get clusteroperators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

View crio logs on a given node

A

oc adm node-logs -u crio my-node-name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

View kubelet logs on a given node

A

oc adm node-logs -u kubelet my-node-name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

View all journal logs on a given node

A

oc adm node-logs my-node-name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Login into a node and check if kubelete is running

A

oc debug node/my-node-name
chroot /host
systemctl is-active kubelet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Login into a node and show low-level information about all local containers running on the node

A

oc debug node/my-node-name
chroot /host
crictl ps

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Display a pod logs

A

oc logs my-pod-name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Display a container logs

A

oc logs my-pod-name -c my-container-name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Run a given deployment as root

A

oc debug deployment/my-deployment-name –as-root

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Change a pod log level to shows max amount of information

A

oc get pods –loglevel 10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Extract your oc login token so you can use it in a curl request

17
Q

Opens a shell inside a pod to run shell commands

A

oc rsh my-pod-name

18
Q

Copies local files to a location inside a pod

A

oc cp /local/path my-pod-name:/container/path

19
Q

Creates a TCP tunnel from local-port on your workstation to local-port on the pod

A

oc port-forward my-pod-name local-port:remote-port

20
Q

List storage classes of a cluster

A

oc get storageclass

21
Q

Add a volume to an application

A

oc set volumes deployment/example-application –add
–name example-pv-storage
–type pvc
–mount-path /var/lib/example-app
–claim-class nfs-storage
–claim-mode rwo
–claim-size 15Gi
–claim-name example-pv-claim

22
Q

Delete a volume

A

oc delete pvc/example-pvc-storage

23
Q

List cluster nodes using admin cert as opposed to login/password

A

oc –kubeconfig /home/user/auth/kubeconfig get nodes

24
Q

Delete kubeadmin user

A

oc delete secret kubeadmin -n kube-system

25
List all pods inside internal image registry project
oc get pod -n openshift-image-registry
26
Tail the logs of the internal image reg operator
1) Determine the pod name with: oc get pod -n openshift-image-registry 2) oc logs -f OPERATOR-POD-NAME -n openshift-image-registry
27
Verify that etc is running
1) oc debug node/master01 2) chroot /host 3) crictl ps --name etcd
28
Check if an image exist on image registry
skopeo inspect docker://registry.redhat.io/rhel8/postgresql-13:1
29
App was created with typo in image reg. How to fix it?
1) Find the right image. Use skopeo to inspect 2) oc edit deployment/deployment-name
30
When you create a storage volume, you need to provide a parameter claim-class. How do you obtain values for this parameter?
oc get storageclasses
31
Content to add to Oauth.yaml when adding htpasswd identify provider
32
Steps to add a htpasswd provider
1) Create htpasswd file and populate it 2) Create secret with htpasswd file 3) Assign admin users the cluster-admin role 4) Extract oauth 5) Add identity provider to oauth.yaml 6) Replace oauth.yaml
33
Check what happened to a failed app
1) oc get pods 2) oc get status 3) oc get events 4) skopeo inspect docker://registry.redhat.io/rhel8/postgresq-13:1 5) oc edit deployment/psql
34
Different volum access modes
rwx: vol can be mounted as read-write by many nodes. rwo: vol can be mounted as read-write by a single node rox: vol can be mounted as read-only by many nodes