Pod
A Pod is the smallest deployable unit in Kubernetes, representing a single instance of a running process in the cluster. It typically contains one or more containers, shared storage volumes, a unique IP address, and configurations such as environment variables and resource limits.
Pod Manifest File​
pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: mypod
labels:
app: webserver
spec:
containers:
- name: mycontainer
image: nginx:latest
resources:
requests:
memory: "128Mi"
cpu: "500m"
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 80
securityContext:
allowPrivilegeEscalation: false
privileged: false
securityContext:
seccompProfile:
type: RuntimeDefault
runAsUser: 1001
runAsGroup: 1001
runAsNonRoot: true
After make the manifest file, we apply the manifest to create the pod
kubectl apply -f pod.yaml
Then check the pod
# Get pods
kubectl get pods
# Get pods with extra information
kubectl get pods -o wide
# Get know more deep
kubectl describe pod [POD_NAME]
# Exec from inside the pod
kubectl exec [POD_NAME] [COMMAND]