Mastering Docker & Kubernetes (CKA) - Basic To Expert
+ AWS
1. Command to use to get max details about an volume: docker volume inspect vol
2. is thiis command is the right way to set a volume ?
docker run -it --name=example3 --rm -v /opt/software/EAR/:/app/data/ centos-
: Correct command: docker run -it --name example2 --rm -v vol1:/app/data/ centos
3. Is this command is correct,
docker run -it --name example3 --mount type=vol,source=/opt/soft- ware/EAR/,target=/app/data/ centos: The
command is for bind mount not for volume mount the correct comamnd is docker run -it --name example3 --mount
type=bind,source=/opt/software/EAR/,target=/app/data/ centos
4. Can we share volume data and bind data ro multiple containers ? True
False, For volume you can and bind you canoot.: False, for volume and bind you cannot
5. which network supports use the IP Address of my host machine on my container.: Host network
6. Can we use the share the netwrok from an other container ? True
False, its only possible in kubernetes: We can using the container network on the same namespace.
7. Will this command create network "docker network create --driver bridge
--subnet "172.20.0.0/16" APP1NET" and what's the name of the network it would create?: APP1NET
8. The command "docker network create --driver bridge --subnet "172.20.0.0/16" APP1NET" is unique from the
default bridge network because
?: its name and its subnet will be unique
9. Do we need to use yum to install and other package for docker swarm
?: False, no need to install any other package for Docker Swarm
10.When I execute this command " docker swarm init--advertise-addr 172.24.0.200" is it mandatory to copy
and note down the token address and details for joining ?: False
11.To scale down the replica can I use "docker service scale NGINX_REPLI- CA=6": well, You dont know the
initial value of the number of replica, so we cannot assume that changing this value to 6 would increase or decrease the
number of replicas created. Hence None of the above.
12.To add label to a docker container what's the correct command: docker node update --label-add type =
slave <node-id>
, Mastering Docker & Kubernetes (CKA) - Basic To Expert
+ AWS
13.Can we get the error message or event message by using the following option with kubeadm: Hey! you
need to use kubectl command not kubeadm.
14.which option will get you more details about the port or the node where the pod is hosted while using kubectl
get pods.: The correct command is kubectl get pods - o wide
15.Can we use this command to create a kube pod ? Command: kubectl run centos1 --image=centos --
restart=Never --rm -it sh: False
16.what's the function of this command "kubectl label pod web1 env-": Re- moves the label entry for env
17.what's soemthing you would define first under a kind: pod
specs:
containers:
???: -name: my-container
18.In matchExpressions what' is operate exists meaning for a key label ?: The key value needs to be present 100%
or cannot be considered under that selector
19.Can we change the replica set using command line using which command-
: None of the above, the docs say this:
kubectl scale --replicas=5 -f nginx_replicaset.yaml kubectl autoscale rs
web --max=5
20.Create a pod manually in CLI with the same name of the label which was part of the replicaset will result
in ?: termination of the pod created newly
21.Is this statement Correct: The Match Label is going to match the labels which are described part of the
container definision as in the name of the container ?
True
False: False
22.what will happen if you remove the pods without removing replicaset first
?: pods will be removed and recreated by the replicaset
23.what's the concept of deployment strategy in which we can test new version of application before going live
across all the cluster ?: canary method
24.what option to select rolling update as your deployment strategy type
?: RollingUpdate
25.what's the use of selector ?: To select the proper label in your pods
26.what's the target port in load balancer type part of service ?: Its the remote container port
27.While using blue-green deployment, which base deployment steargy used
?: recreate
, Mastering Docker & Kubernetes (CKA) - Basic To Expert
+ AWS
28.Update the deployment with the image version 1.16.1 and verify the im- age and check the rollout history:
kubectl set image deploy/webapp nginx=ng- inx:1.16.1
kubectl describe deploy webapp | grep Image kubectl rollout history
deploy webapp
29.Create a deployment called webapp with image nginx having 5 replicas in it, put the file in /tmp
directory with named webapp.yaml: apiVersion: apps/v1 kind: Deployment
metadata:
labels:
app: webapp name:
webapp spec:
replicas: 5 selector:
matchLabels:
app: webapp template:
metadata:
labels:
app: webapp spec:
containers:
- image: nginx name:
nginx
Note: Search "deployment" in kubernetes.io site , you will get the page
https://kubernetes.io/docs/concepts/workloads/controllers/deplo yment/
// Verif y the Deployment
kubectl get deploy webapp --show-labels
// Output theYA ML file of the deployment webapp kubectl get deploy
webapp -o yaml
30.Get the pods with labels env=dev and env=prod and output the labels as well: kubectl get pods -l 'env in
(dev,prod)' --show-labels
31.Create an nginx pod which loads the secret as environment variables: // create a yml file
kubectl run nginx --image=nginx --restart=Never --dry-run -o
+ AWS
1. Command to use to get max details about an volume: docker volume inspect vol
2. is thiis command is the right way to set a volume ?
docker run -it --name=example3 --rm -v /opt/software/EAR/:/app/data/ centos-
: Correct command: docker run -it --name example2 --rm -v vol1:/app/data/ centos
3. Is this command is correct,
docker run -it --name example3 --mount type=vol,source=/opt/soft- ware/EAR/,target=/app/data/ centos: The
command is for bind mount not for volume mount the correct comamnd is docker run -it --name example3 --mount
type=bind,source=/opt/software/EAR/,target=/app/data/ centos
4. Can we share volume data and bind data ro multiple containers ? True
False, For volume you can and bind you canoot.: False, for volume and bind you cannot
5. which network supports use the IP Address of my host machine on my container.: Host network
6. Can we use the share the netwrok from an other container ? True
False, its only possible in kubernetes: We can using the container network on the same namespace.
7. Will this command create network "docker network create --driver bridge
--subnet "172.20.0.0/16" APP1NET" and what's the name of the network it would create?: APP1NET
8. The command "docker network create --driver bridge --subnet "172.20.0.0/16" APP1NET" is unique from the
default bridge network because
?: its name and its subnet will be unique
9. Do we need to use yum to install and other package for docker swarm
?: False, no need to install any other package for Docker Swarm
10.When I execute this command " docker swarm init--advertise-addr 172.24.0.200" is it mandatory to copy
and note down the token address and details for joining ?: False
11.To scale down the replica can I use "docker service scale NGINX_REPLI- CA=6": well, You dont know the
initial value of the number of replica, so we cannot assume that changing this value to 6 would increase or decrease the
number of replicas created. Hence None of the above.
12.To add label to a docker container what's the correct command: docker node update --label-add type =
slave <node-id>
, Mastering Docker & Kubernetes (CKA) - Basic To Expert
+ AWS
13.Can we get the error message or event message by using the following option with kubeadm: Hey! you
need to use kubectl command not kubeadm.
14.which option will get you more details about the port or the node where the pod is hosted while using kubectl
get pods.: The correct command is kubectl get pods - o wide
15.Can we use this command to create a kube pod ? Command: kubectl run centos1 --image=centos --
restart=Never --rm -it sh: False
16.what's the function of this command "kubectl label pod web1 env-": Re- moves the label entry for env
17.what's soemthing you would define first under a kind: pod
specs:
containers:
???: -name: my-container
18.In matchExpressions what' is operate exists meaning for a key label ?: The key value needs to be present 100%
or cannot be considered under that selector
19.Can we change the replica set using command line using which command-
: None of the above, the docs say this:
kubectl scale --replicas=5 -f nginx_replicaset.yaml kubectl autoscale rs
web --max=5
20.Create a pod manually in CLI with the same name of the label which was part of the replicaset will result
in ?: termination of the pod created newly
21.Is this statement Correct: The Match Label is going to match the labels which are described part of the
container definision as in the name of the container ?
True
False: False
22.what will happen if you remove the pods without removing replicaset first
?: pods will be removed and recreated by the replicaset
23.what's the concept of deployment strategy in which we can test new version of application before going live
across all the cluster ?: canary method
24.what option to select rolling update as your deployment strategy type
?: RollingUpdate
25.what's the use of selector ?: To select the proper label in your pods
26.what's the target port in load balancer type part of service ?: Its the remote container port
27.While using blue-green deployment, which base deployment steargy used
?: recreate
, Mastering Docker & Kubernetes (CKA) - Basic To Expert
+ AWS
28.Update the deployment with the image version 1.16.1 and verify the im- age and check the rollout history:
kubectl set image deploy/webapp nginx=ng- inx:1.16.1
kubectl describe deploy webapp | grep Image kubectl rollout history
deploy webapp
29.Create a deployment called webapp with image nginx having 5 replicas in it, put the file in /tmp
directory with named webapp.yaml: apiVersion: apps/v1 kind: Deployment
metadata:
labels:
app: webapp name:
webapp spec:
replicas: 5 selector:
matchLabels:
app: webapp template:
metadata:
labels:
app: webapp spec:
containers:
- image: nginx name:
nginx
Note: Search "deployment" in kubernetes.io site , you will get the page
https://kubernetes.io/docs/concepts/workloads/controllers/deplo yment/
// Verif y the Deployment
kubectl get deploy webapp --show-labels
// Output theYA ML file of the deployment webapp kubectl get deploy
webapp -o yaml
30.Get the pods with labels env=dev and env=prod and output the labels as well: kubectl get pods -l 'env in
(dev,prod)' --show-labels
31.Create an nginx pod which loads the secret as environment variables: // create a yml file
kubectl run nginx --image=nginx --restart=Never --dry-run -o