Verify the Target First

kubectl config current-context
kubectl config get-contexts
kubectl get nodes
kubectl get pods -n <NAMESPACE>
kubectl get events -n <NAMESPACE> --sort-by=.metadata.creationTimestamp

Incident Investigation Order

  1. Verify context and namespace.
  2. Use describe to inspect scheduling, probe, and volume errors.
  3. Check current and previous container logs.
  4. Compare requests, limits, exit codes, and recent deployments.
kubectl describe pod <POD> -n <NAMESPACE>
kubectl logs <POD> -n <NAMESPACE> --tail=100
kubectl logs <POD> -n <NAMESPACE> --previous --tail=100

StatefulSet

Use StatefulSets for workloads requiring stable Pod identities and persistent storage. Design the Headless Service, volumeClaimTemplates, StorageClass, and recovery procedures together. StatefulSet does not automatically provide database replication or backups.

Check PVC deletion policies and PV reclaim policies before planning deletions.

Operational Improvements

Document probes, resource requests and limits, PDBs, deployment strategies, logs, metrics, and backup recovery for each workload. Review API, add-on, node, and storage-driver compatibility together when upgrading EKS.

Related Document

k9s · Kubernetes Exploration

Official References

StatefulSets

Original Notion Block

The AI block below is preserved because the connected tool cannot read its contents.

Statefulsets

StatefulSet은 쿠버네티스(Kubernetes)에서 상태를 유지해야 하는 애플리케이션을 관리하기 위한 워크로드 API 객체입니다.

주요 특징

StatefulSet vs Deployment

특성 StatefulSet Deployment
Pod 식별자 고유하고 영구적 (pod-0, pod-1) 임의 생성
영구 스토리지 PVC 템플릿 지원 별도 구성 필요
배포 순서 순차적 병렬
스케일링 순차적 병렬

사용 사례

기본 YAML 예제

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: web
spec:
  selector:
    matchLabels:
      app: nginx
  serviceName: "nginx"
  replicas: 3
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
          name: web
        volumeMounts:
        - name: www
          mountPath: /usr/share/nginx/html
  volumeClaimTemplates:
  - metadata:
      name: www
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 1Gi

제한 사항

Powered by Fruition