Senior
What Kubernetes primitives do you know?
sobes.tech AI
Answer from AI
In Kubernetes, the main primitives (resources) are:
- Pod — the smallest deployable unit, containing one or more containers that share network and storage.
- Service — an abstraction that provides a stable endpoint for a set of Pods, usually through load balancing.
- Deployment — a controller that manages updates and scaling of Pods.
- StatefulSet — for managing state and ordering of Pods with identity preservation.
- DaemonSet — ensures a copy of a Pod runs on each node in the cluster.
- ConfigMap and Secret — for storing configuration data and secrets respectively.
- Namespace — a logical partitioning of resources within the cluster.
- PersistentVolume (PV) and PersistentVolumeClaim (PVC) — for managing persistent storage.
Example of creating a simple Pod in YAML:
apiVersion: v1
kind: Pod
metadata:
name: example-pod
spec:
containers:
- name: nginx-container
image: nginx:latest