• +91 9723535972
  • info@interviewmaterial.com

Kubernetes Interview Questions and Answers

Related Subjects

Kubernetes Interview Questions and Answers

Question - 1 : - What is Kubernetes?

Answer - 1 : -

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.

Question - 2 : - Define node in Kubernetes

Answer - 2 : -

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.

Question - 3 : - How to do maintenance activity on the K8 node?

Answer - 3 : -

Whenever there are security patches available the Kubernetes administrator has to perform the maintenance task to apply the security patch to the running container in order to prevent it from vulnerability, which is often an unavoidable part of the administration. The following two commands are useful to safely drain the K8s node.

  • kubectl cordon
  • kubectl drain –ignore-daemon set
The first command moves the node to maintenance mode or makes the node unavailable, followed by kubectl drain which will finally discard the pod from the node. After the drain command is a success you can perform maintenance.

Question - 4 : - What’s the init container and when it can be used?

Answer - 4 : -

  •  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.

Question - 5 : - What are the various things that can be done to increase Kubernetes security?

Answer - 5 : -

By default, POD can communicate with any other POD, we can set up network policies to limit this communication between the PODs.

  • RBAC (Role-based access control) to narrow down the permissions.
  • Use namespaces to establish security boundaries.
  • Set the admission control policies to avoid running the privileged containers.
  • Turn on audit logging.

Question - 6 : - How to monitor the Kubernetes cluster?

Answer - 6 : -

Prometheus is used for Kubernetes monitoring. The Prometheus ecosystem consists of multiple components.

  • Mainly Prometheus server which scrapes and stores time-series data.
  • Client libraries for instrumenting application code.
  • Push gateway for supporting short-lived jobs.
  • Special-purpose exporters for services like StatsD, HAProxy, Graphite, etc.
  • An alert manager to handle alerts on various support tools.

Question - 7 : - How to get the central logs from POD?

Answer - 7 : -

This architecture depends upon the application and many other factors. Following are the common logging patterns

  • Node level logging agent.
  • Streaming sidecar container.
  • Sidecar container with the logging agent.
  • Export logs directly from the application.
In the setup, journalbeat and filebeat are running as daemonset. Logs collected by these are dumped to the kafka topic which is eventually dumped to the ELK stack.

Question - 8 : - Define daemon sets

Answer - 8 : -

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.

Question - 9 : - Define Heapster in Kubernetes

Answer - 9 : -

A Heapster is a metrics collection and performance monitoring system for data that are collected by the Kublet.

Question - 10 : - What tasks are performed by Kubernetes?

Answer - 10 : -

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.

NCERT Solutions


Share your email for latest updates


Our partners