Trending Kubernetes Questions and Answers from 2022

Kubernetes Questions

What is Minikube?
Minikube is a light weight version of Kubernetes that can run on a local machine or a local VM.
It is used for learning, evaluation and development purpose only.
Minikube has an actual Kubernetes code, hence it runs all the Kubernetes CLI commands.
Minikube cluster has only one Master and one worker node.

The basic components of Kubernetes architecture are Master node, several Worker Nodes and key value store called etcd .
A Cluster in Kubernetes is a group of computers(physical or virtual) connected togther to perform a task. The cluster consists of one or more Master nodes that control the Worker nodes .

Kubernetes master

App Management commands
autoscale – This command creates an autoscaler that automatically decides the number of pods that run in a kubernetes cluster.

  • create – The create command is used to create Kubernetes objects from the corresponding YAML or JSOn file.
  • delete- Deletes Objects by file name, stdin, resource and names.
  • edit- Edits a resource from the default editor.
  • get – The get command gets specific resources or objects fromthe Kubernetes and displays them

Ex: kubectl get deployments This command will fetch all the deployments in Kubernetes cluster.

Containerization


Containerization is a virtualization technique in which the application and all its dependencies are packed into a single isolated package called a containerand can be run on the host OS, virtual machines and on cloud.

Need for Containerization


Every business depends on software and every software needs its own set of dependencies. Containerization helps to bundle the applications and its dependencies into an isolated package that can run on any platform or OS.

Dockers

There are many container systems available out there to create, run and deploy containers but dockers is the ubiquitous leader. It is so popular that it has become the synonym for containers. Some other famous container systems are

  • rkt
  • LXC(Linux containers)

Docker Swarm

Docker Swarm is an inbuilt docker container orchestration and management tool. It is used for creating the node clusters, scaling up the application and rolling changes and updates.
To use Docker in swarm mode, install Docker. See installation instructions for all operating systems and platforms. By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production.

Current versions of Docker include swarm mode for natively managing a cluster of Docker Engines called a swarm. Use the Docker CLI to create a swarm, deploy application services to a swarm, and manage swarm behavior.

Docker Swarm mode is built into the Docker Engine. Do not confuse Docker Swarm mode with Docker Classic Swarm which is no longer actively developed.

kube-scheduler

The Kubernetes scheduler is a control plane process which assigns Pods to Nodes. The scheduler determines which Nodes are valid placements for each Pod in the scheduling queue according to constraints and available resources. The scheduler then ranks each valid Node and binds the Pod to a suitable Node. Multiple different schedulers may be used within a cluster; kube-scheduler is the reference implementation. kube-scheduler checks for newly created pods that haven’t been assigned to any worker nodes and assigns them to worker nodes, it schedules work to the Worker nodes. It considers many factors for scheduling such as

  • resource requirement and availability
  • data locality
  • hardware/software policy constraints
  • deadlines
  • kube-controller-manager

It manages the Kubernetes cluster and helps maintain the desired state of the cluster. It is not a single component, it is made of other controllers such as node controller, Replication controller, end-points controller, service-account and token controller.

Container Orchestration


Kubernetes is a Container Orchestration System but what is container orchestration and why do you even need it.

Need for Container Orchestration


A useful application depends on other applications/functionalities to complete a task. It’s good to keep logically distinct applications/functionalities separate , it helps in developing, testing , scaling and deployment. But these applications need to interact with each other to become a useful software system. This is where container orchestration comes into picture, it runs and manages multiple containers containing different applications or different functionalities of a single application and establishes communication between them.

Kubernetes Questions and Answers MCQ

What is a worker node?
Choose the correct option from below list:
i) A place to securely store and share Docker images with all cluster users
ii) A persistent storage instance
iii) The compute host, typically a virtual machine, that your pods run on
iv) Another name for your cluster

Right Answer- iii) The compute host, typically a virtual

The master to cluster coomunications starts at the apiserver and ends at______
Choose the correct option from below list:
i) kubelet’s HTTPs endpoint
ii) Node
iii) None of these
iv) Kube-proxy

Right Answer- i) kubelet’s HTTPs endpoint

The Minikube cluster has_____master and _____nodes.
Choose the correct option from below list:
i) One,Many
ii) One,One
iii) Two,Two
iv) One,Two

Right Answer- ii) One,One

kubectl command lists one or more resources.
Choose the correct option from below list:
i) list
ii) get
iii) All of the these
iv) desc

Right Answer- ii) get

Which label selectors select all the objects in a collection?
Choose the correct option from below list:
i) set based`
ii) Null
iii) Empty
iv) None of these

Right Answer- iii) Empty

Which kubectl command is used to display information about the master and services in the cluster?
Choose the correct option from below list:
i) kubelet
ii) All of these
iii) Master-info
iv) Kubernetes-info
e) Cluster-info

Right Answer- e) Cluster-info

Nodes contain_____ and pods contain_______.
Choose the correct option from below list:
i) Containers, Pods
ii) kubelet,kube-proxy
iii) Pods, Container
iv) Container-runtime, containers

Right Answer- iii) Pods, Container

__ are the Objects used to define a logical set of Pods.
Choose the correct option from below list:
i) Nodes
ii) Containers
iii) Services
iv) Deployments

Right Answer- iii) Services

Master and Node can run on the same machine.
Choose the correct option from below list:
i) True
ii) False

Right Answer- ii) False

Kubelet is required on every Node?
Choose the correct option from below list:
i) True
ii) False

Right Answer- i) True

Which of these is not a kubernetes Master components?
Choose the correct option from below list:
i) etcd
ii) Kube-controller-manager
iii) kube-apiserver
iv) DNS Server

Right Answer- iv) DNS Server

Which of these is a Node component
Choose the correct option from below list:
i) kubelet
ii) Kube-proxy and kubelet
iii) Cloud-controller-manager
iv) Kube-proxy

Right Answer- ii) Kube-proxy and kubelet

Which of the following commands do we use to open up a proxy on localhost for the Kubernetes cluster?
Choose the correct option from below list:
i) DNS Server
ii) etcd
iii) Kubectl-proxy
iv) kubelet

Right Answer- iii) Kubectl-proxy

Kube scheduler is used to assign nodes to_____
Choose the correct option from below list:
i) newly created pods that aren0t assigned any nodes
ii) Pods that are deleted
iii) Old pods that arenot assigned to any nodes
iv) pods that were created and scaled

Right Answer- i) newly created pods that arenot assigned any nodes

The Kubernetes CLI tool is called______
Choose the correct option from below list:
i) kubecommand
ii) kubectl
iii) kubelet
iv) minikube

Right Answer- ii) kubectl

https://crackyourinterview.com/Ads-Which-computing-points-to-services-and-applications-that-operate-on-a-distributed-network-utilizing-virtualized-resources?.aspx

What are labels?
Choose the correct option from below list:
i) Key-value pair to select and group objects
ii) Key-value pair that map object to node
iii) All of these
iv) Key-value pair to organize and select attributes of an object

Right Answer- iv) Key-value pair to organize and select attributes of an object

The desired state of a Node is described by______?
Choose the correct option from below list:
i) Deployment Controller
ii) Deployment Object
iii) Deployment Runner
iv) All of these

Right Answer- ii) Deployment Object

Logical group of similar type of containers is called______.
Choose the correct option from below list:
i) Nodes
ii) Pods
iii) Cluster
iv) Arrows

Right Answer- ii) Pods

_____is a system generated string that uniquely identifies an object.
Choose the correct option from below list:
i) PID
ii) object ID
iii) None of these
iv) UID

Right Answer- iv) UID

Which command is used to create an object?
Choose the correct option from below list:
i) $kubectl build
ii) $kubectl create
iii) $kubectl -create
iv) Kubectl –create

Right Answer- ii) $kubectl create

The Names inside a namespace can be similar
Choose the correct option from below list:
i) True
ii) False

Right Answer- ii) False

What are Objects used for?
Choose the correct option from below list:
i) All of these
ii) group set of objects
iii) Define the state of the cluster
iv) run a set of objects

Right Answer- iii) Define the state of the cluster

Objects are used to maintain the __ state.
Choose the correct option from below list:
i) Actual State
ii) Stable state
iii) Running State
iv) Desired State

Right Answer- iv) Desired State

Kubernetes supports inbuilt logging and monitoring mechanism
Choose the correct option from below list:
i) False
ii) True

Right Answer- ii) True

__ is the grouping primtive in Kubernetes that groups objects with same labels.
Choose the correct option from below list:
i) Selectors
ii) Deployments
iii) Services
iv) All of these

Right Answer- i) Selectors

Nodes are created by Kubernetes?
Choose the correct option from below list:
i) False
ii) True

Right Answer- i) False

What are the information provided by Node status?
Choose the correct option from below list:
i) Capacity
ii) All of these
iii) Info
iv) Addresses
e) Conition

Right Answer- ii) All of these

$kubectl get deployments command is used to__________
i) All of these
ii) get the details of the deployment
iii) get the status of actual and desired state
iv) get the details of created deployments

Right Answer- iv) get the details of created deployments

What is the use of edit command
i) use to edit the cluster
ii) used to edit the resource
iii) All of these
iv) edit the number of nodes and masters

Right Answer- ii) used to edit the resource

The command used to evict the pods from the node for maintainenace?
i) drain
ii) clean
iii) kill
iv) flush

Right Answer- i) drain

Which of the following are conatiner orchestration systems?
i) Docker Swarm and Kubernetes
ii) Jenkins
iii) Kubernetes
iv) Docker Swarm

Right Answer- Answer of above question is i) Docker Swarm and Kubernetes

The command used to evict the pods from the node for maintainenace?
i) drain
ii) clean
iii) kill
iv) flush

Right Answer- i) drain

Which of the following are conatiner orchestration systems?
i) Docker Swarm and Kubernetes
ii) Jenkins
iii) Kubernetes
iv) Docker Swarm

Right Answer- Answer of above question is i) Docker Swarm and Kubernetes

What is Containerization?
i) Both Bundling application and its dependencies AND An OS level Virtualization Technique
ii) Separating Application from its platform
iii) An OS level Virtualization Technique
iv) Bundling application and its dependencies

Right Answer- i) Both Bundling application and its dependencies AND An OS level Virtualization Technique

What is Kubernetes?
i) Command Line Interface
ii) Container Runtime
iii) Monitoring tool
iv) Container Orchestration Platform

Right Answer-iv) Container Orchestration Platform

Kubernetes was developed by _ and is maintained by __
i) Amazon,ECS
ii) Microsoft, Apache
iii) Google,CNCF(Cloud Native computing foundation)
iv) Oracle,Docker

Right Answer- 3)Google,CNCF(Cloud Native computing foundation)

What is the Short form and a popular name of Kubenetes?
i) Kube
ii) Kube-orcas
iii) kubelet
iv) K8s

Right Answer- iv) K8s

What is CNCF?
i) Container Network Cloud Foundation
ii) Cloud Native Computing Foundation
iii) Cloud Native Container Foundation
iv) Cloud Native Club Foundation

Answer-ii) Cloud Native Computing Foundation

Which command is used to check the minikube version?
i) Minikube-version
ii) minikube –version
iii) minikube -v
iv) minikube version

Right Answer- iv) minikube version

Kubernetes cluster must contain only one Master?
Choose the correct option from below list:
i) False
ii) True

Right Answer- i) False

Kubernetes Architectutre consists of __
Choose the correct option from below list:
i) Master and Slave
ii) Server and Client
iii) Master and Node
iv) All of the these

Right Answer- iii) Master and Node

scale command is used to set a new size for a Deployment, ReplicaSet, Replication Controller.
Choose the correct option from below list:
i) False
ii) True

Right Answer- ii) True

What is container runtime?
Choose the correct option from below list:
i) Software to manage containers
ii) Software to connect the Master and Node
iii) Software to execute containers
iv) Software to connect to kubernetes

Right Answer- iii) Software to execute containers

The Conditions field describes the status of all _ nodes
Choose the correct option from below list:
i) Stopped
ii) Running
iii) All the Nodes
iv) paused

Right Answer- ii) Running

Which kubectl command is used to delete a resource?
Choose the correct option from below list:
i) kubectl delete
ii) kubectl rm
iii) kubectl -delete
iv) kubectl rmi

Right Answer- i) kubectl delete

Kubernetes checks the validity of a node based on_______field
Choose the correct option from below list:
i) namespace
ii) name
iii) UID
iv) metadata.name

Right Answer- iv) metadata.name

Which container Orchestration platform has no GUI ?
Choose the correct option from below list:
i) All of these
ii) Kubernetes
iii) Mesos
iv) Docker Swarm

Right Answer- iv) Docker Swarm

Which field in Node Status describes the CPU, memory and the maximum number of pods that can be scheduled onto the node.
Choose the correct option from below list:
i) Capacity
ii) Conditions
iii) info
iv) None of these

Right Answer- i) Capacity

Containers inside a pod communicate with each other via __.
Choose the correct option from below list:
i) container IP
ii) Pod IP
iii) None of these
iv) localhost
e) cluster IP

Right Answer- iv) localhost

What is the use of Repllication controller?
Choose the correct option from below list:
i) to manage the communications
ii) to keep the node up and running AND to create pod replicas
iii) to create pod replicas
iv) to keep the node up and running

Right Answer- ii) to keep the node up and running AND to create pod replicas

Pods have a well defined lifecycle
Choose the correct option from below list:
i) True
ii) False

Right Answer- i) True

How are Persistent volumes different from the Volumes used by containers
Choose the correct option from below list:
i) they are more Persistent
ii) None of these
iii) They have a lifecycle different than that of Pods
iv) They do not have a lifecycle

Right Answer- iii) They have a lifecycle different than that of Pods

Which of these is not a Service Spec?
Choose the correct option from below list:
i) ClusterIP
ii) PodIP
iii) ExternalName
iv) NodePort

Right Answer- ii) PodIP

About Author


After years of Technical Work, I feel like an expert when it comes to Develop wordpress website. Check out How to Create a Wordpress Website in 5 Mins, and Earn Money Online Follow me on Facebook for all the latest updates.