Node Affinity:
- Describe what node affinity is and provide a scenario where you'd need to use it. Show a YAML configuration snippet demonstrating how to set a pod's affinity to nodes labeled with
zone=west
.
- Describe what node affinity is and provide a scenario where you'd need to use it. Show a YAML configuration snippet demonstrating how to set a pod's affinity to nodes labeled with
StatefulSets:
- How do StatefulSets differ from Deployments in Kubernetes? Given a scenario where you need persistent naming for your pods, which one would you choose and why? Provide a basic YAML configuration for a StatefulSet.
Init Containers:
- Describe the use case for init containers in a Pod lifecycle. Show a sample configuration where an init container prepares the environment for the main application.
Network Policies:
- You have two types of pods:
frontend
andbackend
. You want only thefrontend
pods to be able to access thebackend
pods. Provide a YAML configuration for a network policy to enforce this rule.
- You have two types of pods:
Horizontal Pod Autoscaling (HPA):
- Describe the primary metric types you can use for HPA in Kubernetes. Provide a YAML configuration to autoscale a deployment based on CPU utilization, with a target of 70%.
Taints and Tolerations:
- How do taints and tolerations work in Kubernetes for controlling pod placement? Demonstrate with a configuration where you taint a node to prevent any pods from scheduling on it unless they have a specific toleration.
Custom Resource Definitions (CRD):
- What is the purpose of a CRD in Kubernetes? Provide an example of a scenario where you'd need to define a custom resource and its corresponding controller.
Pod Priority and Preemption:
- Explain how pod priority and preemption work in Kubernetes. Demonstrate with a configuration where you define a high-priority class and assign it to a pod.
Volume Snapshots:
- Describe the functionality of volume snapshots in Kubernetes. How would you create a snapshot of a PVC named
my-data
?
- Describe the functionality of volume snapshots in Kubernetes. How would you create a snapshot of a PVC named
Ingress Controllers:
- You've been given a task to route traffic to two different services:
service-A
andservice-B
, based on path. Service A should handle all requests with path/appA/*
, and Service B with path/appB/*
. Provide a basic YAML configuration using an Ingress resource to achieve this.
- You've been given a task to route traffic to two different services: