Kubernetes Mock Exam 3
Task 1 1. Create service account #kubectl create serviceaccount pvviewer 2. Create cluster role - list pv #kubectl create clusterrole pvviewer-role --resource=persistentvolumes --verb=list 3. Create cluster rolebinding #kubectl create clusterrolebinding pvviewer-role-binding --clusterrole=pvviewer-role --serviceaccount=default:pvviewer 4. Create pod with service account #kubectl run --generator=run-pod/v1 pvviewer --image=redis --dry-run -o yaml > pod.yaml Add yaml file serviceAccountName: pvviewer #kubectl create -f pod.yaml Document: configure service account Task 2 Document: cheatsheet - get ExternalIP of all nodes #kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type="InternalIP")].address}' > /root/node_ips Task 3 Create pod with two containers with different images #kubectl run --generator=run-pod/v1 multi-pod --image=nginx --dry-run -o yaml > multi-pod.yaml Change the yaml file Add second pod an...