0% found this document useful (0 votes)
36 views8 pages

Kubernetes

Kubernetws

Uploaded by

rhtmdv123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views8 pages

Kubernetes

Kubernetws

Uploaded by

rhtmdv123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Kubernetes

1. What is true of a blue/green


deployment?
Ans: During deployment, both the
current and the new version of the
application are running at the same
time so that traffic can be drained
from the current version and all new
traffic can be sent to the new version.
2. What does the envFrom attribute do
in a container in the context of a
ConfigMap?
Ans: Defines all of the ConfigMap's
data contents as container
environment variables; the keys in the
ConfigMap become environment
variable names
3. You are working on an application
that depends on a third-party service.
When the application boots, it must
perform a long-running handshake
with the third party before it can
successfully handle requests. How
would you implement this in
Kubernetes?
Ans: Implement a readiness probe that
checks if the third-party handshake
was successful. Kubernetes will
automatically handle the flow of traffic
to the Pods
4. What are the managed Kubernetes
control plane services from the three
major cloud vendors?
Ans: Azure Kubernetes Service,
Amazon Elastic Kubernetes Service,
and Google Kubernetes Engine
5. You have five containers and two
Pods. To retrieve the logs, you run the
following command:
kubectl logs -f -1 - -all-containers
How many of these containers will
start streaming their logs?
Ans: Five
6. In Kubernetes, which object stores
sensitive data such as a password?
Ans: Secrets
7. Which protocol would you use in
port forwarding to access a database
in a Pod?
Ans: Transmission Control Protocol
(TCP)
8. What type of resources can
Persistent Volume Claims request?
Ans: Storage resources
9. In Kubernetes, what is the most
common cause of a Pod becoming
stuck in Pending when trying to
become scheduled onto a node?
Ans: Because of insufficient resources
in the Pod of one type or another
10. A growing agile software
development team wants to work on
different parts of an internal
application at the same time. To do so,
the team splits into smaller groups.
These groups want to create
decomposed modules that are loosely
coupled and deployed independently.
How can the teams do this?
Ans: Write the new modules as
microservices in Docker containers
and deploy them independently onto
the same Kubernetes cluster.
11. The main non-functional
requirements of a software project for
the architecture team are:
1. Host anywhere;
2. Support decoupled services that
can be independently deployed and
scaled;
3. Ensure dependency management is
part of the deployment unit;
4. Orchestrate components and
enable discovery
Which approach can meet these
requirements?
Ans: Write a containerized collection
of microservices, and deploy and
manage them using Kubernetes
12. What is the small controllable unit
in Kubernetes?
Ans: Pod
13. What is a key benefit of running a
containerized application on
Kubernetes?
Ans: Orchestration and scheduling
14. What object fulfills the Ingress in
Kubernetes?
Ans: An Ingress controller
15. What is the result of running the
following command: kubectl port-
forward service/redis-master
6000:5000?
Ans: It forwards connections from port
6000 to port 5000
16. When using a managed Kubernetes
service from a cloud services provider,
what responsibilities does the cloud
provider have for the cluster?
Ans: It must ensure that the
Kubernetes control plane, and the
underlying compute and network
infrastructure, are operational.
17. What is the safest way to store and
share passwords, keys, and tokens in a
Kubernetes cluster?
Ans: Secrets
18. What is the file standard for
Docker and Kubernetes
configurations?
Ans: YAML
19. You are ready to release a new
version of your containerized
application. What Kubernetes
deployment feature would you us to
deploy the container into production
without taking the application down?
Ans: Kubernetes deployment with
rolling updates that enable you to
deploy new containers without
downtime.
20. In Kubernetes networking, what
does Ingress do?
Ans: Expose HTTP and HTTPS routes
from outside the cluster to services
within the cluster

1. Of the following, which property of a


Pod do you set to provide
configuration to the container it is
running?
Ans: Environment variables
2. You created a Deployment with five
replicas using the command kubectl
apply -f
https://eg.com/demo/controllers/dep.
yam1. How can you verify if all five
replicas are ready in the Deployment?
Ans: Run kubectI get deployments and
check if the AVAILABLE label has the
number five in it
3. Your team uses kubect I to manage
all aspects of your company's
Kubernetes deployment. You are
onboarding several DevOps engineers
on the team who will take over the
day-to-day management of simple
tasks related to deployments. Which
solution is most appropriate and will
help your company scale?
Ans: The updated kubect1 command
structure
4 You are generating Kubernetes
resources using kompose. You use the
following kompose labels in your
docker -compose. yaml
file:
kompose. volume. size as 1Gi for the
requests storage's size in the
PersistentVolumeClaim
kompose.service. type as node to
designate the service to be created
kompose.controller.type as daemonset
to convert the deployment upon
creation
When you run kompose convert, the
command fails. Why is this?
Ans: You must define the kompose.
service. type as nodeport instead.
5. You have a simple Pod definition
with two containers. One container is a
sidecar and the Pod is scheduled to
run once on all three worker nodes in a
cluster. How many IP addresses will
the Pods consume in total?
Ans: Three IP addresses, one per Pod
6. What changes will you make to the
following deployment definition to
ensure that there were no unavailable
Pods and never more than 12 Pods
running nginx during a rolling update
deployment?
Ans:
spec:
replicas: 10 strategy:
type: RollingUpdate rollingUpdate:
maxSurge: 2
maxUnavailable: 0
7. You evicted all of the Pods from the
FIRE node using the command kubect]
drain BFIRE. Also, during the
maintenance operation, the node is
left in the cluster. What command
informs Kubernetes to carry on
scheduling fresh Pods on this node?
Ans: kubect1 uncordon BFIRE
8. Your company must connect a
containerized application with a Redis
database running outside Kubernetes.
The application container is trying to
connect to a Redis instance running on
localhost. How can you use the
ambassador container design pattern
instead of a direct connection to the
Redis database?
Ans: You can use an ambassador
container as a secondary container in
the Pod, launching a proxy application
that is forwarding requests from the
localhost connection to a remote
Redis server.
9. You are seeing issues with your
microservice application that suggest
one microservice is failing to respond.
Your logs and monitoring, however, are
not helping you identify which one.
Which kubect1 action would be useful
for testing possible services
individually from your local computer?
Ans: kubect1 port-forward
10. Why might a Kubernetes cluster
annotate an endpoint's resource with
the over-capacity: truncated
annotation?
Ans: The number of endpoints
exceeded the count of 1,000.
11. When would you use Kernel
Monitor with the Translator plugin for
kernel logging in Kubernetes?
Ans: If you are trying to translate
kernel logs into an internal data
structure
12 You want your company's
Kubernetes deployments to use
dynamic Secret values generated as a
set of files. Because you manage
several clusters, what is the most
effective way to handle this?
Ans: Attach Secrets files to Pods by
declaring a volume that will mount
each Secret as a file in the Pod
definition.
13 What does the kubect] port-
forward command do?
Ans: Forward one or more local ports
to a Pod.
14. One of your Pods needs access to
a Service that has an associated port
that is published and a cluster IP is in
its place. The client Pod's environment
variables aren't yet populated,
however. Why?
Ans: You must create the Service
before creating the client Pods.
15. What statement describes the
relationship between a Persistent
Volume (P) and Persistent
VolumeClaim (PVC) in a
Kubernetes cluster?
Ans: The PVC is a request for storage
that requires a PV with your desired
specification (such as size or mount
options) from Kubernetes and binds it
to Pods where you can mount it as a
volume
16. You created a Service that targets
Transmission Control Protocol (TCP)
port 9376 on any Pod with the
app=Demo label. When checking if
your Pod Service was formed
correctly, what feature should you look
for?
Ans: Whether the port you are trying
to access is in spec. ports []
17. You have a Pod definition with two
containers, one is a web application
that only listens to HTTP traffic and
the other is a sidecar providing
configuration and logging. How would
the web application container
communicate with the sidecar?
Ans: By using the container hostname
on the local network within the Pod
18. What happens if a Pod that is in
the running state fails a readiness
probe check?
Ans: The Pod stops receiving traffic
until the probe is successful.
19 You install kubect1 in your system
which is currently pointing to
minikube. How would you point it to
docker -desktop?
Ans: kubect1 config get-contexts
kubectl config use-context docker-
desktop
20 What do security context objects
do in a Kubernetes cluster?
Define networking policies for
Kubernetes Pods; for example setting
Ans:
Define privilege and access control
settings for a Pod or container; for
example running the process with a
specific user ID

You might also like