Kubernates Flashcards

1
Q

What is Kubernetes?

A

https://cloud.google.com/learn/what-is-kubernetes

https://kubernetes.io/docs/concepts/overview/

Question 1

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Kuberantes container?

A

https://avinetworks.com/glossary/kubernetes-container/#:~:text=Kubernetes%20containers%20resemble%20virtual%20machines,to%20their%20relaxed%20isolation%20properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are K8s?

A

Kubernetes (sometimes shortened to K8s with the 8 standing for the number of letters between the “K” and the “s”) is an open source system to deploy, scale, and manage containerized applications anywhere.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is orchestration when it comes to software and DevOps?

A

Orchestration refers to the integration of multiple services that allows them to automate processes or synchronize information in a timely fashion. Say, for example, you have six or seven microservices for an application to run. If you place them in separate containers, this would inevitably create obstacles for communication. Orchestration would help in such a situation by enabling all services in individual containers to work seamlessly to accomplish a single

Container orchestration is a process that involves managing and coordinating the deployment, scaling, and operation of multiple containers that run on a single server or across multiple servers. It automates container provisioning, networking, resource allocation, load balancing, availability, and lifecycle management tasks. Container orchestration tools, such as Kubernetes, Docker Swarm, and Apache Mesos, help ensure that containers work together seamlessly and efficiently to deliver the desired applications or services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How are Kubernetes and Docker related?

A

https://aws.amazon.com/compare/the-difference-between-kubernetes-and-docker/

Question 3

https://www.turing.com/interview-questions/kubernetes

This is one of the most frequently asked Kubernetes interview questions, where the interviewer might as well ask you to share your experience working with any of them. Docker is an open-source platform used to handle software development. Its main benefit is that it packages the settings and dependencies that the software/application needs to run into a container, which allows for portability and several other advantages. Kubernetes allows for the manual linking and orchestration of several containers, running on multiple hosts that have been created using Docker.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the main differences between the Docker Swarm and Kubernetes?

A

https://www.freecodecamp.org/news/kubernetes-vs-docker-swarm-what-is-the-difference/

Intermediate Question 15

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the difference between deploying applications on hosts and containers?

A

Deploying Applications consist of an architecture that has an operating system. The operating system will have a kernel that holds various libraries installed on the operating system needed for an application.

Whereas container host refers to the system that runs the containerized processes. This kind is isolated from the other applications; therefore, the applications must have the necessary libraries. The binaries are separated from the rest of the system and cannot infringe any other application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the features of Kubernetes?

A

https://kubernetes.io/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the main components of Kubernetes architecture?

A

https://kubernetes.io/docs/concepts/overview/components/

Question 15

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain the working of the master node in Kubernetes?

A

The master node dignifies the node that controls and manages the set of worker nodes. This kind resembles a cluster in Kubernetes. The nodes are responsible for the cluster management and the API used to configure and manage the resources within the collection. The master nodes of Kubernetes can run with Kubernetes itself, the asset of dedicated pods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the role of Kube-apiserver?

A

https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/#:~:text=The%20Kubernetes%20API%20server%20validates,which%20all%20other%20components%20interact.

Intermediate Question 39

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a node in Kubernetes?

A

A node is the smallest fundamental unit of computing hardware. It represents a single machine in a cluster, which could be a physical machine in a data center or a virtual machine from a cloud provider. Each machine can substitute any other machine in a Kubernetes cluster. The master in Kubernetes controls the nodes that have containers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the node status contain?

A

https://kubernetes.io/docs/reference/node/node-status/

Intermediate Question 19

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What process runs on Kubernetes Master Node?

A

https://medium.com/featurepreneur/kubernetes-architecture-processes-run-on-master-node-c5869b89b931

The Kube-api server process runs on the master node and serves to scale the deployment of more instances.

The process that runs on the Kubernetes master node is the Kube-apiserver. This process is the access point for all the REST commands that control the cluster. It is the only Kubernetes control panel component with a user-accessible API and the sole master component you will interact with. It acts as a gateway to the cluster and supports life cycle orchestration.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a pod in Kubernetes?

A

https://kubernetes.io/docs/concepts/workloads/pods/
Intermediate Question 21

https://www.turing.com/interview-questions/kubernetes

In this Kubernetes interview question, try giving a thorough answer instead of a one-liner. Pods are high-level structures that wrap one or more containers. This is because containers are not run directly in Kubernetes. Containers in the same pod share a local network and the same resources, allowing them to easily communicate with other containers in the same pod as if they were on the same machine while at the same time maintaining a degree of isolation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the job of the kube-scheduler?

A

https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/#:~:text=The%20Kubernetes%20scheduler%20is%20a,Pod%20to%20a%20suitable%20Node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a cluster of containers in Kubernetes?

A

A cluster of containers is a set of machine elements that are nodes. Clusters initiate specific routes so that the containers running on the nodes can communicate with each other. In Kubernetes, the container engine (not the server of the Kubernetes API) provides hosting for the API server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the Google Container Engine?

A

The Google Container Engine is an open-source management platform tailor-made for Docker containers and clusters to provide support for the clusters that run in Google public cloud services.

Container Engine also makes application management easier. Your cluster is equipped with common capabilities, such as logging and container health checking, to give you insight into how your application is running. And, as your application’s needs change, resizing your cluster with more CPU or memory is easy.

https://www.techtarget.com/searchitoperations/definition/Google-Container-Engine-GKE#:~:text=Google%20Kubernetes%20Engine%20(GKE)%20is,orchestration%20platform%20developed%20by%20Google.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are Daemon sets?

A

https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#:~:text=A%20DaemonSet%20defines%20Pods%20that,Pods%20are%20added%20to%20them.

The DaemonSets are pod sets that run on a host only one time on a host. And so, they are used attributes of host layers such as -network or network monitoring. DaemonSet enables you to run the Kubernetes pod on the cluster nodes that fulfill certain criteria or requirements. It ensures that some or all nodes run a copy of a pod. DaemonSets are used to deploy background services, run cluster storage, log collection, and deploy a node monitoring daemon on every node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is ‘Heapster’ in Kubernetes?

A

https://logz.io/blog/kubernetes-monitoring/#:~:text=Heapster%20is%20a%20bridge%20between,node%20via%20the%20Kubernetes%20API.

https://kubernetes.io/blog/2015/05/resource-usage-monitoring-kubernetes/

A Heapster is a cluster-wide aggregator of data that runs on each node. It is a Kubernetes project that provides a robust monitoring solution for Kubernetes clusters. Heapster is flexible and modular, making it easy to use and customize for different needs. However, Heapster has been deprecated since Kubernetes version 1.11. Its functionality has been replaced by the Kubernetes Metrics Server, which provides a more efficient and scalable way to collect and expose resource utilization data from Kubernetes nodes and pods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is Minikube?

A

https://kubernetes.io/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro/#:~:text=Minikube%20is%20a%20lightweight%20Kubernetes,%2C%20macOS%2C%20and%20Windows%20systems.

Minikube is a lightweight implementation of Kubernetes, which creates a VM on your local machine. It is a tool that sets the Kubernetes environment on your laptop or PC, and it addresses a different type of use case than most other distributions, such as Rancher, EKS, and OpenShift. It creates a lightweight, self-contained environment with all the necessary components for running Kubernetes, such as the API server, etcd, and kubelet. This allows developers to experiment with Kubernetes without the need for a full-scale production environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is a Namespace in Kubernetes?

A

Namespaces are used for dividing cluster resources between multiple users. They are meant for environments where there are many users spread across projects or teams and provide a scope of resources.

https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#:~:text=Namespaces%20are%20a%20way%20to,resources%20within%20the%20same%20namespace.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Name the initial namespaces from which Kubernetes starts?

A

Default
Kube – system
Kube – public

Intermediate Question 25

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the Kubernetes controller manager?

A

https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/#:~:text=The%20Kubernetes%20controller%20manager%20is,the%20state%20of%20the%20system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What are the types of controller managers?

A

https://blog.knoldus.com/introduction-to-kube-controller-manager/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is etcd?

A

https://etcd.io/

Kubernetes uses etcd as a distributed key-value store for all of its data, including metadata and configuration data, and allows nodes in Kubernetes clusters to read and write data. Although etcd was purposely built for CoreOS, it also works on a variety of operating systems (e.g., Linux, BSB, and OS X) because it is open-source. Etcd represents the state of a cluster at a specific moment in time and is a canonical hub for state management and cluster coordination of a Kubernetes cluster.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are the different services within Kubernetes?

A

https://cloud.google.com/kubernetes-engine/docs/concepts/service#:~:text=Types%20of%20Kubernetes%20Services,-There%20are%20five&text=LoadBalancer%3A%20Clients%20send%20requests%20to,need%20a%20stable%20IP%20address.

Question 23

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is ClusterIP?

A

https://sysdig.com/blog/kubernetes-services-clusterip-nodeport-loadbalancer/

Intermediate Question 26

https://www.turing.com/interview-questions/kubernetes

The ClusterIP is the default Kubernetes service that provides a service inside a cluster (with no external access) that other apps inside your cluster can access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What is NodePort?

A

https://cloud.ibm.com/docs/containers?topic=containers-nodeport#:~:text=About%20NodePorts&text=The%20NodePort%20service%20serves%20as,incoming%20requests%20for%20the%20service.

Intermediate Question 27

https://www.turing.com/interview-questions/kubernetes

The NodePort service is the most fundamental way to get external traffic directly to your service. It opens a specific port on all Nodes and forwards any traffic sent to this port to the service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What is the LoadBalancer in Kubernetes?

A

https://avinetworks.com/glossary/kubernetes-load-balancer/#:~:text=The%20load%20balancer%20tracks%20the,Kubernetes%20pods%20for%20the%20service.

Basic question 6

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is the Ingress network, and how does it work?

A

https://kubernetes.io/docs/concepts/services-networking/ingress/#:~:text=Make%20your%20HTTP%20(or%20HTTPS,define%20via%20the%20Kubernetes%20API.

Questions 25 and 26

https://www.turing.com/interview-questions/kubernetes

An ingress is an object that allows users to access your Kubernetes services from outside the Kubernetes cluster. Users can configure the access by creating rules that define which inbound connections reach which services.

How does it work- This is an API object that provides the routing rules to manage the external users’ access to the services in the Kubernetes cluster through HTTPS/ HTTP. With this, users can easily set up the rules for routing traffic without creating a bunch of load balancers or exposing each service to the nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What do you understand by Cloud controller manager?

A

https://kubernetes.io/docs/concepts/architecture/cloud-controller/#:~:text=The%20cloud%20controller%20manager%20runs,controllers%20in%20a%20single%20process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What is Container resource monitoring?

A

https://aws.amazon.com/cloudwatch/container-monitoring/#:~:text=Container%20monitoring%20is%20the%20activity,ensure%20they%20are%20operating%20smoothly.

Question 29

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What is the difference between a replica set and a replication controller?

A

https://www.geeksforgeeks.org/kuberneters-difference-between-replicaset-and-replication-controller/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What is a headless service?

A

https://cloud.google.com/kubernetes-engine/docs/concepts/service#:~:text=A%20headless%20Service%20is%20a,of%20going%20through%20a%20proxy.

Intermediate Question 10

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What are federated clusters?

A

https://subscription.packtpub.com/book/cloud-and-networking/9781786461001/11/ch11lvl1sec71/understanding-cluster-federation#:~:text=Cluster%20federation%20is%20conceptually%20simple,unified%20view%20of%20the%20system.

Question 35

https://www.simplilearn.com/tutorials/kubernetes-tutorial/kubernetes-interview-questions

Intermediate Question 12

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

What is Kubelet?or Which node in Kubernetes keeps track of resource utilization?

A

https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/

Question 19

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What is Kubectl?

A

https://kubernetes.io/docs/tasks/tools/#:~:text=kubectl,see%20the%20kubectl%20reference%20documentation.

Questions 12 and 13

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Give examples of recommended security measures for Kubernetes.

A

https://kubernetes.io/docs/tasks/administer-cluster/securing-a-cluster/

Basic question 7

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

What is Kube-proxy?

A

https://medium.com/@seifeddinerajhi/kube-proxy-and-cni-the-hidden-components-of-kubernetes-networking-eb30000bf87a#:~:text=Kube%2DProxy%20serves%20as%20a,network%20rules%20within%20the%20node.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

How can you get a static IP for a Kubernetes load balancer?

A

A static IP for the Kubernetes load balancer can be achieved by changing DNS records since the Kubernetes Master can assign a new static IP address.

https://stackoverflow.com/questions/32266053/how-to-specify-static-ip-address-for-kubernetes-load-balancer

https://cloud.google.com/kubernetes-engine/docs/tutorials/configuring-domain-name-static-ip#:~:text=Balancer%20with%20Ingress.-,Use%20a%20Service,per%20unused%20IP%20address%20pricing.

Intermediate Question 32

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

How to do maintenance activity on the K8 node?

A

Basic question 1

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

How do we control the resource usage of POD?

A

Basic question 2

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

What are the various K8’s services running on nodes and describe the role of each service?

A

Basic question 3

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

What is PDB (Pod Disruption Budget)?

A

Basic question 4

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

What’s the init container and when it can be used?

A

https://kubernetes.io/docs/concepts/workloads/pods/init-containers/#:~:text=This%20page%20provides%20an%20overview,(which%20describes%20app%20containers).

Question 30

https://www.turing.com/interview-questions/kubernetes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

How to monitor the Kubernetes cluster?

A

Basic question 8

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

How to get the central logs from POD?

A

Basic question 9

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

How to turn the service defined below in the spec into an external one?

A

Intermediate Question 1

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

Complete the following configurationspec file to make it Ingress

A

Intermediate Question 2

https://www.interviewbit.com/kubernetes-interview-questions/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

How should TLS be configured with Ingress?

A

Intermediate Question 3

https://www.interviewbit.com/kubernetes-interview-questions/

52
Q

Why should namespaces be used? How does using the default namespace cause problems?

A

Intermediate Question 4

https://www.interviewbit.com/kubernetes-interview-questions/

53
Q

What service and namespace are referred to in the following file?

A

Intermediate Question 5

https://www.interviewbit.com/kubernetes-interview-questions/

54
Q

What is an Operator?

A

https://kubernetes.io/docs/concepts/extend-kubernetes/operator/#:~:text=Operators%20are%20software%20extensions%20to,principles%2C%20notably%20the%20control%20loop.

55
Q

What is the purpose of operators?

A

https://kubernetes.io/docs/concepts/extend-kubernetes/operator/#:~:text=Operators%20are%20software%20extensions%20to,principles%2C%20notably%20the%20control%20loop.

Intermediate Question 7

https://www.interviewbit.com/kubernetes-interview-questions/

Intermediate Question 37

https://www.turing.com/interview-questions/kubernetes

56
Q

What is Ingress Default Backend?

A

https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/#:~:text=The%20default%20backend%20is%20a,%2Fhealthz%20that%20returns%20200

Intermediate Question 4

https://www.interviewbit.com/kubernetes-interview-questions/

57
Q

How to run Kubernetes locally?

A

https://opensource.com/article/20/11/run-kubernetes-locally

https://www.linkedin.com/pulse/install-kubernetes-cluster-your-local-machine-andrea-de-rinaldis?utm_source=share&utm_medium=member_ios&utm_campaign=share_via

58
Q

What the following in the Deployment configuration file mean?

A

Experienced Question 4

https://www.interviewbit.com/kubernetes-interview-questions/

59
Q

How to troubleshoot if the POD is not getting scheduled?

A

https://stackoverflow.com/questions/36377784/pod-in-kubernetes-always-in-pending-state

https://kubernetes.io/docs/tasks/debug/debug-application/debug-pods/

In K8’s scheduler is responsible to spawn pods into nodes. There are many factors that can lead to unstartable POD. The most common one is running out of resources, use the commands like kubectl describe <POD> -n <Namespace> to see the reason why POD is not started. Also, keep an eye on kubectl to get events to see all events coming from the cluster.</Namespace></POD>

60
Q

How to run a POD on a particular node?

A

https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/

61
Q

What are the different ways to provide external network connectivity to K8?

A

Experienced Question 7

https://www.interviewbit.com/kubernetes-interview-questions/

62
Q

How can we forward the port ‘8080 (container) -> 8080 (service) -> 8080 (ingress) -> 80 (browser)and how it can be done?

A

Experienced Question 8

https://www.interviewbit.com/kubernetes-interview-questions/

63
Q

Which programming language is Kubernetes written in?

A

Go

64
Q

What are the main benefits that Deployments offer that Replication Controllers do not?

A

Strong update and rollback model

65
Q

commands allow you to validate a cluster created with Kubernetes operations?

A

Kubeadm validate cluster

66
Q

kubeadm command creates a new cluster?

A

Kubeadm init

67
Q

Why do we need container orchestration?

A

Container orchestration is critical to working with containers, allowing organizations to unlock their full benefits. It can be used in any environment where you use containers.

Container orchestration is needed to manage and automate containerized applications’ deployment, scaling, and management. It helps to reduce operational overhead, increase efficiency and scalability, and ensure infrastructure availability, thus helping to improve application performance.

68
Q

How does Kubernetes help in containerized deployment?

A

Kubernetes helps in containerized deployment by scaling, loading, balancing, and monitoring containers. You can take advantage of these features by deploying your containerized applications on a Kubernetes cluster. To do this, you create a deployment configuration that instructs Kubernetes on creating and updating instances of your application. Kubernetes manage these instances, which can automatically recover from failures and scale up or down based on demand.

69
Q

Explain the cloud controller manager.

A

Question 27

https://www.turing.com/interview-questions/kubernetes

70
Q

What are the different types of cloud controller managers?

A

Question 28

https://www.turing.com/interview-questions/kubernetes

71
Q

List some container resource monitoring tools.

A

Here are some of the resource monitoring tools:

Grafana
Kibana
CAdvisor
Prometheus
SolarWinds
ElasticSearch
Sysdig

72
Q

What is Grafana?

A

Grafana is an open-source interactive data visualization platform. It was developed by Grafana Labs, which allows users to see their data via charts, graphs, and alerts for the web when connected to supported data sources. It is divided into frontend and backend, written in TypeScript and Go, respectively.

73
Q

What is CAdvisor?

A

CAdvisor stands for container advisor, which discovers active containers and monitors them. The tool runs as a daemon process in the background, collecting, aggregating, and processing useful DevOps information. With CAdvisor you can track historical resource usage with histograms and analyze the memory footprint of the code running on servers. It primarily helps understand resource consumption.

74
Q

What is Prometheus?

A

Prometheus is an open-source monitoring and alerting system of the Cloud Native Computing Foundation. It was originally developed by SoundCloud and is designed to help users monitor their systems and applications by collecting and processing real-time metrics data. Prometheus has a powerful query language and a flexible alerting system that allows users to define custom rules and receive alerts when certain conditions are met.

Additionally, Prometheus offers various options for data visualization, including built-in graph and dashboarding capabilities. Prometheus supports static and dynamic service discovery mechanisms to discover and monitor targets automatically.

75
Q

Which selectors does the replica set use?

A

A replica set in Kubernetes uses label selectors to identify which pods it should manage. The selectors specify a set of key-value pairs that the replica set uses to match against the labels applied to the pods. Set-based selectors allow filtering keys according to a set of values. There are three kinds of operators: in, not in, and exists. The replica set will look for pods whose labels match the selectors.

76
Q

Which selectors do replication controllers use?

A

Replication controllers use label selectors to identify the set of pods that they manage. Specifically, they use equality-based selectors, which allow filtering by label key and values. These selectors look for pods with labels that match a specific key-value pair. To use an equality-based selector, you can use the “-l” or “–selector” option.

77
Q

What do equality-based selectors do?

A

They allow filtering by label keys and values. Thus they will only look for pods with the exact same phrase as the label. When a pod or other resource is created, it can be labeled with key-value pairs. Equality-based selectors allow you to select resources based on an exact match of those key-value pairs.

78
Q

How do you monitor applications in Kubernetes?

A

Intermediate Question 9

https://www.turing.com/interview-questions/kubernetes

79
Q

Explain orchestration when it comes to software and DevOps.

A

Intermediate Question 13

https://www.turing.com/interview-questions/kubernetes

80
Q

How do you perform maintenance on the K8 node?

A

This is one of the most popular k8s interview questions. When security updates become available, the Kubernetes administrator must execute the maintenance work of applying the security patch to the running container to prevent it from becoming vulnerable, which is an inevitable component of the administration. To safely drain the K8s node, use the following two commands:

kubectl cordon
kubectl drain –ignore-daemon set

81
Q

How can you use Kubernetes for workload distribution optimization?

A

Intermediate Question 17

https://www.turing.com/interview-questions/kubernetes

82
Q

How can an organization improve its technical operations and keep costs low through Kubernetes?

A

Intermediate Question 18

https://www.turing.com/interview-questions/kubernetes

83
Q

What do you know about clusters of containers in Kubernetes?

A

The clusters of containers in Kubernetes are a set of nodes. They create some routes so the containers running on the nodes can communicate. They allow containers to run across multiple machines and environments, such as physical, virtual, and cloud-based. Kubernetes clusters coordinate processes such as scheduling and scaling applications, maintaining a cluster’s state, and implementing updates.

84
Q

How do containers in a pod communicate?

A

Within a pod, containers share networking space and can reach one another through localhost. This means they can communicate using standard inter-process communication mechanisms like TCP/IP or Unix domain sockets as if running on the same machine. In addition to communicating through localhost, pod containers can communicate with each other using Kubernetes services or environment variables.

85
Q

Differentiate between ConfigMaps and Secret?

A

Where Secret stores critical data in an encrypted format, ConfigMaps stores the configuration of an application in a normal plain text format. However, both of them can be used as volume and be mounted on a pod through a pod definition file.

86
Q

Explain Kubernetes RBAC.

A

It stands for Role-Based Access Control. It allows the management of permissions for users and groups inside a Kubernetes cluster. With RBAC, one can set access permissions and the required conditions to fulfill to gain access. Roles define a set of permissions granted to users or groups, and role bindings associate roles with specific users or groups.

Using RBAC, you can limit access to sensitive resources and ensure that only authorized users and applications can perform certain actions within the cluster. This helps to improve the security and reliability of your Kubernetes environment.

87
Q

What tools will you use for container orchestration?

A

Some tools we can use for container orchestration are:

Docker Swarm: It is an orchestration management tool running on Docker applications that helps in the creation and deployment of Docker nodes.

Apache Mesos: It is a cluster manager that helps in resource isolation and sharing.

Kubernetes: Kubernetes (commonly abbreviated K8s) is an open-source container orchestration system that automates software deployment, scaling, and management.

88
Q

Can you list some of the objects of Kubernetes?

A

Here are some of the objects used by Kubernetes:

Pods
Controllers and replication set
Cron jobs
DaemonSets
Distinctive identities
Stateful sets
Deployments

89
Q

Define StatefulSets.

A

StatefulSets are a type of workload API that manage stateful applications. They can also be used to manage the scaling and deployment of pod sets. StatefulSets are often used to manage the deployment and scaling of pods that require stable network identities and persistent storage, making them well-suited for stateful workloads.

90
Q

Can you list some reasons why DaemonSets are used?

A

Intermediate Question 36

https://www.turing.com/interview-questions/kubernetes

91
Q

Can you tell me some Kubectl commands?

A

Some Kubectl commands are:

kubectl annotate
kubectl config
kubectl autoscale
kubectl config current-context
kubectl apply
kubectl config set.
kubectl cluster-info
kubectl attach

92
Q

What you will do to upgrade a Kubernetes cluster?

A

Advanced Question 1

https://www.turing.com/interview-questions/kubernetes

93
Q

Explain the two types of Kubernetes pods.

A

Advanced Question 2

https://www.turing.com/interview-questions/kubernetes

94
Q

Tell me about labels in Kubernetes.

A

Labels are added to objects during their creation and can be altered by the users at run time. They are precisely collections of keys that hold some values.

They are a type of metadata that work through the concept of key-value pair attached to objects. In many cases, they are also used to define “identifying aspects” of an object mainly to help the user at a later stage. Also, as they do not imply semantics to Kubernetes by default, they do not directly change any functionality like other metadata.

95
Q

List some objectives of the replication controller.

A

Some of the objectives of a replication controller are:

Control and administer pod lifecycle
Monitor and verify the permissible number of replicas
Help user to check pod status
Enable the alteration of pod

96
Q

What is persistent volume?

A

Persistent volume (PV) is a storage piece that an administrator provides to a Kubernetes cluster. Suppose a developer needs persistent storage for an application in a cluster; they do so by creating a persistent volume claim (PVC) and then mounting the volume to a path in the pod. Once this process is done, the pod can claim any volume matching its requirements.

97
Q

Do you know anything about the Secrets in Kubernetes?

A

Yes, the Secrets in Kubernetes are objects that hold sensitive information such as login credentials for the user, passwords, OAuth tokens, and SSH keys. Here “Secrets” give you more control over this information and its accidental exposure. Using Secrets, Kubernetes ensures that the sensitive data is encrypted, only authorized entities can access it, and it is not exposed to unauthorized users or applications.

98
Q

Tell me about Sematext Docker Agent.

A

The Sematext Docker Agent is a lightweight log collection agent that runs as a container on a Docker host. It collects and streams logs, events, and metrics from Docker containers and nodes to Sematext Cloud, a cloud-based monitoring and logging platform. With Sematext Docker Agent, users can monitor their Docker environments in real-time, troubleshoot issues quickly, and gain insights into container performance. Sematext Docker Agent supports Kubernetes, Docker Swarm, and other container orchestration systems.

99
Q

Explain OpenShift.

A

It is a public cloud Kubernetes platform that aids developers in building applications. Its offerings include automated installation, life cycle management, and upgrades. OpenShift provides developers with tools and services to build, deploy, and manage applications in a containerized environment. These tools include an integrated development environment (IDE), container images, source code management, automated builds, and deployments.

100
Q

Mention some differences between Kubernetes Volumes and Docker Volum

A

Advanced Question 9

https://www.turing.com/interview-questions/kubernetes

101
Q

How can you provide API-Security on Kubernetes?

A

Securing APIs on Kubernetes is crucial to prevent unauthorized access and data breaches. One approach is to implement Role-Based Access Control (RBAC) policies with the kube-dashboard, which allows defining permissions for individual users or groups. Another option is to use Kubeless, a Kubernetes-native serverless framework, to protect APIs by automatically injecting security measures such as rate limiting and authentication. Additionally, it’s important to use the correct authorization mode, such as the Node Authorizer or Attribute-Based Access Control (ABAC), to ensure that only authorized requests are accepted. By combining these methods, Kubernetes can provide strong API security for your applications.

102
Q

How do you debug a POD that isn’t being scheduled?

A

The scheduler in K8 is in charge of spawning pods into nodes. A variety of circumstances can cause unstartable POD. The most typical reason for POD not starting is a lack of resources; use commands like kubectl describe POD> -n Namespace> to find out why. Also, watch kubectl get events to observe the cluster’s events.

103
Q

List some of the types of Kubernetes volumes.

A

Advanced Question 12

https://www.turing.com/interview-questions/kubernetes

104
Q

What is PVC?

A

PVC stands for Persistent Volume Claim, a request made by a user for storage in a Kubernetes cluster. When a user creates a PVC, Kubernetes matches it with an appropriate Persistent Volume (PV) based on the storage requirements and properties specified in the PVC.

Persistent Volumes are network-attached storage devices that multiple pods can access in a cluster. A PVC is a request for a specific amount of storage, which is bound to a single pod or multiple pods, depending on the user’s requirements.

105
Q

What do you know about Kubernetes network policy?

A

The Kubernetes network policy indicates how pods in the same namespace communicate with one another and the network endpoint. Network policies allow you to control traffic at the IP address and port level. With Kubernetes network policy, you can define rules that specify which traffic can flow between pods and which traffic should be blocked.

106
Q

What are the limitations of using the default namespace?

A

Using the default namespace alone makes it difficult to keep track of all the applications you can manage in your cluster over time. Custom namespaces help in grouping apps into logical groupings, such as one namespace for monitoring programs and another for security applications, and so on. This makes it easier to manage and monitor different applications within your cluster and control access to specific resources.

107
Q

How can you safely drain the K8s node?

A

We can use the following commands

Use the command ‘kubectl cordon’ to mark the node as “un-schedulable”. This moves the node to maintenance mode and prevents new pods from being scheduled on it.
The ‘kubectl drain –ignore-daemon-set’ command removes the existing pods from the node. The ‘–ignore-daemon-set’ option will skip over any pods that are part of a DaemonSet, which ensures that essential system services are not disrupted.

108
Q

How can you perform maintenance in a single pod?

A

Advanced Question 17

https://www.turing.com/interview-questions/kubernetes

109
Q

How can you control the usage of resources in a pod?

A

Advanced Question 18

https://www.turing.com/interview-questions/kubernetes

110
Q

List various K8’s services that can run on nodes.

A

Advanced Question 19

https://www.turing.com/interview-questions/kubernetes

111
Q

What is PDB (Pod Disruption Budget)?

A

Advanced Question 20

https://www.turing.com/interview-questions/kubernetes

112
Q

Why should we use custom namespaces ?

A

Advanced Question 21

https://www.turing.com/interview-questions/kubernetes

113
Q

Why should we use custom namespaces ?

A

Advanced Question 21

https://www.turing.com/interview-questions/kubernetes

114
Q

What are the various logging patterns you can use to get central logs from pod?

A

Advanced Question 22

https://www.turing.com/interview-questions/kubernetes

115
Q

In the service given below, how can you convert the spec into an external one?

A

Advanced Question 23

https://www.turing.com/interview-questions/kubernetes

116
Q

Complete the following configuration spec file and turn it Ingress:

A

Advanced Question 24

https://www.turing.com/interview-questions/kubernetes

117
Q

Can you schedule the pods to the node if the node is tainted?

A

If a node is tainted, pods will not be scheduled on it by default, but you can use tolerations in the pod spec to allow specific pods to be scheduled on the tainted node. Tolerations are used to specify that a pod can tolerate (or “ignore”) a certain taint, allowing it to be scheduled on a tainted node. This can be useful in scenarios where you want to reserve certain nodes for specific types of workloads or to mark nodes as unsuitable for certain workloads.

118
Q

How can you achieve zero downtime in Kubernetes?

A

Advanced Question 26

https://www.turing.com/interview-questions/kubernetes

119
Q

How can you check that a pod always runs?

A

Advanced Question 27

https://www.turing.com/interview-questions/kubernetes

120
Q

How can you check that a pod always runs?

A

Advanced Question 27

https://www.turing.com/interview-questions/kubernetes

121
Q

Can you tell if the rolling update with stateful set replicas = 1 looks right?

A

No, it doesn’t look right since there is only 1 replica, and any changes to the state full set may result in an outage. It means that the rolling update of a StatefulSet needs to rip apart one or more old pods before replicating them. Therefore, it’s generally recommended to have at least two replicas in a StatefulSet to ensure high availability during rolling updates.

122
Q

Suppose a pod exceeds its memory limit. What signal will be sent to the process?

A

In such cases, SIGKILL instantly ends the container and spawns a new one using out of memory (OOM) error. This will result in the kernel sending a SIGKILL signal to the process running inside the container. By default, Kubernetes will send a SIGTERM signal to the container’s main process and wait for a certain period of time (determined by the terminationGracePeriodSeconds parameter) for the process to exit gracefully.

123
Q

How can you run a pod on a specific node?

A

We can run a pod on a specific node using node affinity. Here, a node is assigned to an arbitrary label, and they are configured to be assigned to that node as per the label created.

For example, this code snippet creates an arbitrary label, node location, and assigns the value Germany to the node named person-01:

kubectl label nodes person-01 nodelocation=Germany

124
Q

What happens when the master or the worker node fails?

A

Inside Kubernetes, when the master node fails, the cluster remains operational. There is no effect on the pod creation or any service member changes.

If a worker node fails, the master stops receiving updates, and any pods running on the failed worker node are terminated. The Kubernetes scheduler will then create new replicas of the terminated pods on other healthy worker nodes in the cluster.

125
Q

What happens when the master or the worker node fails?

A

Inside Kubernetes, when the master node fails, the cluster remains operational. There is no effect on the pod creation or any service member changes.

If a worker node fails, the master stops receiving updates, and any pods running on the failed worker node are terminated. The Kubernetes scheduler will then create new replicas of the terminated pods on other healthy worker nodes in the cluster.

126
Q

What happens when the master or the worker node fails?

A

Inside Kubernetes, when the master node fails, the cluster remains operational. There is no effect on the pod creation or any service member changes.

If a worker node fails, the master stops receiving updates, and any pods running on the failed worker node are terminated. The Kubernetes scheduler will then create new replicas of the terminated pods on other healthy worker nodes in the cluster.