Check the image version in pod without the describe command
Answer: See the solution below.
Explanation:
kubectl get po nginx -o
jsonpath='{.spec.containers[].image}{"\n"}'
Get list of all pods in all namespaces and write it to file “/opt/pods-list.yaml”
Answer: See the solution below.
Explanation:
kubectl get po –all-namespaces > /opt/pods-list.yaml
Create a deployment as follows:
Name:nginx-random
Exposed via a servicenginx-random
Ensure that the service & podare accessible via theirrespective DNS records
The container(s) within anypod(s) running as a part of thisdeployment should use
thenginxImage
Next, use the utilitynslookupto lookup the DNS records of the service &pod and write the
output to/opt/KUNW00601/service.dnsand/opt/KUNW00601/pod.dnsrespectively.
Answer: See the solution below.
Explanation:
Solution:
List “nginx-dev” and “nginx-prod” pod and delete those pods
Answer: See the solution below.
Explanation:
kubect1 get pods -o wide
kubectl delete po “nginx-dev”kubectl delete po “nginx-prod
List the nginx pod with custom columns POD_NAME and POD_STATUS
Answer: See the solution below.
Explanation:
kubectl get po -o=custom-columns="POD_NAME:.metadata.name,
POD_STATUS:.status.containerStatuses[].state"
Page 3 out of 13 Pages |
Previous |