Kubernetes and Docker

Docker provide operating system level virtualization to offer software as containers. Kubernetes is software to automate container management . Both Kubernetes and Docker are extensively used to provide any time, any place and any device access to software with increased reliance on cloud technologies.

Top questions on Kubernetes and Docker are provided so that student and professionals can not only boost their skills and knowledge on Kubernetes and Docker  but are also able to easily clear technical interview on Kubernetes and Docker.

Q.1 What is Kubernetes
Kubernetes is a container management system developed in the Google platform. The purpose of kubernetes is to manage a containerized application in various types of physical, virtual, and cloud environments. Google Kubernetes is a highly flexible container tool to deliver even complex applications, consistently. Applications run on clusters of hundreds to thousands of individual servers.
Q.2 Define node in Kubernetes
A node the smallest unit of hardware. It defines a single machine in a cluster that can be a virtual machine from a cloud provider or physical machine in the data center. Every machine available in the Kubernetes cluster can substitute other machines.
Q.3 What is the work of a kube-scheduler
Kube-scheduler is the default scheduler for Kubernetes. It assigns nodes to newly created pods.
Q.4 Define daemon sets
Daemon sets are a set of pods that runs on a host. They are used for host layers attributes like monitoring network or simple network.
Q.5 What tasks are performed by Kubernetes
Kubernetes is the Linux kernel which is used for distributed systems. It helps you to be abstract the underlying hardware of the nodes (servers) and offers a consistent interface for applications that consume the shared pool of resources.
Q.6 Define Kubernetes controller manager
The controller manager is a daemon used for garbage collection, core control loops, and namespace creation. It enables the running of more than one process on the master node.
Q.7 Why use namespace in Kubernetes
Namespaces in Kubernetes are used for dividing cluster resources between users. It helps the environment where more than one user spread projects or teams and provides a scope of resources.
Q.8 List various services available in Kubernetes
Various services available in Kubernetes are Cluster IP service, Load Balancer service, Node Port service, External Name Creation service.
Q.9 Define Cluster IP
The Cluster IP is a Kubernetes service that offers a service inside the cluster that other apps inside cluster can access.
Q.10 Explain node port
The node port service is a fundamental way to get external traffic to your service. It opens a particular port on all nodes and forwards network traffic sent to this port.
Q.11 Define kubelet
The kubelet is a service agent which controls and maintains group of pods by checking pod specification using Kubernetes. The kubelet runs on each node and allows to communicate between a master node and a slave node.
Q.12 What is Kube-proxy
Kube-proxy is an implementation of both a network proxy and a load balancer. It is used to support service abstraction used with other networking operations. It is responsible for directing traffic to the container depend on IP and the port number.
Q.13 Define Ingress Network
Ingress network is defined as a collection of rules which allow permission for connections into the Kubernetes cluster.
Q.14 What is Kubectl used for
Kubectl is a software for controlling Kubernetes clusters. Ctl stands for control, which is a command-line interface to pass the command to the cluster and manage the Kubernetes component.
Q.15 What is GKE
GKE or Google Container Engine is a management platform that supports clusters and Docker containers that run within public cloud services of Google.
Q.16 Why load balancer is needed
A load balancer is needed because it gives a standard way to distribute network traffic among different services, which runs in the backend.
Q.17 How to run Kubernetes locally
Kubernetes can be run locally using the Minikube tool. It runs a single-node cluster in a VM (virtual machine) on the computer. Therefore, it offers the ideal way for users who have just started learning Kubernetes.
Q.18 Define headless service
Headless service is defined as a service that uses IP address, but instead of load balancing, it returns of associated pods.
Q.19 What are the important components of node status
The important component of node status are: Condition, Capacity, Info and Address
Q.20 What is minikube
Minikube is a software that helps the user to run Kubernetes. It runs on the single nodes that are inside VM on your computer. This tool is also used by programmers who are developing an application using Kubernetes.
Q.21 Define orchestration in Kubernetes
Orchestration in Kubernetes defines as an automatic method of scheduling the work of every container. It is used for applications that are based on microservices within clusters.
Q.22 Explain Prometheus in Kubernetes
Prometheus is an application that is used for monitoring and alerting. It can be called out to your systems, grab real-time metrics, compress it, and stores properly in a database.
Q.23 List tools for container orchestration
The tools for container orchestration are Docker swarm, Apache Mesos, and Kubernetes.
Q.24 Mention the list of objects of Kubernetes
Objects that are used in Kubernetes are: Pods, Replication sets and controllers, Jobs and cron jobs, Daemon sets, Distinctive identities, Deployments, and Stateful sets.
Q.25 Define Stateful sets in Kubernetes
The stateful set is a workload API object that is used to manage the stateful application. It can also be used to manage the deployments and scaling the sets of pods. The state information and other data of stateful pods are store in the disk storage, which connects with stateful set.
Q.26 Explain Replica set
A Replica set is used to keep replica pods stable. It enables us to specify the available number of identical pods. This can be considered a replacement for the replication .controller.
Q.27 Why uses Kube-apiserver
Kube-apiserver is an API server of Kubernetes that is used to configure and validate API objects, which include services, controllers, etc. It provides the frontend to the cluster's shared region using which components interact with each other.
Q.28 Explain the types of Kubernetes pods
There are two types of pods in Kubernetes: Single Container Pod( It can be created with the run command.) and Multicontainer pods(It can be created using the "create" command in Kubernetes.)
Q.29 What are the labels in Kubernetes
Labels are a collection of keys that contain some values. The key values are connected to pods, replication controllers, and associated services. Generally, labels are added to some object during its creation time. They can be modified by the users at run time.
Q.30 What do you mean by persistent volume
A persistent volume is a storage unit that is controlled by the administrator. It is used to manage an individual pod in a cluster.
Q.31 What are Secrets in Kubernetes
Secrets are sensitive information like login credentials of the user. They are objects in Kubernetes that stores sensitive information like username and password after performing encryption.
Q.32 What is Sematext Docker Agent
Sematext Docker agent is a log collection agent with events and metrics. It runs as a small container in each Docker host. These agents gather metrics, events, and logs for all cluster nodes and containers.
Q.33 Define OpenShift
OpenShift is a public cloud application development and hosting platform developed by Red Hat. It offers automation for management so that developers can focus on writing the code.
Q.34 Define K8s
K8s (K-eight characters-S) is a term for Kubernetes. It is an open-source orchestration framework for the containerized applications.
Q.35 What are federated clusters
Federated clusters multiple clusters that are managed as a single cluster.
Q.36 Explain PVC
The full form of PVC stands for Persistent Volume Claim. It is storage requested by Kubernetes for pods. The user does not require to know the underlying provisioning. This claim should be created in the same namespace where the pod is created.
Q.37 What is the Kubernetes Network Policy
Network Policy defines how the pods in the same namespace would communicate with each other and the network endpoint.
Q.38 What is Kubernetes proxy service
Kubernetes proxy service is a service which runs on the node and helps in making it available to an external host.
Q.39 What are the main benefits that Deployments offer that Replication Controllers do not
Strong update and rollback model
Q.40 Which of the following commands allow you to validate a cluster created with Kubernetes operations
kubeadm validate cluster
Q.41 Which of the following kubeadm command creates a new cluster
kubeadm init
Q.42 What is the default range of ports used to expose a NodePort service
Q.43 You want to deploy two tightly coupled containers that share a volume and some memory. What is the best option
Deploy them in a single Pod
Q.44 Which of the following commands gives you detailed info on a Pod
kubectl describe pods
Q.45 What is Heapster
Heapster is a performance monitoring and metrics collection tool supported natively on the Kubernetes cluster. It runs like any other pod in the cluster, discovering all nodes and querying information from Kubernetes nodes. This container management tool works via an on-machine agent.
Q.46 What is ETCD in Kubernetes
Etcd is a store for the configuration, state, and metadata of Kubernetes clusters. It is written in Go programming language and represents the cluster state at a given point in time. This datastore serves as the backbone of distributed systems.
Q.47 How do we control the resource usage of POD
With the use of limit and request resource usage of a POD can be controlled. Request: The number of resources being requested for a container. If a container exceeds its request for resources, it can be throttled back down to its request. Limit: An upper cap on the resources a single container can use. If it tries to exceed this predefined limit it can be terminated if K8's decides that another container needs these resources. If you are sensitive towards pod restarts, it makes sense to have the sum of all container resource limits equal to or less than the total resource capacity for your cluster.
Q.48 What is PDB (Pod Disruption Budget)
A Kubernetes administrator can create a deployment of a kind: PodDisruptionBudget for high availability of the application, it makes sure that the minimum number is running pods are respected as mentioned by the attribute minAvailable spec file. This is useful while performing a drain where the drain will halt until the PDB is respected to ensure the High Availability(HA) of the application. The following spec file also shows minAvailable as 2 which implies the minimum number of an available pod (even after the election).
Q.49 What’s the init container and when it can be used
init containers will set a stage for you before running the actual POD. Wait for some time before starting the app Container with a command like sleep 60. Clone a git repository into a volume.
Q.50 Why use namespaces? What is the problem with using the default namespace
While using the default namespace alone, it becomes hard over time to get an overview of all the applications you can manage in your cluster. Namespaces make it easier to organize the applications into groups that make sense, like a namespace of all the monitoring applications and a namespace for all the security applications, etc. Namespaces can also be useful for managing Blue/Green environments where each namespace can include a different version of an app and also share resources that are in other namespaces (namespaces like logging, monitoring, etc.).
Get Govt. Certified Take Test