K8s 의도적 scale-0와 empty endpoints 판별
공유 클러스터 일일 점검에서 NotReady / empty endpoints를 무조건 사고로 올리면 소음이 난다. 의도적 scale-0과 비정상 중단을 분리하는 체크리스트.
판별 축
| 신호 | 의도적 scale-0 | 비정상 |
|---|---|---|
Deploy/STS replicas | 명시 0 (또는 HPA min=0) | 원하던 replicas>0인데 Ready=0 |
| Service endpoints | empty 이고 owner가 scale-0 | empty인데 desired>0 / selector mismatch |
| 최근 이벤트 | scale 이벤트·런북 주석 | CrashLoop / ImagePull / OOM |
| PVC / DiskPressure | Bound, Pressure=False | Pending·Pressure |
점검 순서 (읽기 전용)
# 1) Ready가 아닌 Pod만 (Succeeded 제외)
kubectl get pods -A --field-selector=status.phase!=Running,status.phase!=Succeeded
# 2) Deploy/STS ready 비율 — scale-0은 READY 0/0으로 정상일 수 있음
kubectl get deploy,sts -A
# 3) empty endpoints가 scale-0과 짝인지
kubectl get endpoints -A | awk 'NF<3 || /<none>/'
# → 해당 Service의 owner Deploy replicas 확인
# 4) 노드 Pressure
kubectl get nodes -o custom-columns=NAME:.metadata.name,READY:.status.conditions[?\(@.type==\"Ready\"\)].status,DISK:.status.conditions[?\(@.type==\"DiskPressure\"\)].status운영 규칙
- 스케일 0 allowlist: 런타임 버퍼(예: 읽기/쓰기 프록시 풀)처럼 의도적으로 끈 워크로드는 체크리스트에 이름을 적어 두고, 일일 리포트에서 “abnormal”에서 제외한다.
- Endpoints만 보고 티켓 금지: empty endpoints는 replicas·selector·엔드포인트 슬라이스를 같이 본다.
- 잔여 CR ≠ 사고: Argo 등 컨트롤러의 terminal Failed/Succeeded CR이 남아 있어도 Pod Ready와 무관할 수 있다 — path-graph-Argo-ImagePullBackOff-runbook.md 위생 절 참고. 정리 시 Pod가 아니라 워크플로/CR 단위 delete.
- kubectl은 점검 시 read-only를 기본으로 한다. 변경은 별도 승인·런북.
예시 (패턴 적용)
- GPU 서빙 NS에서 주 워크로드 Ready(예: 2/2)인데, 같은 클러스터의 프록시 Deploy가
replicas: 0이면 empty endpoints는 허용. - 신규 NS가 Running·PVC Bound이면 “새 NS” 자체는 사고가 아니다. CrashLoop/Pending만 올린다.
- 재확인 (2026-08-03): 노드 Pressure=False·CrashLoop/ImagePull=0·PVC Bound인 날에도 런타임 프록시 Deploy
replicas=0→ empty endpoints는 allowlist에 두고 abnormal에서 제외. path-graph terminal Workflow CR 잔존도 사고 아님 — path-graph-Argo-ImagePullBackOff-runbook.md. - 재확인 (2026-08-09):
runtime/pgbouncer-{ro,rw}intentional scale-0(endpoints empty) + GPU 서빙 Ready + Warning/CrashLoop=0이면 Incident 없음. TEI 등 보조 Ready 워크로드는 GPU 점유와 독립적으로 정상 기준선에 포함할 수 있다. - Redis ClusterIP 거부 ≠ Redis Down: 워크로드 루프백
redis-cli ping이 PONG이면, 오퍼레이터에서 ClusterIP/pod IP connection refused는 알려진 런타임 정책일 수 있다. 일일 리포트에서 Incident로 올리지 않는다. - Readiness probe flake: STS 한 번 Unhealthy 후 곧 Ready 1/1 이면 사고로 승격하지 않는다. 공유 Postgres OOM(SIGKILL)과 구분 — Shared-Postgres-Cgroup-Limit-vs-Statement-Timeout.md.
- 재확인 (2026-08-15): GPU 서빙 2/2 Ready +
runtime/pgbouncer-{ro,rw}scale-0 + path-graph filestash 1/1·ImagePullBackOff=0·terminal Workflow CR만 잔존 + 공유 Postgres live limit 4Gi/request 2Gi·SIGKILL 없음이면 Incident 없음. - 재확인 (2026-08-16): 노드 Pressure=False·Warning/CrashLoop/Pending=0 +
runtime/pgbouncer-{ro,rw}scale-0 + GPUsglang-gemma4-12b2/2·bge-m3-tei1/1 + Postgres live 4Gi/2Gi·SIGKILL 없음 + filestash 1/1·terminal Workflow CR만 잔존이면 Incident 없음. - 재확인 (2026-08-18): 동일 기준선 + TEI health는 Service 포트 :8080 (기본 :80 타임아웃은 포트 오탐, 사고 아님) + graph DB STS가 Helm 기본 limit보다 낮아도 Ready·최근 OOM 없으면 일일 티켓 없음 — SGLang-gemma4-llm-serving-cluster-ops.md.
- 재확인 (2026-08-22):
didim-gpuPressure=False·Warning/CrashLoop/Pending=0 +runtime/pgbouncer-{ro,rw}scale-0 +sglang-gemma4-12b2/2·bge-m3-tei1/1 + postgres live 4Gi/2Gi Ready + PVC Bound → Incident 없음. kubelet eviction 미발화 축은 K8s-Kubelet-Node-Pressure-Eviction.md. - 재확인 (2026-09-04):
didim-gpuReady·Pressure=False·abnormal Pod/Warning=0·PVC Bound + postgres live 4Gi/2Gi·restarts 0. 의도적 scale-0 allowlist에llm-serving/sglang-gemma4-12b와runtime/pgbouncer-{ro,rw}를 함께 둔다 — GPU 서빙 Deploy가 0/0이어도 replicas=0이면 Incident 아님. SGLang-gemma4-llm-serving-cluster-ops.md. - 재확인 (2026-09-05): 동일 Pressure/PVC/postgres 기준선 +
sglang-gemma4-12b·pgbouncer-{ro,rw}scale-0. 활성 GPU 점유는sglang-gemma4-31b2/2 — 12b가 0이어도 다른 SGLang Deploy가 allocatable GPU를 Ready로 쓰면 Incident 아님(티어 교체·scale-0 allowlist 병행). SGLang-gemma4-llm-serving-cluster-ops.md. - 재확인 (2026-09-06):
didim-gpuReady·Pressure=False·CrashLoop/ImagePull/Pending/Failed=0·Warning=0·PVC Bound + postgres live 4Gi/2Gi·restarts 0. allowlist:llm-serving/sglang-gemma4-12b+runtime/pgbouncer-{ro,rw}scale-0. Incident 없음. - 재확인 (2026-09-07):
didim-gpuReady·Disk/Memory/PID Pressure=False·root disk ~58%·desired Deploy/STS Ready·Pending/Failed=0·Warning=0·PVC Bound + postgres live 4Gi/2Gi. allowlist:llm-serving/sglang-gemma4-12b+runtime/pgbouncer-{ro,rw}scale-0.nebula/nebula-storaged-0lastState OOMKilled(09-05) 후 Ready·restartCount 누적 — CrashLoop 아니면 watch-only(Incident 없음). - 재확인 (2026-09-09):
didim-gpuReady·Disk/MemoryPressure=False·root disk ~58%(999G/1.8T)·Warning/CrashLoop/Pending=0·all PVCs Bound(local-path) + postgres live 4Gi/2Gi. allowlist:llm-serving/sglang-gemma4-12b+runtime/pgbouncer-{ro,rw}scale-0. 활성 GPU는sglang-gemma4-31b2/2 전담 할당 및bge-m3-teiReady. Incident 없음. - 재확인 (2026-09-10):
didim-gpuReady·Disk/Memory/PIDPressure=False·root disk ~58%(999G/1.8T)·node mem ~39%(50Gi)·CPU ~7%·Warning/CrashLoop/Pending=0·all PVCs Bound(local-path) + postgres live 4Gi/2Gi·restarts 0. allowlist:llm-serving/sglang-gemma4-12b+runtime/pgbouncer-{ro,rw}scale-0. 활성 LLM은sglang-gemma4-31b1/1 할당. Actionable incident 없음. 점검 worktree는 feature 브랜치(feature/775-postgres-memory-4gi) untracked 상태로 git pull 미수행 기준선 준수. - 재확인 (2026-09-17):
didim-gpuReady·Disk/Memory/PIDPressure=False·CPU ~7%/mem ~42%(54Gi)·CrashLoop/ImagePull/Pending/Warning=0·Deploy/STS ready 일치·PVC Bound + postgres live 4Gi/2Gi·restarts 0. allowlist:llm-serving/sglang-gemma4-12b+runtime/pgbouncer-{ro,rw}scale-0. 활성 LLMsglang-gemma4-31b1/1; path-graph filestash 1/1 + terminal Workflow CR만 잔존 → 위생(Incident 아님). 점검 worktree feature 브랜치 untracked → git pull 생략 기준선 유지. - 비관리 STS OOM → watch-only: k8s-test 레포 밖 그래프 DB(예:
nebula/nebula-storaged)가 limit 부족으로 OOMKilled 후 Ready로 회복·사용량≪limit이면 일일 Incident로 올리지 않고 watch만 한다. limit 상향은 해당 워크로드 소유 레포/운영자 축 — shared Postgres OOM과 같은 “limit vs 실제” 판별은 Shared-Postgres-Cgroup-Limit-vs-Statement-Timeout.md. - 티켓 불필요면 MCP 미사용: 조치 가능 장애가 0이면 ticketing MCP discovery 실패를 점검 실패로 올리지 않는다. MCP는 티켓이 필요할 때만.
- 점검 worktree ≠ git 정본: 로컬 checkout이 feature 브랜치여도 live 클러스터가 점검 기준(SoR)이다.
git pull origin main을 생략해도 되고, repo drift를 Incident로 올리지 않는다. 점검 시 kubectl mutate 없음.