SlideShare a Scribd company logo
2
Most read
14
Most read
Devops INTERVIEW
(Kubernetes)
Farshad Nick
1- What is kubernetes components and Architecture ?
Master Node:
● API Server: The API server is the central management point for the Kubernetes cluster. It exposes the
Kubernetes API and serves as the interface for communication with the control plane components.
● etcd: This is a distributed key-value store that stores the configuration data and the current state of the
cluster. All persistent cluster data is stored in etcd.
● Controller Manager: The controller manager is responsible for monitoring the state of the cluster through
the API server and making necessary changes to bring the current state closer to the desired state.
● Scheduler: The scheduler is responsible for assigning pods to nodes based on resource requirements,
policies, and constraints. It decides on which node a pod should run.
● Cloud Controller Manager (CCM) : the CCM is responsible for managing cloud-specific aspects of the
cluster, such as load balancers, persistent volumes, and virtual machines, based on the underlying cloud
infrastructure.
Node (Minion/Worker):
● Kubelet: Kubelet is an agent that runs on each node in the cluster. It ensures that
containers are running in a pod and reports the node's status to the master. Kubelet
takes instructions from the API server and manages containers on the node.
● Kube Proxy: Kube Proxy maintains network rules on nodes. It handles
communication between pods and services, forwarding traffic as necessary.
● Container runtime Interface : This is the software responsible for running
containers. It can be any runtime that implements the CRI, such as Docker,
containerd, or others.
kubernetes Architecture
2- Why Kubernetes Cluster must be in odd number?
As you probably know, Kubernetes relies on etcd, which uses the RAFT consensus algorithm (similar to
Paxos)
RAFT algorithm uses majority voting to elect a leader for cluster
You can See Article about rafting and this topic
3- What is the solution for Zero-Downtime in kubernetes
Rolling Updates: Use Kubernetes' built-in rolling update feature for deployments. This allows you to update
your application incrementally, ensuring that a portion of the pods remains available during the update
process.
Readiness Probes: Implement readiness probes to check if your application is ready to serve traffic before it
receives requests. This prevents traffic from being sent to pods that are not fully initialized or ready.
Pod Disruption Budgets (PDB): Define PDBs to specify the maximum number of pods that can be
unavailable during voluntary disruptions (like updates or node maintenance). This helps maintain a minimum
level of availability.
Horizontal Pod Autoscaler (HPA): Automatically scale your application based on metrics such as CPU or
memory usage. This ensures you have enough pods to handle increased load, minimizing the risk of
downtime.
Service Mesh: Use a service mesh like Istio or Linkerd to manage traffic routing and implement features like
canary deployments and circuit breaking, which help maintain availability during deployments.
Load Balancing: Utilize Kubernetes Services and Ingress controllers for load balancing traffic across pods. This
distributes requests evenly and helps prevent overload on individual pods.
Multi-Zone or Multi-Region Deployments: Deploy your applications across multiple availability zones or
regions to ensure redundancy. If one zone goes down, traffic can be routed to healthy instances in another zone.
Health Checks: Implement both liveness and readiness probes to automatically restart or stop sending traffic to
unhealthy pods, ensuring that only healthy instances serve requests.
4- What is difference between daemonset and
deployment ?
DaemonSet ensures that a specific Pod runs on all (or a subset of) nodes in the cluster, typically used for
cluster-level services.
Deployment manages a set of identical Pods, typically used for stateless applications, with features like rolling
updates and replica management.
5-There are some evicted pod in my kubernetes
what is it and when this situation happens ?
In Kubernetes, evicted pods are pods that get terminated because the node they were running on couldn't
provide sufficient resources, like memory or disk space. This typically happens due to:
1. Out of Memory (OOM) Pressure: When the node runs out of memory, Kubernetes evicts lower-priority
pods to free up resources.
2. Disk Pressure: When the node’s disk usage is critically high, Kubernetes evicts pods to prevent system
failures.
3. Pod Quality of Service (QoS) Levels: Kubernetes assigns pods different QoS classes (Guaranteed,
Burstable, BestEffort) based on their resource requests and limits. Pods with lower QoS classes
4. Resource Overcommitment
5. Node Failure or Maintenance
To avoid evictions, ensure your pods have proper resource requests and limits defined.
6- What is difference between linux cronjob and
kubernetes cronjob ?
Linux Cron Job: Runs tasks on a single server at the OS level. It's limited to that machine's capacity, with no
built-in fault tolerance or automatic rescheduling if the server fails and its always consume resources
Kubernetes CronJob: Runs tasks as pods in a Kubernetes cluster. It scales across multiple nodes, provides
automatic failover, retries, and centralized management. Ideal for containerized and distributed workloads and
it just run on a specific time that you defined
7- What is static pods ?
Static Pods in Kubernetes are pods that are directly managed by the kubelet on a specific node, rather
than by the Kubernetes API server. They are usually used for system-level pods or critical infrastructure
components (like control plane components) that need to run on a specific node.
Static pods are defined using YAML manifests placed in a specific directory (e.g.,
/etc/kubernetes/manifests/). The kubelet watches this directory, and any changes to the manifests
trigger pod updates.
8- How can we Control pods to pods
communication ( Deny or allow incoming/outgoing traffics ) ?
Network Policy allows you to Control on Kubernetes network communication
9-What is finalizer in kubernetes ?
Finalizers are namespaced keys that tell Kubernetes to wait until specific conditions are met before
it fully deletes resources marked for deletion. Finalizers alert controllers to clean up resources the
deleted object owned.
https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/
10- How to Deploy App X on kubernetes nodes
that has SSD ?
● Node Selector
● Node Affinity
● Taints and Tolerations
● Pod Topology Spread Constraints
● Storage Classes (for Persistent Volumes with SSD backing)
● Persistent Volume Claims (targeting SSD-based storage)
● Dynamic Provisioning with SSD-backed Storage Classes
Follow for more Devops Content
Farshad_nickfetrat
@farshadnick
@packops.ir
packops.dev

More Related Content

Similar to Kubernetes Interview Question with answer by farshad nick (20)

PPTX
Kubernetes-introduction to kubernetes for beginers.pptx
rathnavel194
 
PPTX
kubernetesforbeginners.pptx
BaskarKannanK
 
PDF
Kubernetes acomprehensiveoverview
Ankit Shukla
 
PDF
Kubernetes - A Comprehensive Overview
Bob Killen
 
PDF
(Draft) Kubernetes - A Comprehensive Overview
Bob Killen
 
PDF
Kubernetes a comprehensive overview
Gabriel Carro
 
PPTX
Kubernetes Cluster vs Nodes vs Pods vs Containers Comparison
jeetendra mandal
 
PPTX
Jenkins_K8s (2).pptx
khalil Ismail
 
PDF
Intro to Kubernetes
Joonathan Mägi
 
PPTX
01. Kubernetes-PPT.pptx
TamalBanerjee16
 
PPTX
Introduction+to+Kubernetes-Details-D.pptx
SantoshPandey160
 
PPTX
TRAINING_ABOUT_KUBERNETES_Nguyen_Si_Nhan.pptx
nhannguyensi
 
PPTX
Kubernetes Presentation
Crevise Technologies
 
PPTX
Kubernetes PPT.pptx
ssuser0cc9131
 
PDF
Gdg izmir kubernetes
Gokhan Boranalp
 
PPTX
08 - kubernetes.pptx
RanjithM61
 
PDF
Kubernetes Architecture with Components
Ajeet Singh
 
PPTX
Intro to kubernetes
Elad Hirsch
 
PDF
Google Cloud Platform Kubernetes Workshop IYTE
Gokhan Boranalp
 
PDF
Kubernetes Basics - ICP Workshop Batch II
PT Datacomm Diangraha
 
Kubernetes-introduction to kubernetes for beginers.pptx
rathnavel194
 
kubernetesforbeginners.pptx
BaskarKannanK
 
Kubernetes acomprehensiveoverview
Ankit Shukla
 
Kubernetes - A Comprehensive Overview
Bob Killen
 
(Draft) Kubernetes - A Comprehensive Overview
Bob Killen
 
Kubernetes a comprehensive overview
Gabriel Carro
 
Kubernetes Cluster vs Nodes vs Pods vs Containers Comparison
jeetendra mandal
 
Jenkins_K8s (2).pptx
khalil Ismail
 
Intro to Kubernetes
Joonathan Mägi
 
01. Kubernetes-PPT.pptx
TamalBanerjee16
 
Introduction+to+Kubernetes-Details-D.pptx
SantoshPandey160
 
TRAINING_ABOUT_KUBERNETES_Nguyen_Si_Nhan.pptx
nhannguyensi
 
Kubernetes Presentation
Crevise Technologies
 
Kubernetes PPT.pptx
ssuser0cc9131
 
Gdg izmir kubernetes
Gokhan Boranalp
 
08 - kubernetes.pptx
RanjithM61
 
Kubernetes Architecture with Components
Ajeet Singh
 
Intro to kubernetes
Elad Hirsch
 
Google Cloud Platform Kubernetes Workshop IYTE
Gokhan Boranalp
 
Kubernetes Basics - ICP Workshop Batch II
PT Datacomm Diangraha
 

Recently uploaded (20)

PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
July Patch Tuesday
Ivanti
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Python basic programing language for automation
DanialHabibi2
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Ad

Kubernetes Interview Question with answer by farshad nick

  • 2. 1- What is kubernetes components and Architecture ? Master Node: ● API Server: The API server is the central management point for the Kubernetes cluster. It exposes the Kubernetes API and serves as the interface for communication with the control plane components. ● etcd: This is a distributed key-value store that stores the configuration data and the current state of the cluster. All persistent cluster data is stored in etcd. ● Controller Manager: The controller manager is responsible for monitoring the state of the cluster through the API server and making necessary changes to bring the current state closer to the desired state. ● Scheduler: The scheduler is responsible for assigning pods to nodes based on resource requirements, policies, and constraints. It decides on which node a pod should run. ● Cloud Controller Manager (CCM) : the CCM is responsible for managing cloud-specific aspects of the cluster, such as load balancers, persistent volumes, and virtual machines, based on the underlying cloud infrastructure.
  • 3. Node (Minion/Worker): ● Kubelet: Kubelet is an agent that runs on each node in the cluster. It ensures that containers are running in a pod and reports the node's status to the master. Kubelet takes instructions from the API server and manages containers on the node. ● Kube Proxy: Kube Proxy maintains network rules on nodes. It handles communication between pods and services, forwarding traffic as necessary. ● Container runtime Interface : This is the software responsible for running containers. It can be any runtime that implements the CRI, such as Docker, containerd, or others.
  • 5. 2- Why Kubernetes Cluster must be in odd number? As you probably know, Kubernetes relies on etcd, which uses the RAFT consensus algorithm (similar to Paxos) RAFT algorithm uses majority voting to elect a leader for cluster You can See Article about rafting and this topic
  • 6. 3- What is the solution for Zero-Downtime in kubernetes Rolling Updates: Use Kubernetes' built-in rolling update feature for deployments. This allows you to update your application incrementally, ensuring that a portion of the pods remains available during the update process. Readiness Probes: Implement readiness probes to check if your application is ready to serve traffic before it receives requests. This prevents traffic from being sent to pods that are not fully initialized or ready. Pod Disruption Budgets (PDB): Define PDBs to specify the maximum number of pods that can be unavailable during voluntary disruptions (like updates or node maintenance). This helps maintain a minimum level of availability. Horizontal Pod Autoscaler (HPA): Automatically scale your application based on metrics such as CPU or memory usage. This ensures you have enough pods to handle increased load, minimizing the risk of downtime.
  • 7. Service Mesh: Use a service mesh like Istio or Linkerd to manage traffic routing and implement features like canary deployments and circuit breaking, which help maintain availability during deployments. Load Balancing: Utilize Kubernetes Services and Ingress controllers for load balancing traffic across pods. This distributes requests evenly and helps prevent overload on individual pods. Multi-Zone or Multi-Region Deployments: Deploy your applications across multiple availability zones or regions to ensure redundancy. If one zone goes down, traffic can be routed to healthy instances in another zone. Health Checks: Implement both liveness and readiness probes to automatically restart or stop sending traffic to unhealthy pods, ensuring that only healthy instances serve requests.
  • 8. 4- What is difference between daemonset and deployment ? DaemonSet ensures that a specific Pod runs on all (or a subset of) nodes in the cluster, typically used for cluster-level services. Deployment manages a set of identical Pods, typically used for stateless applications, with features like rolling updates and replica management.
  • 9. 5-There are some evicted pod in my kubernetes what is it and when this situation happens ? In Kubernetes, evicted pods are pods that get terminated because the node they were running on couldn't provide sufficient resources, like memory or disk space. This typically happens due to: 1. Out of Memory (OOM) Pressure: When the node runs out of memory, Kubernetes evicts lower-priority pods to free up resources. 2. Disk Pressure: When the node’s disk usage is critically high, Kubernetes evicts pods to prevent system failures. 3. Pod Quality of Service (QoS) Levels: Kubernetes assigns pods different QoS classes (Guaranteed, Burstable, BestEffort) based on their resource requests and limits. Pods with lower QoS classes 4. Resource Overcommitment 5. Node Failure or Maintenance To avoid evictions, ensure your pods have proper resource requests and limits defined.
  • 10. 6- What is difference between linux cronjob and kubernetes cronjob ? Linux Cron Job: Runs tasks on a single server at the OS level. It's limited to that machine's capacity, with no built-in fault tolerance or automatic rescheduling if the server fails and its always consume resources Kubernetes CronJob: Runs tasks as pods in a Kubernetes cluster. It scales across multiple nodes, provides automatic failover, retries, and centralized management. Ideal for containerized and distributed workloads and it just run on a specific time that you defined
  • 11. 7- What is static pods ? Static Pods in Kubernetes are pods that are directly managed by the kubelet on a specific node, rather than by the Kubernetes API server. They are usually used for system-level pods or critical infrastructure components (like control plane components) that need to run on a specific node. Static pods are defined using YAML manifests placed in a specific directory (e.g., /etc/kubernetes/manifests/). The kubelet watches this directory, and any changes to the manifests trigger pod updates.
  • 12. 8- How can we Control pods to pods communication ( Deny or allow incoming/outgoing traffics ) ? Network Policy allows you to Control on Kubernetes network communication
  • 13. 9-What is finalizer in kubernetes ? Finalizers are namespaced keys that tell Kubernetes to wait until specific conditions are met before it fully deletes resources marked for deletion. Finalizers alert controllers to clean up resources the deleted object owned. https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/
  • 14. 10- How to Deploy App X on kubernetes nodes that has SSD ? ● Node Selector ● Node Affinity ● Taints and Tolerations ● Pod Topology Spread Constraints ● Storage Classes (for Persistent Volumes with SSD backing) ● Persistent Volume Claims (targeting SSD-based storage) ● Dynamic Provisioning with SSD-backed Storage Classes
  • 15. Follow for more Devops Content Farshad_nickfetrat @farshadnick @packops.ir packops.dev