Create a namespace called 'development' and a pod with image nginx called nginx on this namespace.

Create a namespace called 'development' and a pod with image nginx called nginx on this namespace.A . Solution: kubectl create namespace development kubectl run nginx --image=nginx --restart=Never -n developmentView AnswerAnswer: A

December 12, 2020 No Comments READ MORE +

Create a busybox pod that runs the command "env" and save the output to "envpod" file

Create a busybox pod that runs the command "env" and save the output to "envpod" fileA . Solution: kubectl run busybox --image=busybox --restart=Never --rm -it -- env > envpod.yamlView AnswerAnswer: A

December 12, 2020 No Comments READ MORE +

Create a pod with image nginx called nginx and allow traffic on port 80

Create a pod with image nginx called nginx and allow traffic on port 80A . Solution: kubectl run nginx --image=nginx --restart=Never --port=80View AnswerAnswer: A

December 12, 2020 No Comments READ MORE +

Create a Pod with main container busybox and which executes this "while true; do echo `Hi I am from Main container' >> /var/log/index.html; sleep 5; done" and with sidecar container with nginx image which exposes on port 80. Use emptyDir Volume and mount this volume on path /var/log for busybox and on path /usr/share/nginx/html for nginx container. Verify both containers are running.

Create a Pod with main container busybox and which executes this "while true; do echo `Hi I am from Main container' >> /var/log/index.html; sleep 5; done" and with sidecar container with nginx image which exposes on port 80. Use emptyDir Volume and mount this volume on path /var/log for busybox...

December 12, 2020 No Comments READ MORE +

Change the Image version to 1.15-alpine for the pod you just created and verify the image version is updated.

Change the Image version to 1.15-alpine for the pod you just created and verify the image version is updated.A . Solution: Kubect1 set image pod/nginx nginx=nginx:1.15-alpine kubect1 describe po nginx // another way it will open vi editor and change the version kubeclt edit po nginx kubect1 describe po nginxView...

December 11, 2020 No Comments READ MORE +

List the nginx pod with custom columns POD_NAME and POD_STATUS

List the nginx pod with custom columns POD_NAME and POD_STATUSA . Solution: kubectl get po -o=custom-columns="POD_NAME:.metadata.name, POD_STATUS:.status.containerStatuses[].state"View AnswerAnswer: A

December 11, 2020 No Comments READ MORE +

Create a pod that having 3 containers in it? (Multi-Container)

Create a pod that having 3 containers in it? (Multi-Container)A . Solution: image=nginx, image=redis, image=consul Name nginx container as "nginx-container" Name redis container as "redis-container" Name consul container as "consul-container" Create a pod manifest file for a container and append container section for rest of the images kubectl run multi-container...

December 11, 2020 No Comments READ MORE +

List all the pods sorted by name

List all the pods sorted by nameA . Solution: kubectl get pods --sort-by=.metadata.nameView AnswerAnswer: A

December 11, 2020 No Comments READ MORE +

List pod logs named "frontend" and search for the pattern "started" and write it to a file "/opt/error- logs"

List pod logs named "frontend" and search for the pattern "started" and write it to a file "/opt/error- logs"A . Solution: Kubectl logs frontend | grep -i "started" > /opt/error-logsView AnswerAnswer: A

December 10, 2020 No Comments READ MORE +

Print pod name and start time to "/opt/pod-status" file

Print pod name and start time to "/opt/pod-status" fileA . Solution: kubect1 get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"t"}{.status.podIP}{""}{end}'View AnswerAnswer: A

December 10, 2020 No Comments READ MORE +