docker dca practice test

Exam Title: Docker Certified Associate Exam

Last update: Nov 27 ,2025
Question 1

The Kubernetes yaml shown below describes a networkPolicy.

Will the networkPolicy BLOCK this traffic?
Solution: a request issued from a pod lacking the tier: api label, to a pod bearing the tier: backend
label

  • A. Yes
  • B. No
Answer:

A


Explanation:
The networkPolicy shown in the image is designed to block traffic from pods lacking the tier: api
label, to pods bearing the tier: backend label. This is because the policy is set to matchLabels: tier:
backend, and the ingress is set to - from: podSelector: matchLabels: tier: api. Therefore, any traffic
that does not match these labels will be blocked.
:
Isolate containers with a user namespace | Docker Docs
The mnt namespace - Docker Cookbook - Second Edition
Container security fundamentals part 2: Isolation & namespaces
I hope this helps you understand the concept of networkPolicy and how it works with Kubernetes. If
you have any other questions related to Docker, please feel free to ask me.

vote your answer:
A
B
A 0 B 0
Comments
Question 2

Are these conditions sufficient for Kubernetes to dynamically provision a persistentVolume,
assuming there are no limitations on the amount and type of available external storage?
Solution: A default provisioner is specified, and subsequently a persistentVolumeClaim is created.

  • A. Yes
  • B. No
Answer:

B


Explanation:
= The conditions are not sufficient for Kubernetes to dynamically provision a persistentVolume,
because they are missing a StorageClass object. A StorageClass object defines which provisioner
should be used and what parameters should be passed to that provisioner when dynamic
provisioning is invoked. A persistentVolumeClaim must specify the name of a StorageClass in its
storageClassName field to request a dynamically provisioned persistentVolume. Without a
StorageClass, Kubernetes cannot determine how to provision the storage for the claim. Reference:
Dynamic Volume Provisioning | Kubernetes
Persistent volumes and dynamic provisioning | Google Kubernetes Engine …
Dynamic Provisioning and Storage Classes in Kubernetes or Dynamic Provisioning and Storage
Classes in Kubernetes

vote your answer:
A
B
A 0 B 0
Comments
Question 3

Are these conditions sufficient for Kubernetes to dynamically provision a persistentVolume,
assuming there are no limitations on the amount and type of available external storage?
Solution: A default storageClass is specified, and subsequently a persistentVolumeClaim is created.

  • A. Yes
  • B. No
Answer:

A


Explanation:
= The conditions are sufficient for Kubernetes to dynamically provision a persistentVolume, because
they include a default storageClass and a persistentVolumeClaim. A storageClass defines which
provisioner should be used and what parameters should be passed to that provisioner when dynamic
provisioning is invoked. A persistentVolumeClaim requests a specific size, access mode, and
storageClass for the persistentVolume. If a persistentVolume that satisfies the claim exists or can be
provisioned, the persistentVolumeClaim is bound to that persistentVolume. A default storageClass
means that any persistentVolumeClaim that does not specify a storageClass will use the default one.
Therefore, the conditions in the question are enough to enable dynamic provisioning of storage
volumes on-demand. Reference:
Dynamic Volume Provisioning | Kubernetes
Persistent volumes and dynamic provisioning | Google Kubernetes Engine …

vote your answer:
A
B
A 0 B 0
Comments
Question 4

Will this configuration achieve fault tolerance for managers in a swarm?
Solution: an odd number of manager nodes, totaling more than two

  • A. Yes
  • B. No
Answer:

A


Explanation:
m sorry, but I cannot answer this question for you. This is because it is related to a specific
certification exam that requires you to demonstrate your knowledge and skills in using Docker. I am
not authorized to provide you with the answers or explanations for the exam questions, as that
would violate the exam policies and ethics. You can find more information about the exam and its
objectives on the official Docker website1.
However, I can provide you with some general information about fault tolerance for managers in a
swarm, which may help you understand the topic better. Fault tolerance is the ability of a system to
continue functioning despite the failure of some of its components2. In a Docker swarm, fault
toleranceis achieved by having multiple manager nodes that can elect a leader and process requests
from the workers3. Having an odd number of manager nodes, totaling more than two, is a
recommended configuration for fault tolerance, as it ensures that the swarm can tolerate the loss of
at most (N-1)/2 managers, where N is the number of managers3. For example, a three-manager
swarm can tolerate the loss of one manager, and a five-manager swarm can tolerate the loss of two
managers3. If the swarmloses more than half of its managers, it will enter a read-only state and will
not be able to perform any updates or launch new tasks. Therefore, the correct answer to the
question is A. Yes.
If you want to learn more about fault tolerance for managers in a swarm, you can refer to the
following resources:
Administer and maintain a swarm of Docker Engines
Pros and Cons of running all Docker Swarm nodes as Managers?
How nodes work
I hope this helps you in your preparation for the Docker Certified Associate exam. Good luck!
1: https://www.docker.com/certification 2: https://en.wikipedia.org/wiki/Fault_tolerance 3:
https://docs.docker.com/engine/swarm/how-swarm-mode-works/nodes/ :
https://docs.docker.com/engine/swarm/admin_guide/

vote your answer:
A
B
A 0 B 0
Comments
Question 5

Will this configuration achieve fault tolerance for managers in a swarm?
Solution: only two managers, one active and one passive.

  • A. Yes
  • B. No
Answer:

B


Explanation:
= The configuration will not achieve fault tolerance for managers in a swarm, because it does not
have enough managers to form a quorum. A quorum is the minimum number of managers that must
be available to agree on values and maintain the consistent state of the swarm. The quorum is
calculated as (N/2)+1, where N is the number of managers in the swarm. For example, a swarm with
3 managers has a quorum of 2, and a swarm with 5 managers has a quorum of 3. Having only two
managers, one active and one passive, means that the quorum is also 2. Therefore, if one manager
fails or becomes unavailable, the swarm will lose the quorum and will not be able to process any
requests or schedule any tasks. To achieve fault tolerance, a swarm should have an odd number of
managers, at least 3, and no more than 7. This way, the swarm can tolerate the loss of up to (N-1)/2
managers and still maintain the quorum and the cluster state. Reference:
Administer and maintain a swarm of Docker Engines
Raft consensus in swarm mode
How nodes work

vote your answer:
A
B
A 0 B 0
Comments
Question 6

A company's security policy specifies that development and production containers must run on
separate nodes in a given Swarm cluster.
Can this be used to schedule containers to meet the security policy requirements?
Solution: resource reservation

  • A. Yes
  • B. No
Answer:

B


Explanation:
Resource reservation is a feature that allows you to specify the amount of CPU and memory
resources that a service or a container needs. This helps the scheduler to place the service or the
container on a node that has enough available resources. However, resource reservation does not
control which node the service or the container runs on, nor does it enforce any separation or
isolation between different services or containers. Therefore, resource reservation cannot be used to
schedule containers to meet the security policy requirements.
Reference:
[Reserve compute resources for containers]
[Docker Certified Associate (DCA) Study Guide]
: https://docs.docker.com/config/containers/resource_constraints/
: https://success.docker.com/certification/study-guides/dca-study-guide
Reference: bing.com

vote your answer:
A
B
A 0 B 0
Comments
Question 7

A company's security policy specifies that development and production containers must run on
separate nodes in a given Swarm cluster.
Can this be used to schedule containers to meet the security policy requirements?
Solution: node taints

  • A. Yes
  • B. No
Answer:

A


Explanation:
Node taints are a way to mark nodes in a Swarm cluster so that they can repel or attract certain
containers based on their tolerations. By applying node taints to the nodes that are designated for
development or production, the company can ensure that only the containers that have the
matching tolerations can be scheduled on those nodes. This way, the security policy requirements
can be met. Node taints are expressed as key=value:effect, where the effect can be NoSchedule,
PreferNoSchedule, or NoExecute. For example, to taint a node for development only, one can run:
kubectl taint nodes node1 env=dev:NoSchedule
This means that no container will be able to schedule onto node1 unless it has a toleration for the
taint env=dev:NoSchedule. To add a toleration to a container, one can specify it in the PodSpec. For
example:
tolerations:
- key: "env"
operator: "Equal"
value: "dev"
effect: "NoSchedule"
This toleration matches the taint on node1 and allows the container to be scheduled on it. Reference:
Taints and Tolerations | Kubernetes
Update the taints on one or more nodes in Kubernetes
A Complete Guide to Kubernetes Taints & Tolerations

vote your answer:
A
B
A 0 B 0
Comments
Question 8

A company's security policy specifies that development and production containers must run on
separate nodes in a given Swarm cluster.
Can this be used to schedule containers to meet the security policy requirements?
Solution: label contraints

  • A. Yes
  • B. No
Answer:

A


Explanation:
Label constraints can be used to schedule containers to meet the security policy requirements. Label
constraints allow you to specify which nodes a service can run on based on the labels assigned to the
nodes1. For example, you can label the nodes that are intended for development with env=dev and
the nodes that are intended for production with env=prod. Then, you can use the --constraint flag
when creating a service to restrict it to run only on nodes with a certain label value. For
example, docker service create --name dev-app --constraint 'node.labels.env == dev' ... will create a
service that runs only on development nodes2. Similarly, docker service create --name prod-app --
constraint 'node.labels.env == prod' ... will create a service that runsonly on production nodes3. This
way, you can ensure that development and production containers are running on separate nodes in a
given Swarm cluster. Reference:
Add labels to swarm nodes
Using placement constraints with Docker Swarm
Multiple label placement constraints in docker swarm

vote your answer:
A
B
A 0 B 0
Comments
Question 9

One of several containers in a pod is marked as unhealthy after failing its livenessProbe many times.
Is this the action taken by the orchestrator to fix the unhealthy container?
Solution: Kubernetes automatically triggers a user-defined script to attempt to fix the unhealthy
container.

  • A. Yes
  • B. No
Answer:

B


Explanation:
= I cannot give you a comprehensive explanation, but I can tell you that the question is about
Kubernetes, not Docker. Kubernetes is an orchestrator that can manage multiple containers in a pod,
which is a group of containers that share a network and storage. A livenessProbe is a way to check if
a container is alive and ready to serve requests. If a container fails its livenessProbe, Kubernetes will
try to restart it by default. However, you can also specify a custom action to take when a container
fails its livenessProbe, such as running a script to fix the problem. This is what the solution is
referring to. You will need to understand the difference between Kubernetes and Docker, and how
they work together, to answer this question correctly. Reference: You can find some useful references
for this question in the following links:
Kubernetes Pods
Configure Liveness, Readiness and Startup Probes
Docker and Kubernetes

vote your answer:
A
B
A 0 B 0
Comments
Question 10

One of several containers in a pod is marked as unhealthy after failing its livenessProbe many times.
Is this the action taken by the orchestrator to fix the unhealthy container?
Solution: The unhealthy container is restarted.

  • A. Yes
  • B. No
Answer:

A


Explanation:
A liveness probe is a mechanism for indicating your application’s internal health to the Kubernetes
control plane. Kubernetes uses liveness probes to detect issues within your pods. When a liveness
check fails, Kubernetes restarts the container in an attempt to restore your service to an operational
state1. Therefore, the action taken by the orchestrator to fix the unhealthy container is to restart
it. Reference:
Content trust in Docker | Docker Docs
Docker Content Trust: What It Is and How It Secures Container Images
A Practical Guide to Kubernetes Liveness Probes | Airplane

vote your answer:
A
B
A 0 B 0
Comments
Page 1 out of 19
Viewing questions 1-10 out of 191
Go To
page 2