POKE ME for any consultancy

Friday, July 5, 2024

kubernetes Interview Questions

 


Kubernetes Interview Question 

Docker Kubernetes Interview Questions For Experienced

5) What is orchestration in software?

A) Application Orchestration. Application or service orchestration is the process of integrating two or more applications and/or services together to automate a process, or synchronize data in real-time. Often, point-to-point integration may be used as the path of least resistance.

6) What is a cluster in Kubernetes?
A) These master and node machines run the Kubernetes cluster orchestration system. A container cluster is the foundation of Container Engine: the Kubernetesobjects that represent your containerized applications all run on top of a cluster.

 

8) What is Openshift?

A) OpenShift Online is Red Hat’s public cloud application development and hosting platform that automates the provisioning, management and scaling of applications so that you can focus on writing the code for your business, startup, or big idea.

9) What is a namespace in Kubernetes?

A) Namespaces are intended for use in environments with many users spread across multiple teams, or projects. Namespaces are a way to divide cluster resources between multiple uses (via resource quota). In future versions of Kubernetes, objects in the same namespace will have the same access control policies by default.

10) What is a node in Kubernetes?

A) A node is a worker machine in Kubernetes, previously known as a minion. A nodemay be a VM or physical machine, depending on the cluster. Each node has the services necessary to run pods and is managed by the master components. The services on a node include Docker, kubelet and kube-proxy.
 
12) What is a Heapster?

A) Heapster is a cluster-wide aggregator of monitoring and event data. It supports Kubernetes natively and works on all Kubernetes setups, including our Deis Workflow setup.

16) What is the Kubelet?
A) Kubelets run pods. The unit of execution that Kubernetes works with is the pod. A pod is a collection of containers that share some resources: they have a single IP, and can share volumes.
17) What is Minikube?
A) Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.

18) What is Kubectl?
A) kubectl is a command line interface for running commands against Kubernetes clusters. This overview covers kubectl syntax, describes the command operations, and provides common examples. For details about each command, including all the supported flags and subcommands, see the kubectl reference documentation.
19) What is KUBE proxy?
A) Synopsis. The Kubernetes network proxy runs on each node. Service cluster ips and ports are currently found through Docker-links-compatible environment variables specifying ports opened by the service proxy. There is an optional addon that provides cluster DNS for these cluster IPs.
22) Which process runs on Kubernetes master node?
A) Kube-apiserver process runs on Kubernetes master node.
23) Which process runs on Kubernetes non-master node?
A) Kube-proxy process runs on Kubernetes non-master node.
24) Which process validates and configures data for the api objects like pods, services?
A) kube-apiserver process validates and configures data for the api objects.
25) What is the use of kube-controller-manager?
A) kube-controller-manager embeds the core control loop which is a non-terminating loop that regulates the state of the system.
26) Kubernetes objects made up of what?
A) Kubernetes objects are made up of Pod, Service and Volume.
27) What are Kubernetes controllers?
A) Kubernetes controllers are Replicaset, Deployment controller.
28) Where Kubernetes cluster data is stored?
A) etcd is responsible for storing Kubernetes cluster data.
29) What is the role of kube-scheduler?
A) kube-scheduler is responsible for assigning a node to newly created pods.
30) Which container runtimes supported by Kubernetes?
A) Kubernetes supports docker and rkt container runtimes.
31) What are the components interact with Kubernetes node interface?
A) Kubectl, Kubelet, and Node Controller components interacts with Kubernetes node interface.

Q)How to monitor that a Pod is always running?
A.We can introduce probes. 
A liveness probe with a Pod is ideal in this scenario.
A liveness probe always checks if an application in a pod is running,  if this check fails the container gets restarted. 
Q:What happens when a master fails? What happens when a worker fails?



QWhat is the difference between a replica set and a replication controller?
A.rolling-update command works with Replication Controllers, but won't work with a Replica set
Q:What does chart.yaml file contains ?

Q.What happens if a Kubernetes pod exceeds its memory resources 'limit'?
A.It has 5 stages: 1) The pod state is set to "Terminating" and it will stop receiving request, 2) preStop Hook is called, 3) SIGTERM is sent to pod, 4) k8s waits during grace period, 5) SIGKILL is sent:
Q.What are the different services within Kubernetes?
A.Types of Kubernetes Services
There are five types of Services:
• ClusterIP (default): Internal clients send requests to a stable internal IP address.
• NodePort: Clients send requests to the IP address of a node on one or more nodePort values that are specified by the Service.
• LoadBalancer: Clients send requests to the IP address of a network load balancer.
• ExternalName: Internal clients use the DNS name of a Service as an alias for an external DNS name.
Headless: You can use a headless service when you want a Pod grouping, but don't need a stable IP address.

What are the different services within Kubernetes?
Answer: Different types of Kubernetes services includes
2. Cluster IP service
3. Node port service
4. External name creation service
5.Load balancer service




$kubectl_logs = az aks get-credentials --resource-group myResourceGroup --name myAKSCluster kubectl logs --all-namespaces --tail=100

This will list the last 100 lines of all the logs for your current Kubernetes environment, which you can then analyze to determine any abnormality in your system.



kubectl edit pod <pod-name>


kubectl scale deployment deploymentname --replicas=5
kubectl edit pod <pod-name>

or

kubectl scale deployment <deployment-name> --replica=5

or edit the yaml file with the required things and run

kubectl apply -f deploy.yaml
kubectl run deployment name --dry-run=client -o yaml > pod








No comments:

Post a Comment