Skip to content
Kubernetes

Pod Manifest

Define a standalone Pod with a container, env, and probe.

#pod#manifest#probe

Code

kubernetes
# pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: api-pod
  labels:
    app: api
spec:
  containers:
    - name: api
      image: myapp:1.0
      ports:
        - containerPort: 8080
      env:
        - name: LOG_LEVEL
          value: "info"
      livenessProbe:
        httpGet:
          path: /health
          port: 8080
        initialDelaySeconds: 10
        periodSeconds: 15
      resources:
        requests: { cpu: "100m", memory: "128Mi" }
        limits:   { cpu: "500m", memory: "256Mi" }
# kubectl apply -f pod.yaml
# kubectl get pods -o wide
# kubectl describe pod api-pod