Kubernetes - deep dive questions - Series 01

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:
frontendandbackend. You want only thefrontendpods to be able to access thebackendpods. 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-Aandservice-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:
![Terraform Function - Part 1 [Collection functions] - with examples](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1703964504127%2F858bcdce-10ce-484e-ba7c-2c80be482edc.png&w=3840&q=75)
![Terraform Function - Part 1 [lookup] - with examples](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1703963612987%2Fdb6dbc27-56ed-4ce5-8aec-49e6002c26a6.png&w=3840&q=75)

