7+ Flashcards
A ‘PodSelector’ field in a network policy maps to what?
A label within a pod
‘app’ is defined where?
Within deployment manifest
____ volumes create storage on a node when the pod is assigned to the node. The storage disappears when the pod leaves the node.
EmptyDir
How does a PVC bind to a PV?
via the ‘storageClassName’
kubectl command to view the stdout of a container?
logs
kubectl command to perform a shell command on the container?
exec
pod securityContext spec fields
- runAsUser
2. fsGroup
resources fields
- request (memory, cpu)
2. limits (memory, cpu)
how to export pod descriptor and save to file?
kubectl get pod [podname] -n [namespace] -o yaml –export > nginx-pod.yml
add to delete commands
–grace-period=0 –force
some debugging options for a bad pod
kubectl get pods -n [namespace]
kubectl top pods -n [namespace]
kubectl logs [podname] -n [namespace]
how to remove extraneous info from yaml output?
add –export after -o yaml
what is caveat of ‘export’ flag?
It removes the ‘namespace’ from the pod manifest, so you will have to specify the namespace when you kubectl apply
how to change image of deployment?
kubectl set image deployment/[deployment] imageName=image
how to see rollout status?
kubectl rollout status deployment/[deploymentname]