그림: API 삭제 표시와 노드의 컨테이너 종료·sandbox·Cilium 정리 관계. Finalizer·GC는 조건부 경로이며, 개별 신호와 CNI 호출을 모두 직접 관측한 것은 아니다.
kubectl delete pod 명령이 성공했다고 컨테이너 프로세스가 이미 종료된 것은 아니다. API 객체에 삭제가 표시된 시점과 노드에서 실제 종료 신호를 처리하는 시점, 마지막으로 객체가 API에서 제거되는 시점은 서로 다를 수 있다.
test-pod3의 감사 로그를 따라가며 삭제 표시 → kubelet 종료 처리 → 최종 API 제거의 흐름을 살펴본다. 대상 Pod와 별도로 수집한 etcd 조회에는 서로 다른 revision과 값이 있어 하나의 연속 타임라인으로 합치지 않는다.
1. 정상 종료의 주요 흐름
kubectl DELETE 요청
→ API 서버: 삭제 유예 정보와 deletionTimestamp를 저장
→ kubelet: 종료 중인 Pod를 보고 로컬 종료 시작
→ preStop hook 실행(설정되어 있고 유예 시간이 0이 아닌 경우)
→ 런타임에 컨테이너 중지 요청, 보통 TERM 전달
→ 유예 시간 내 종료 대기
→ 남은 프로세스가 있으면 강제 종료
→ 최종 컨테이너 상태와 Pod phase 보고
→ kubelet의 최종 삭제 요청 등 필요한 정리
→ finalizer·삭제 조건이 충족되면 API 객체 제거preStop hook이 있으면 종료 신호를 보내기 전에 실행하며 그 시간도 종료 유예 기간에 포함된다. 종료 신호는 일반적으로 TERM이지만 이미지·런타임·지원되는 설정에 따라 달라질 수 있다.
Pod 종료와 Service endpoint의 종료 처리는 병렬로 진행될 수 있다. 모든 컨트롤러가 한 줄의 순서대로 기다리는 흐름은 아니다.
Terminating은 Pod phase가 아니다
kubectl 화면의 Terminating은 삭제 메타데이터를 반영한 표시다. 이 기록에서도 삭제 요청 응답의 status.phase는 여전히 Running이다. Pending·Running·Succeeded·Failed·Unknown 같은 phase와 화면 STATUS, 컨테이너의 Waiting·Running·Terminated를 구분한다.
deletionTimestamp를 단순히 “요청을 받은 현재 시각”으로 외우지 않는다. 유예 삭제에서는 종료 예정 시각과 유예 기간을 함께 기록할 수 있다. 실제 응답에는 요청 시각 03:07:33 부근에 deletionTimestamp=03:08:03Z, deletionGracePeriodSeconds=30이 있다.
2. Finalizer와 소유 관계는 다른 장치다
finalizers는 정리를 담당하는 컨트롤러가 충족해야 할 조건을 나타내는 키 목록이다. API 서버가 그 키의 이름을 보고 정리 작업 자체를 실행하는 것은 아니다. 삭제 조건이 남아 있으면 객체가 종료 표시 상태로 유지된다. 이것을 일반적인 동시성 mutex와 같은 락으로 해석하지 않는다.
ownerReferences는 소유자·종속 객체의 관계다. GC 컨트롤러는 이 관계를 이용해 삭제 전파를 처리하며, 모든 API 서버가 모든 객체를 순회하며 자식 프로세스를 죽이는 구조가 아니다.
| 전파 방식 | API 객체의 처리 |
|---|---|
| Background | 소유자를 먼저 삭제하고 종속 객체를 비동기로 정리한다. 다른 finalizer·유예 조건은 별도로 작용할 수 있다. |
| Foreground | 소유자를 종료 표시 상태에 두고 삭제를 막는 종속 객체의 처리를 기다린다. 해당 소유 참조·GC 조건의 범위에서 동작한다. |
| Orphan | 종속 객체를 남기는 방식으로 소유자 삭제를 처리한다. |
Foreground를 모든 외부 자원과 애플리케이션 정리를 무조건 보장하는 모드라고 설명하지 않는다. Background도 설계상 무조건 고아 객체를 남기는 위험 모드가 아니다.
Pod 삭제가 PVC·PV·LoadBalancer·Ingress 객체를 모두 자동으로 지우는 것은 아니다. 각각의 수명·소유 참조·보존 정책·컨트롤러를 확인해야 한다. ReplicaSet 소유 Pod 하나를 지우면 ReplicaSet이 목표 수량을 맞추려고 새 Pod를 만들 수도 있다.
이 실습의 Pod 응답에는 finalizers가 나타나지 않는다. Finalizer는 삭제 완료를 지연하는 별도 메커니즘이며, CiliumEndpoint 같은 종속 리소스의 소유 관계와 GC는 각각의 객체에서 확인되는 정보다.
3. 감사 정책과 로그 읽는 방법
공통 감사 정책·API Server 수집 설정·auditID와 UID 연결 방법은 아래 문서에서 관리한다.
Kubernetes audit 실습 공통 설정: 정책·UID·요청 추적
아래 자료는 여러 삭제 요청의 출력이다. Pod UID와 auditID로 같은 객체·요청의 이벤트를 연결한다.
4. 실제 API 로그의 세 단계
4.1 삭제 표시와 kubectl의 대기
첫 delete는 auditID ee347632-...로 연결되고 HTTP 200을 반환한다. 응답에는 30초 유예 정보와 여전히 Running인 status가 있다. 이 시점에 프로세스가 이미 끝났다는 뜻은 아니다.
DeleteOptions의 propagationPolicy=Background는 종속 객체의 삭제 전파 옵션이다. 감사 출력의 meta.k8s.io/__internal은 서버 내부 표현이고, 외부 API에서 사용하는 manifest 버전과 구분된다.
kubectl은 이후 get·list·watch로 제거 여부를 관측한다. HTTP delete 성공과 kubectl --wait의 완료는 나누어 봐야 한다.
a: kubectl delete 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "ee347632-d120-4522-b56a-10ef42f586d9",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "delete",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubectl/v1.30.12 (linux/amd64) kubernetes/66f4b3f",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.836900Z",
"stageTimestamp": "2026-04-13T03:07:33.836900Z"
}a: kubectl delete 응답
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "ee347632-d120-4522-b56a-10ef42f586d9",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "delete",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubectl/v1.30.12 (linux/amd64) kubernetes/66f4b3f",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"kind": "DeleteOptions",
"apiVersion": "meta.k8s.io/__internal",
"propagationPolicy": "Background"
},
"responseObject": {
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "test-pod3",
"namespace": "default",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"resourceVersion": "6768431",
"creationTimestamp": "2026-04-11T11:56:24Z",
"deletionTimestamp": "2026-04-13T03:08:03Z",
"deletionGracePeriodSeconds": 30,
"labels": {
"run": "test-pod3"
},
"managedFields": [
{
"manager": "kubectl-run",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-11T11:56:24Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:labels": {
".": {},
"f:run": {}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"test-pod3\"}": {
".": {},
"f:args": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
},
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-12T15:43:05Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:conditions": {
"k:{\"type\":\"ContainersReady\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Initialized\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"PodReadyToStartContainers\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Ready\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
}
},
"f:containerStatuses": {},
"f:hostIP": {},
"f:hostIPs": {},
"f:phase": {},
"f:podIP": {},
"f:podIPs": {
".": {},
"k:{\"ip\":\"192.0.2.2\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
},
"subresource": "status"
}
]
},
"spec": {
"volumes": [
{
"name": "kube-api-access-hdbzd",
"projected": {
"sources": [
{
"serviceAccountToken": {
"expirationSeconds": 3607,
"path": "token"
}
},
{
"configMap": {
"name": "kube-root-ca.crt",
"items": [
{
"key": "ca.crt",
"path": "ca.crt"
}
]
}
},
{
"downwardAPI": {
"items": [
{
"path": "namespace",
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
]
}
}
],
"defaultMode": 420
}
}
],
"containers": [
{
"name": "test-pod3",
"image": "image-registry/mariadb:11.3.2",
"args": [
"sleep",
"100000"
],
"resources": {},
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "master-2",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
}
],
"priority": 0,
"enableServiceLinks": true,
"preemptionPolicy": "PreemptLowerPriority"
},
"status": {
"phase": "Running",
"conditions": [
{
"type": "PodReadyToStartContainers",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:31Z"
},
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:29Z"
},
{
"type": "Ready",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-12T15:43:11Z"
},
{
"type": "ContainersReady",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-12T15:43:11Z"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:24Z"
}
],
"hostIP": "192.0.2.3",
"hostIPs": [
{
"ip": "192.0.2.3"
}
],
"podIP": "192.0.2.2",
"podIPs": [
{
"ip": "192.0.2.2"
}
],
"startTime": "2026-04-11T11:56:29Z",
"containerStatuses": [
{
"name": "test-pod3",
"state": {
"running": {
"startedAt": "2026-04-12T15:43:11Z"
}
},
"lastState": {
"terminated": {
"exitCode": 0,
"reason": "Completed",
"startedAt": "2026-04-11T11:56:30Z",
"finishedAt": "2026-04-12T15:43:10Z",
"containerID": "containerd://f4ac7de24b9fc8f4cebc59c2921fb47b870cad0be00d1298342a370fd5890bf1"
}
},
"ready": true,
"restartCount": 1,
"image": "image-registry/mariadb:11.3.2",
"imageID": "image-registry/mariadb@sha256:e09c77fcece9f6adc370d3707c7f5be653036c1d1bba70fe841c4bc2f2292e52",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"started": true,
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"readOnly": true,
"recursiveReadOnly": "Disabled"
}
]
}
],
"qosClass": "BestEffort"
}
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.836900Z",
"stageTimestamp": "2026-04-13T03:07:33.847376Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}b: kubectl get 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "39261fb0-d07d-4db9-aa85-6732461893a3",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "get",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubectl/v1.30.12 (linux/amd64) kubernetes/66f4b3f",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.848125Z",
"stageTimestamp": "2026-04-13T03:07:33.848125Z"
}b: kubectl get 응답
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "39261fb0-d07d-4db9-aa85-6732461893a3",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "get",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubectl/v1.30.12 (linux/amd64) kubernetes/66f4b3f",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"responseObject": {
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "test-pod3",
"namespace": "default",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"resourceVersion": "6768431",
"creationTimestamp": "2026-04-11T11:56:24Z",
"deletionTimestamp": "2026-04-13T03:08:03Z",
"deletionGracePeriodSeconds": 30,
"labels": {
"run": "test-pod3"
},
"managedFields": [
{
"manager": "kubectl-run",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-11T11:56:24Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:labels": {
".": {},
"f:run": {}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"test-pod3\"}": {
".": {},
"f:args": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
},
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-12T15:43:05Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:conditions": {
"k:{\"type\":\"ContainersReady\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Initialized\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"PodReadyToStartContainers\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Ready\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
}
},
"f:containerStatuses": {},
"f:hostIP": {},
"f:hostIPs": {},
"f:phase": {},
"f:podIP": {},
"f:podIPs": {
".": {},
"k:{\"ip\":\"192.0.2.2\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
},
"subresource": "status"
}
]
},
"spec": {
"volumes": [
{
"name": "kube-api-access-hdbzd",
"projected": {
"sources": [
{
"serviceAccountToken": {
"expirationSeconds": 3607,
"path": "token"
}
},
{
"configMap": {
"name": "kube-root-ca.crt",
"items": [
{
"key": "ca.crt",
"path": "ca.crt"
}
]
}
},
{
"downwardAPI": {
"items": [
{
"path": "namespace",
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
]
}
}
],
"defaultMode": 420
}
}
],
"containers": [
{
"name": "test-pod3",
"image": "image-registry/mariadb:11.3.2",
"args": [
"sleep",
"100000"
],
"resources": {},
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "master-2",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
}
],
"priority": 0,
"enableServiceLinks": true,
"preemptionPolicy": "PreemptLowerPriority"
},
"status": {
"phase": "Running",
"conditions": [
{
"type": "PodReadyToStartContainers",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:31Z"
},
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:29Z"
},
{
"type": "Ready",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-12T15:43:11Z"
},
{
"type": "ContainersReady",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-12T15:43:11Z"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:24Z"
}
],
"hostIP": "192.0.2.3",
"hostIPs": [
{
"ip": "192.0.2.3"
}
],
"podIP": "192.0.2.2",
"podIPs": [
{
"ip": "192.0.2.2"
}
],
"startTime": "2026-04-11T11:56:29Z",
"containerStatuses": [
{
"name": "test-pod3",
"state": {
"running": {
"startedAt": "2026-04-12T15:43:11Z"
}
},
"lastState": {
"terminated": {
"exitCode": 0,
"reason": "Completed",
"startedAt": "2026-04-11T11:56:30Z",
"finishedAt": "2026-04-12T15:43:10Z",
"containerID": "containerd://f4ac7de24b9fc8f4cebc59c2921fb47b870cad0be00d1298342a370fd5890bf1"
}
},
"ready": true,
"restartCount": 1,
"image": "image-registry/mariadb:11.3.2",
"imageID": "image-registry/mariadb@sha256:e09c77fcece9f6adc370d3707c7f5be653036c1d1bba70fe841c4bc2f2292e52",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"started": true,
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"readOnly": true,
"recursiveReadOnly": "Disabled"
}
]
}
],
"qosClass": "BestEffort"
}
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.848125Z",
"stageTimestamp": "2026-04-13T03:07:33.850276Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}e: kubectl list 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "45de837a-8542-42bd-992b-4ead586ac643",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/pods?fieldSelector=metadata.name%3Dtest-pod3\u0026limit=500\u0026resourceVersion=0",
"verb": "list",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubectl/v1.30.12 (linux/amd64) kubernetes/66f4b3f",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.851405Z",
"stageTimestamp": "2026-04-13T03:07:33.851405Z"
}e: kubectl list 응답
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "45de837a-8542-42bd-992b-4ead586ac643",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/pods?fieldSelector=metadata.name%3Dtest-pod3\u0026limit=500\u0026resourceVersion=0",
"verb": "list",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubectl/v1.30.12 (linux/amd64) kubernetes/66f4b3f",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"responseObject": {
"kind": "PodList",
"apiVersion": "v1",
"metadata": {
"resourceVersion": "6768431"
},
"items": [
{
"metadata": {
"name": "test-pod3",
"namespace": "default",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"resourceVersion": "6768431",
"creationTimestamp": "2026-04-11T11:56:24Z",
"deletionTimestamp": "2026-04-13T03:08:03Z",
"deletionGracePeriodSeconds": 30,
"labels": {
"run": "test-pod3"
},
"managedFields": [
{
"manager": "kubectl-run",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-11T11:56:24Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:labels": {
".": {},
"f:run": {}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"test-pod3\"}": {
".": {},
"f:args": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
},
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-12T15:43:05Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:conditions": {
"k:{\"type\":\"ContainersReady\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Initialized\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"PodReadyToStartContainers\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Ready\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
}
},
"f:containerStatuses": {},
"f:hostIP": {},
"f:hostIPs": {},
"f:phase": {},
"f:podIP": {},
"f:podIPs": {
".": {},
"k:{\"ip\":\"192.0.2.2\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
},
"subresource": "status"
}
]
},
"spec": {
"volumes": [
{
"name": "kube-api-access-hdbzd",
"projected": {
"sources": [
{
"serviceAccountToken": {
"expirationSeconds": 3607,
"path": "token"
}
},
{
"configMap": {
"name": "kube-root-ca.crt",
"items": [
{
"key": "ca.crt",
"path": "ca.crt"
}
]
}
},
{
"downwardAPI": {
"items": [
{
"path": "namespace",
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
]
}
}
],
"defaultMode": 420
}
}
],
"containers": [
{
"name": "test-pod3",
"image": "image-registry/mariadb:11.3.2",
"args": [
"sleep",
"100000"
],
"resources": {},
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "master-2",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
}
],
"priority": 0,
"enableServiceLinks": true,
"preemptionPolicy": "PreemptLowerPriority"
},
"status": {
"phase": "Running",
"conditions": [
{
"type": "PodReadyToStartContainers",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:31Z"
},
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:29Z"
},
{
"type": "Ready",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-12T15:43:11Z"
},
{
"type": "ContainersReady",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-12T15:43:11Z"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:24Z"
}
],
"hostIP": "192.0.2.3",
"hostIPs": [
{
"ip": "192.0.2.3"
}
],
"podIP": "192.0.2.2",
"podIPs": [
{
"ip": "192.0.2.2"
}
],
"startTime": "2026-04-11T11:56:29Z",
"containerStatuses": [
{
"name": "test-pod3",
"state": {
"running": {
"startedAt": "2026-04-12T15:43:11Z"
}
},
"lastState": {
"terminated": {
"exitCode": 0,
"reason": "Completed",
"startedAt": "2026-04-11T11:56:30Z",
"finishedAt": "2026-04-12T15:43:10Z",
"containerID": "containerd://f4ac7de24b9fc8f4cebc59c2921fb47b870cad0be00d1298342a370fd5890bf1"
}
},
"ready": true,
"restartCount": 1,
"image": "image-registry/mariadb:11.3.2",
"imageID": "image-registry/mariadb@sha256:e09c77fcece9f6adc370d3707c7f5be653036c1d1bba70fe841c4bc2f2292e52",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"started": true,
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"readOnly": true,
"recursiveReadOnly": "Disabled"
}
]
}
],
"qosClass": "BestEffort"
}
}
]
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.851405Z",
"stageTimestamp": "2026-04-13T03:07:33.851934Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}f: kubectl watch 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "f4a06ee0-a7ee-45eb-9803-24c551394e78",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/pods?allowWatchBookmarks=true\u0026fieldSelector=metadata.name%3Dtest-pod3\u0026resourceVersion=6768431\u0026timeoutSeconds=565\u0026watch=true",
"verb": "watch",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubectl/v1.30.12 (linux/amd64) kubernetes/66f4b3f",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.852743Z",
"stageTimestamp": "2026-04-13T03:07:33.852743Z"
}f: watch ResponseStarted
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "f4a06ee0-a7ee-45eb-9803-24c551394e78",
"stage": "ResponseStarted",
"requestURI": "/api/v1/namespaces/default/pods?allowWatchBookmarks=true\u0026fieldSelector=metadata.name%3Dtest-pod3\u0026resourceVersion=6768431\u0026timeoutSeconds=565\u0026watch=true",
"verb": "watch",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubectl/v1.30.12 (linux/amd64) kubernetes/66f4b3f",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.852743Z",
"stageTimestamp": "2026-04-13T03:07:33.853053Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}4.2 kubelet의 종료와 상태 PATCH
kubelet이 Stopping container test-pod3 Event를 생성하고 Pod를 재조회한 기록이 이어진다. 이 API Event만으로 런타임의 모든 syscall이나 TERM 전달 성공을 직접 관측한 것은 아니다.
최종 status PATCH에는 phase=Failed, Ready=False, ContainersReady=False, PodReadyToStartContainers=False, 컨테이너 exitCode=137·reason=Error가 있다. Initialized=True와 PodScheduled=True는 그대로다. 종료했다고 모든 condition이 False가 되는 것은 아니다.

c: kubelet Event 생성 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "600323d3-3a85-4635-af6d-d0dde07c41fa",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/events",
"verb": "create",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "events",
"namespace": "default",
"apiVersion": "v1"
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.850839Z",
"stageTimestamp": "2026-04-13T03:07:33.850839Z"
}c: Stopping container Event 응답
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "600323d3-3a85-4635-af6d-d0dde07c41fa",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/events",
"verb": "create",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "events",
"namespace": "default",
"name": "test-pod3.18a5cbc19952b6ae",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 201
},
"requestObject": {
"kind": "Event",
"apiVersion": "v1",
"metadata": {
"name": "test-pod3.18a5cbc19952b6ae",
"namespace": "default",
"creationTimestamp": null
},
"involvedObject": {
"kind": "Pod",
"namespace": "default",
"name": "test-pod3",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"apiVersion": "v1",
"resourceVersion": "6158993",
"fieldPath": "spec.containers{test-pod3}"
},
"reason": "Killing",
"message": "Stopping container test-pod3",
"source": {
"component": "kubelet",
"host": "master-2"
},
"firstTimestamp": "2026-04-13T03:07:40Z",
"lastTimestamp": "2026-04-13T03:07:40Z",
"count": 1,
"type": "Normal",
"eventTime": null,
"reportingComponent": "kubelet",
"reportingInstance": "master-2"
},
"responseObject": {
"kind": "Event",
"apiVersion": "v1",
"metadata": {
"name": "test-pod3.18a5cbc19952b6ae",
"namespace": "default",
"uid": "12790e76-e909-49d8-99da-71c04b05a4bf",
"resourceVersion": "6768432",
"creationTimestamp": "2026-04-13T03:07:33Z",
"managedFields": [
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-13T03:07:33Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:count": {},
"f:firstTimestamp": {},
"f:involvedObject": {},
"f:lastTimestamp": {},
"f:message": {},
"f:reason": {},
"f:reportingComponent": {},
"f:reportingInstance": {},
"f:source": {
"f:component": {},
"f:host": {}
},
"f:type": {}
}
}
]
},
"involvedObject": {
"kind": "Pod",
"namespace": "default",
"name": "test-pod3",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"apiVersion": "v1",
"resourceVersion": "6158993",
"fieldPath": "spec.containers{test-pod3}"
},
"reason": "Killing",
"message": "Stopping container test-pod3",
"source": {
"component": "kubelet",
"host": "master-2"
},
"firstTimestamp": "2026-04-13T03:07:40Z",
"lastTimestamp": "2026-04-13T03:07:40Z",
"count": 1,
"type": "Normal",
"eventTime": null,
"reportingComponent": "kubelet",
"reportingInstance": "master-2"
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.850839Z",
"stageTimestamp": "2026-04-13T03:07:33.856162Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": ""
}
}d: kubelet Pod 조회 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "2257d0bf-c0c9-4bae-a547-e31e3f57a162",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "get",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.850849Z",
"stageTimestamp": "2026-04-13T03:07:33.850849Z"
}d: kubelet Pod 조회 응답
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "2257d0bf-c0c9-4bae-a547-e31e3f57a162",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "get",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"responseObject": {
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "test-pod3",
"namespace": "default",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"resourceVersion": "6768431",
"creationTimestamp": "2026-04-11T11:56:24Z",
"deletionTimestamp": "2026-04-13T03:08:03Z",
"deletionGracePeriodSeconds": 30,
"labels": {
"run": "test-pod3"
},
"managedFields": [
{
"manager": "kubectl-run",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-11T11:56:24Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:labels": {
".": {},
"f:run": {}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"test-pod3\"}": {
".": {},
"f:args": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
},
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-12T15:43:05Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:conditions": {
"k:{\"type\":\"ContainersReady\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Initialized\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"PodReadyToStartContainers\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Ready\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
}
},
"f:containerStatuses": {},
"f:hostIP": {},
"f:hostIPs": {},
"f:phase": {},
"f:podIP": {},
"f:podIPs": {
".": {},
"k:{\"ip\":\"192.0.2.2\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
},
"subresource": "status"
}
]
},
"spec": {
"volumes": [
{
"name": "kube-api-access-hdbzd",
"projected": {
"sources": [
{
"serviceAccountToken": {
"expirationSeconds": 3607,
"path": "token"
}
},
{
"configMap": {
"name": "kube-root-ca.crt",
"items": [
{
"key": "ca.crt",
"path": "ca.crt"
}
]
}
},
{
"downwardAPI": {
"items": [
{
"path": "namespace",
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
]
}
}
],
"defaultMode": 420
}
}
],
"containers": [
{
"name": "test-pod3",
"image": "image-registry/mariadb:11.3.2",
"args": [
"sleep",
"100000"
],
"resources": {},
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "master-2",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
}
],
"priority": 0,
"enableServiceLinks": true,
"preemptionPolicy": "PreemptLowerPriority"
},
"status": {
"phase": "Running",
"conditions": [
{
"type": "PodReadyToStartContainers",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:31Z"
},
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:29Z"
},
{
"type": "Ready",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-12T15:43:11Z"
},
{
"type": "ContainersReady",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-12T15:43:11Z"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:24Z"
}
],
"hostIP": "192.0.2.3",
"hostIPs": [
{
"ip": "192.0.2.3"
}
],
"podIP": "192.0.2.2",
"podIPs": [
{
"ip": "192.0.2.2"
}
],
"startTime": "2026-04-11T11:56:29Z",
"containerStatuses": [
{
"name": "test-pod3",
"state": {
"running": {
"startedAt": "2026-04-12T15:43:11Z"
}
},
"lastState": {
"terminated": {
"exitCode": 0,
"reason": "Completed",
"startedAt": "2026-04-11T11:56:30Z",
"finishedAt": "2026-04-12T15:43:10Z",
"containerID": "containerd://f4ac7de24b9fc8f4cebc59c2921fb47b870cad0be00d1298342a370fd5890bf1"
}
},
"ready": true,
"restartCount": 1,
"image": "image-registry/mariadb:11.3.2",
"imageID": "image-registry/mariadb@sha256:e09c77fcece9f6adc370d3707c7f5be653036c1d1bba70fe841c4bc2f2292e52",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"started": true,
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"readOnly": true,
"recursiveReadOnly": "Disabled"
}
]
}
],
"qosClass": "BestEffort"
}
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.850849Z",
"stageTimestamp": "2026-04-13T03:07:33.855960Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": ""
}
}g: 종료 경과 후 Pod 조회 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "0e89bdb8-e964-4832-831b-8f48e27e7360",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "get",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"requestReceivedTimestamp": "2026-04-13T03:08:04.049830Z",
"stageTimestamp": "2026-04-13T03:08:04.049830Z"
}g: 종료 경과 후 Pod 조회 응답
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "0e89bdb8-e964-4832-831b-8f48e27e7360",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "get",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"responseObject": {
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "test-pod3",
"namespace": "default",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"resourceVersion": "6768431",
"creationTimestamp": "2026-04-11T11:56:24Z",
"deletionTimestamp": "2026-04-13T03:08:03Z",
"deletionGracePeriodSeconds": 30,
"labels": {
"run": "test-pod3"
},
"managedFields": [
{
"manager": "kubectl-run",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-11T11:56:24Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:labels": {
".": {},
"f:run": {}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"test-pod3\"}": {
".": {},
"f:args": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
},
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-12T15:43:05Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:conditions": {
"k:{\"type\":\"ContainersReady\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Initialized\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"PodReadyToStartContainers\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Ready\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
}
},
"f:containerStatuses": {},
"f:hostIP": {},
"f:hostIPs": {},
"f:phase": {},
"f:podIP": {},
"f:podIPs": {
".": {},
"k:{\"ip\":\"192.0.2.2\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
},
"subresource": "status"
}
]
},
"spec": {
"volumes": [
{
"name": "kube-api-access-hdbzd",
"projected": {
"sources": [
{
"serviceAccountToken": {
"expirationSeconds": 3607,
"path": "token"
}
},
{
"configMap": {
"name": "kube-root-ca.crt",
"items": [
{
"key": "ca.crt",
"path": "ca.crt"
}
]
}
},
{
"downwardAPI": {
"items": [
{
"path": "namespace",
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
]
}
}
],
"defaultMode": 420
}
}
],
"containers": [
{
"name": "test-pod3",
"image": "image-registry/mariadb:11.3.2",
"args": [
"sleep",
"100000"
],
"resources": {},
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "master-2",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
}
],
"priority": 0,
"enableServiceLinks": true,
"preemptionPolicy": "PreemptLowerPriority"
},
"status": {
"phase": "Running",
"conditions": [
{
"type": "PodReadyToStartContainers",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:31Z"
},
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:29Z"
},
{
"type": "Ready",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-12T15:43:11Z"
},
{
"type": "ContainersReady",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-12T15:43:11Z"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:24Z"
}
],
"hostIP": "192.0.2.3",
"hostIPs": [
{
"ip": "192.0.2.3"
}
],
"podIP": "192.0.2.2",
"podIPs": [
{
"ip": "192.0.2.2"
}
],
"startTime": "2026-04-11T11:56:29Z",
"containerStatuses": [
{
"name": "test-pod3",
"state": {
"running": {
"startedAt": "2026-04-12T15:43:11Z"
}
},
"lastState": {
"terminated": {
"exitCode": 0,
"reason": "Completed",
"startedAt": "2026-04-11T11:56:30Z",
"finishedAt": "2026-04-12T15:43:10Z",
"containerID": "containerd://f4ac7de24b9fc8f4cebc59c2921fb47b870cad0be00d1298342a370fd5890bf1"
}
},
"ready": true,
"restartCount": 1,
"image": "image-registry/mariadb:11.3.2",
"imageID": "image-registry/mariadb@sha256:e09c77fcece9f6adc370d3707c7f5be653036c1d1bba70fe841c4bc2f2292e52",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"started": true,
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"readOnly": true,
"recursiveReadOnly": "Disabled"
}
]
}
],
"qosClass": "BestEffort"
}
},
"requestReceivedTimestamp": "2026-04-13T03:08:04.049830Z",
"stageTimestamp": "2026-04-13T03:08:04.052129Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": ""
}
}h: status PATCH 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "337e981d-5b41-42dd-b612-3db1d372afb1",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3/status",
"verb": "patch",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1",
"subresource": "status"
},
"requestReceivedTimestamp": "2026-04-13T03:08:04.053782Z",
"stageTimestamp": "2026-04-13T03:08:04.053782Z"
}h: Failed·exitCode 137 상태 PATCH와 응답
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "337e981d-5b41-42dd-b612-3db1d372afb1",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3/status",
"verb": "patch",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1",
"subresource": "status"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"metadata": {
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b"
},
"status": {
"$setElementOrder/conditions": [
{
"type": "PodReadyToStartContainers"
},
{
"type": "Initialized"
},
{
"type": "Ready"
},
{
"type": "ContainersReady"
},
{
"type": "PodScheduled"
}
],
"conditions": [
{
"lastTransitionTime": "2026-04-13T03:08:10Z",
"status": "False",
"type": "PodReadyToStartContainers"
},
{
"lastTransitionTime": "2026-04-13T03:08:10Z",
"reason": "PodFailed",
"status": "False",
"type": "Ready"
},
{
"lastTransitionTime": "2026-04-13T03:08:10Z",
"reason": "PodFailed",
"status": "False",
"type": "ContainersReady"
}
],
"containerStatuses": [
{
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"image": "image-registry/mariadb:11.3.2",
"imageID": "image-registry/mariadb@sha256:e09c77fcece9f6adc370d3707c7f5be653036c1d1bba70fe841c4bc2f2292e52",
"lastState": {
"terminated": {
"containerID": "containerd://f4ac7de24b9fc8f4cebc59c2921fb47b870cad0be00d1298342a370fd5890bf1",
"exitCode": 0,
"finishedAt": "2026-04-12T15:43:10Z",
"reason": "Completed",
"startedAt": "2026-04-11T11:56:30Z"
}
},
"name": "test-pod3",
"ready": false,
"restartCount": 1,
"started": false,
"state": {
"terminated": {
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"exitCode": 137,
"finishedAt": "2026-04-13T03:08:10Z",
"reason": "Error",
"startedAt": "2026-04-12T15:43:11Z"
}
},
"volumeMounts": [
{
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"name": "kube-api-access-hdbzd",
"readOnly": true,
"recursiveReadOnly": "Disabled"
}
]
}
],
"phase": "Failed"
}
},
"responseObject": {
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "test-pod3",
"namespace": "default",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"resourceVersion": "6768560",
"creationTimestamp": "2026-04-11T11:56:24Z",
"deletionTimestamp": "2026-04-13T03:08:03Z",
"deletionGracePeriodSeconds": 30,
"labels": {
"run": "test-pod3"
},
"managedFields": [
{
"manager": "kubectl-run",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-11T11:56:24Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:labels": {
".": {},
"f:run": {}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"test-pod3\"}": {
".": {},
"f:args": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
},
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-13T03:08:04Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:conditions": {
"k:{\"type\":\"ContainersReady\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:reason": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Initialized\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"PodReadyToStartContainers\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Ready\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:reason": {},
"f:status": {},
"f:type": {}
}
},
"f:containerStatuses": {},
"f:hostIP": {},
"f:hostIPs": {},
"f:phase": {},
"f:podIP": {},
"f:podIPs": {
".": {},
"k:{\"ip\":\"192.0.2.2\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
},
"subresource": "status"
}
]
},
"spec": {
"volumes": [
{
"name": "kube-api-access-hdbzd",
"projected": {
"sources": [
{
"serviceAccountToken": {
"expirationSeconds": 3607,
"path": "token"
}
},
{
"configMap": {
"name": "kube-root-ca.crt",
"items": [
{
"key": "ca.crt",
"path": "ca.crt"
}
]
}
},
{
"downwardAPI": {
"items": [
{
"path": "namespace",
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
]
}
}
],
"defaultMode": 420
}
}
],
"containers": [
{
"name": "test-pod3",
"image": "image-registry/mariadb:11.3.2",
"args": [
"sleep",
"100000"
],
"resources": {},
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "master-2",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
}
],
"priority": 0,
"enableServiceLinks": true,
"preemptionPolicy": "PreemptLowerPriority"
},
"status": {
"phase": "Failed",
"conditions": [
{
"type": "PodReadyToStartContainers",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z"
},
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:29Z"
},
{
"type": "Ready",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z",
"reason": "PodFailed"
},
{
"type": "ContainersReady",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z",
"reason": "PodFailed"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:24Z"
}
],
"hostIP": "192.0.2.3",
"hostIPs": [
{
"ip": "192.0.2.3"
}
],
"podIP": "192.0.2.2",
"podIPs": [
{
"ip": "192.0.2.2"
}
],
"startTime": "2026-04-11T11:56:29Z",
"containerStatuses": [
{
"name": "test-pod3",
"state": {
"terminated": {
"exitCode": 137,
"reason": "Error",
"startedAt": "2026-04-12T15:43:11Z",
"finishedAt": "2026-04-13T03:08:10Z",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9"
}
},
"lastState": {
"terminated": {
"exitCode": 0,
"reason": "Completed",
"startedAt": "2026-04-11T11:56:30Z",
"finishedAt": "2026-04-12T15:43:10Z",
"containerID": "containerd://f4ac7de24b9fc8f4cebc59c2921fb47b870cad0be00d1298342a370fd5890bf1"
}
},
"ready": false,
"restartCount": 1,
"image": "image-registry/mariadb:11.3.2",
"imageID": "image-registry/mariadb@sha256:e09c77fcece9f6adc370d3707c7f5be653036c1d1bba70fe841c4bc2f2292e52",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"started": false,
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"readOnly": true,
"recursiveReadOnly": "Disabled"
}
]
}
],
"qosClass": "BestEffort"
}
},
"requestReceivedTimestamp": "2026-04-13T03:08:04.053782Z",
"stageTimestamp": "2026-04-13T03:08:04.062508Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": ""
}
}4.3 마지막 API 객체 제거
후속 get에서 최종 상태를 다시 읽은 뒤 kubelet이 gracePeriodSeconds=0과 UID precondition으로 delete한다. UID 조건은 같은 이름의 다른 Pod가 다시 생겼을 때 오래된 삭제 요청이 새 객체에 적용되는 것을 막는다.
이것은 노드의 종료 처리가 끝난 뒤 수행한 마지막 API 정리 요청이다. 사용자가 처음부터 --force --grace-period=0으로 객체만 강제로 지우는 상황과 같다고 취급하지 않는다. 강제 API 삭제 자체는 원격 노드의 프로세스가 확실히 끝났다는 보장이 아니다.
watch의 ResponseComplete도 이어진다. 이번 기록에서는 삭제 시점과 가깝지만 “대상 Pod가 삭제되면 모든 watch 연결이 자동 종료된다”라는 API 규칙은 아니다. 클라이언트가 원하는 조건을 보고 연결을 닫았는지, timeout이나 연결 종료가 있었는지를 구분한다.
i: 최종 상태 GET 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "d6d3b48e-729f-405b-99ba-64a8779ce64d",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "get",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"requestReceivedTimestamp": "2026-04-13T03:08:04.876984Z",
"stageTimestamp": "2026-04-13T03:08:04.876984Z"
}i: 최종 상태 GET 응답
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "d6d3b48e-729f-405b-99ba-64a8779ce64d",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "get",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"responseObject": {
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "test-pod3",
"namespace": "default",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"resourceVersion": "6768560",
"creationTimestamp": "2026-04-11T11:56:24Z",
"deletionTimestamp": "2026-04-13T03:08:03Z",
"deletionGracePeriodSeconds": 30,
"labels": {
"run": "test-pod3"
},
"managedFields": [
{
"manager": "kubectl-run",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-11T11:56:24Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:labels": {
".": {},
"f:run": {}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"test-pod3\"}": {
".": {},
"f:args": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
},
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-13T03:08:04Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:conditions": {
"k:{\"type\":\"ContainersReady\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:reason": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Initialized\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"PodReadyToStartContainers\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Ready\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:reason": {},
"f:status": {},
"f:type": {}
}
},
"f:containerStatuses": {},
"f:hostIP": {},
"f:hostIPs": {},
"f:phase": {},
"f:podIP": {},
"f:podIPs": {
".": {},
"k:{\"ip\":\"192.0.2.2\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
},
"subresource": "status"
}
]
},
"spec": {
"volumes": [
{
"name": "kube-api-access-hdbzd",
"projected": {
"sources": [
{
"serviceAccountToken": {
"expirationSeconds": 3607,
"path": "token"
}
},
{
"configMap": {
"name": "kube-root-ca.crt",
"items": [
{
"key": "ca.crt",
"path": "ca.crt"
}
]
}
},
{
"downwardAPI": {
"items": [
{
"path": "namespace",
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
]
}
}
],
"defaultMode": 420
}
}
],
"containers": [
{
"name": "test-pod3",
"image": "image-registry/mariadb:11.3.2",
"args": [
"sleep",
"100000"
],
"resources": {},
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "master-2",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
}
],
"priority": 0,
"enableServiceLinks": true,
"preemptionPolicy": "PreemptLowerPriority"
},
"status": {
"phase": "Failed",
"conditions": [
{
"type": "PodReadyToStartContainers",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z"
},
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:29Z"
},
{
"type": "Ready",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z",
"reason": "PodFailed"
},
{
"type": "ContainersReady",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z",
"reason": "PodFailed"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:24Z"
}
],
"hostIP": "192.0.2.3",
"hostIPs": [
{
"ip": "192.0.2.3"
}
],
"podIP": "192.0.2.2",
"podIPs": [
{
"ip": "192.0.2.2"
}
],
"startTime": "2026-04-11T11:56:29Z",
"containerStatuses": [
{
"name": "test-pod3",
"state": {
"terminated": {
"exitCode": 137,
"reason": "Error",
"startedAt": "2026-04-12T15:43:11Z",
"finishedAt": "2026-04-13T03:08:10Z",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9"
}
},
"lastState": {
"terminated": {
"exitCode": 0,
"reason": "Completed",
"startedAt": "2026-04-11T11:56:30Z",
"finishedAt": "2026-04-12T15:43:10Z",
"containerID": "containerd://f4ac7de24b9fc8f4cebc59c2921fb47b870cad0be00d1298342a370fd5890bf1"
}
},
"ready": false,
"restartCount": 1,
"image": "image-registry/mariadb:11.3.2",
"imageID": "image-registry/mariadb@sha256:e09c77fcece9f6adc370d3707c7f5be653036c1d1bba70fe841c4bc2f2292e52",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"started": false,
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"readOnly": true,
"recursiveReadOnly": "Disabled"
}
]
}
],
"qosClass": "BestEffort"
}
},
"requestReceivedTimestamp": "2026-04-13T03:08:04.876984Z",
"stageTimestamp": "2026-04-13T03:08:04.878789Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": ""
}
}j: 추가 GET 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "9b791f2e-6d4d-4354-8260-b8fb4ad11959",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "get",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"requestReceivedTimestamp": "2026-04-13T03:08:04.880522Z",
"stageTimestamp": "2026-04-13T03:08:04.880522Z"
}j: 추가 GET 응답
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "9b791f2e-6d4d-4354-8260-b8fb4ad11959",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "get",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"responseObject": {
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "test-pod3",
"namespace": "default",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"resourceVersion": "6768560",
"creationTimestamp": "2026-04-11T11:56:24Z",
"deletionTimestamp": "2026-04-13T03:08:03Z",
"deletionGracePeriodSeconds": 30,
"labels": {
"run": "test-pod3"
},
"managedFields": [
{
"manager": "kubectl-run",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-11T11:56:24Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:labels": {
".": {},
"f:run": {}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"test-pod3\"}": {
".": {},
"f:args": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
},
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-13T03:08:04Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:conditions": {
"k:{\"type\":\"ContainersReady\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:reason": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Initialized\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"PodReadyToStartContainers\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Ready\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:reason": {},
"f:status": {},
"f:type": {}
}
},
"f:containerStatuses": {},
"f:hostIP": {},
"f:hostIPs": {},
"f:phase": {},
"f:podIP": {},
"f:podIPs": {
".": {},
"k:{\"ip\":\"192.0.2.2\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
},
"subresource": "status"
}
]
},
"spec": {
"volumes": [
{
"name": "kube-api-access-hdbzd",
"projected": {
"sources": [
{
"serviceAccountToken": {
"expirationSeconds": 3607,
"path": "token"
}
},
{
"configMap": {
"name": "kube-root-ca.crt",
"items": [
{
"key": "ca.crt",
"path": "ca.crt"
}
]
}
},
{
"downwardAPI": {
"items": [
{
"path": "namespace",
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
]
}
}
],
"defaultMode": 420
}
}
],
"containers": [
{
"name": "test-pod3",
"image": "image-registry/mariadb:11.3.2",
"args": [
"sleep",
"100000"
],
"resources": {},
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "master-2",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
}
],
"priority": 0,
"enableServiceLinks": true,
"preemptionPolicy": "PreemptLowerPriority"
},
"status": {
"phase": "Failed",
"conditions": [
{
"type": "PodReadyToStartContainers",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z"
},
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:29Z"
},
{
"type": "Ready",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z",
"reason": "PodFailed"
},
{
"type": "ContainersReady",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z",
"reason": "PodFailed"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:24Z"
}
],
"hostIP": "192.0.2.3",
"hostIPs": [
{
"ip": "192.0.2.3"
}
],
"podIP": "192.0.2.2",
"podIPs": [
{
"ip": "192.0.2.2"
}
],
"startTime": "2026-04-11T11:56:29Z",
"containerStatuses": [
{
"name": "test-pod3",
"state": {
"terminated": {
"exitCode": 137,
"reason": "Error",
"startedAt": "2026-04-12T15:43:11Z",
"finishedAt": "2026-04-13T03:08:10Z",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9"
}
},
"lastState": {
"terminated": {
"exitCode": 0,
"reason": "Completed",
"startedAt": "2026-04-11T11:56:30Z",
"finishedAt": "2026-04-12T15:43:10Z",
"containerID": "containerd://f4ac7de24b9fc8f4cebc59c2921fb47b870cad0be00d1298342a370fd5890bf1"
}
},
"ready": false,
"restartCount": 1,
"image": "image-registry/mariadb:11.3.2",
"imageID": "image-registry/mariadb@sha256:e09c77fcece9f6adc370d3707c7f5be653036c1d1bba70fe841c4bc2f2292e52",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"started": false,
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"readOnly": true,
"recursiveReadOnly": "Disabled"
}
]
}
],
"qosClass": "BestEffort"
}
},
"requestReceivedTimestamp": "2026-04-13T03:08:04.880522Z",
"stageTimestamp": "2026-04-13T03:08:04.882457Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": ""
}
}k: kubelet 최종 delete 수신
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "43908308-a854-4051-b420-e01dc852f127",
"stage": "RequestReceived",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "delete",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"requestReceivedTimestamp": "2026-04-13T03:08:04.883564Z",
"stageTimestamp": "2026-04-13T03:08:04.883564Z"
}k: UID 조건·gracePeriodSeconds=0 delete 응답
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "43908308-a854-4051-b420-e01dc852f127",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/pods/test-pod3",
"verb": "delete",
"user": {
"username": "system:node:master-2",
"groups": [
"system:nodes",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubelet/v1.31.13 (linux/amd64) kubernetes/c601ba4",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestObject": {
"kind": "DeleteOptions",
"apiVersion": "meta.k8s.io/__internal",
"gracePeriodSeconds": 0,
"preconditions": {
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b"
}
},
"responseObject": {
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "test-pod3",
"namespace": "default",
"uid": "470c3197-5c7f-46ea-ac66-a4ade439810b",
"resourceVersion": "6768565",
"creationTimestamp": "2026-04-11T11:56:24Z",
"deletionTimestamp": "2026-04-13T03:07:33Z",
"deletionGracePeriodSeconds": 0,
"labels": {
"run": "test-pod3"
},
"managedFields": [
{
"manager": "kubectl-run",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-11T11:56:24Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:labels": {
".": {},
"f:run": {}
}
},
"f:spec": {
"f:containers": {
"k:{\"name\":\"test-pod3\"}": {
".": {},
"f:args": {},
"f:image": {},
"f:imagePullPolicy": {},
"f:name": {},
"f:resources": {},
"f:terminationMessagePath": {},
"f:terminationMessagePolicy": {}
}
},
"f:dnsPolicy": {},
"f:enableServiceLinks": {},
"f:restartPolicy": {},
"f:schedulerName": {},
"f:securityContext": {},
"f:terminationGracePeriodSeconds": {}
}
}
},
{
"manager": "kubelet",
"operation": "Update",
"apiVersion": "v1",
"time": "2026-04-13T03:08:04Z",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:status": {
"f:conditions": {
"k:{\"type\":\"ContainersReady\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:reason": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Initialized\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"PodReadyToStartContainers\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:status": {},
"f:type": {}
},
"k:{\"type\":\"Ready\"}": {
".": {},
"f:lastProbeTime": {},
"f:lastTransitionTime": {},
"f:reason": {},
"f:status": {},
"f:type": {}
}
},
"f:containerStatuses": {},
"f:hostIP": {},
"f:hostIPs": {},
"f:phase": {},
"f:podIP": {},
"f:podIPs": {
".": {},
"k:{\"ip\":\"192.0.2.2\"}": {
".": {},
"f:ip": {}
}
},
"f:startTime": {}
}
},
"subresource": "status"
}
]
},
"spec": {
"volumes": [
{
"name": "kube-api-access-hdbzd",
"projected": {
"sources": [
{
"serviceAccountToken": {
"expirationSeconds": 3607,
"path": "token"
}
},
{
"configMap": {
"name": "kube-root-ca.crt",
"items": [
{
"key": "ca.crt",
"path": "ca.crt"
}
]
}
},
{
"downwardAPI": {
"items": [
{
"path": "namespace",
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "metadata.namespace"
}
}
]
}
}
],
"defaultMode": 420
}
}
],
"containers": [
{
"name": "test-pod3",
"image": "image-registry/mariadb:11.3.2",
"args": [
"sleep",
"100000"
],
"resources": {},
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "master-2",
"securityContext": {},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 120
}
],
"priority": 0,
"enableServiceLinks": true,
"preemptionPolicy": "PreemptLowerPriority"
},
"status": {
"phase": "Failed",
"conditions": [
{
"type": "PodReadyToStartContainers",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z"
},
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:29Z"
},
{
"type": "Ready",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z",
"reason": "PodFailed"
},
{
"type": "ContainersReady",
"status": "False",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-13T03:08:10Z",
"reason": "PodFailed"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2026-04-11T11:56:24Z"
}
],
"hostIP": "192.0.2.3",
"hostIPs": [
{
"ip": "192.0.2.3"
}
],
"podIP": "192.0.2.2",
"podIPs": [
{
"ip": "192.0.2.2"
}
],
"startTime": "2026-04-11T11:56:29Z",
"containerStatuses": [
{
"name": "test-pod3",
"state": {
"terminated": {
"exitCode": 137,
"reason": "Error",
"startedAt": "2026-04-12T15:43:11Z",
"finishedAt": "2026-04-13T03:08:10Z",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9"
}
},
"lastState": {
"terminated": {
"exitCode": 0,
"reason": "Completed",
"startedAt": "2026-04-11T11:56:30Z",
"finishedAt": "2026-04-12T15:43:10Z",
"containerID": "containerd://f4ac7de24b9fc8f4cebc59c2921fb47b870cad0be00d1298342a370fd5890bf1"
}
},
"ready": false,
"restartCount": 1,
"image": "image-registry/mariadb:11.3.2",
"imageID": "image-registry/mariadb@sha256:e09c77fcece9f6adc370d3707c7f5be653036c1d1bba70fe841c4bc2f2292e52",
"containerID": "containerd://bd8cf26aeddd1711dd5d0e61579d13980bcd09c0bb9e8b074a7dcde77d7962b9",
"started": false,
"volumeMounts": [
{
"name": "kube-api-access-hdbzd",
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
"readOnly": true,
"recursiveReadOnly": "Disabled"
}
]
}
],
"qosClass": "BestEffort"
}
},
"requestReceivedTimestamp": "2026-04-13T03:08:04.883564Z",
"stageTimestamp": "2026-04-13T03:08:04.907392Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": ""
}
}f: kubectl watch ResponseComplete
{
"kind": "Event",
"apiVersion": "audit.k8s.io/v1",
"level": "RequestResponse",
"auditID": "f4a06ee0-a7ee-45eb-9803-24c551394e78",
"stage": "ResponseComplete",
"requestURI": "/api/v1/namespaces/default/pods?allowWatchBookmarks=true\u0026fieldSelector=metadata.name%3Dtest-pod3\u0026resourceVersion=6768431\u0026timeoutSeconds=565\u0026watch=true",
"verb": "watch",
"user": {
"username": "kubernetes-admin",
"groups": [
"kubeadm:cluster-admins",
"system:authenticated"
]
},
"sourceIPs": [
"192.0.2.1"
],
"userAgent": "kubectl/v1.30.12 (linux/amd64) kubernetes/66f4b3f",
"objectRef": {
"resource": "pods",
"namespace": "default",
"name": "test-pod3",
"apiVersion": "v1"
},
"responseStatus": {
"metadata": {},
"code": 200
},
"requestReceivedTimestamp": "2026-04-13T03:07:33.852743Z",
"stageTimestamp": "2026-04-13T03:08:04.908385Z",
"annotations": {
"authorization.k8s.io/decision": "allow",
"authorization.k8s.io/reason": "RBAC: allowed by ClusterRoleBinding \"kubeadm:cluster-admins\" of ClusterRole \"cluster-admin\" to Group \"kubeadm:cluster-admins\""
}
}5. 상태 필드와 종료 코드 해석
| 필드 | 읽는 기준 |
|---|---|
| PodReadyToStartContainers | sandbox와 네트워크 준비 상태를 나타낸다. 모든 이미지 다운로드·볼륨·앱 초기화가 끝났다는 뜻은 아니다. |
| Initialized | init container 초기화 조건이다. init container가 없는 Pod에서도 True일 수 있다. |
| ContainersReady | 컨테이너 준비 조건이다. 프로세스가 실행 중인지만 검사하는 필드가 아니다. |
| Ready | Pod의 트래픽 제공 준비 조건이다. 네트워크 차단 기능 그 자체가 아니다. |
| PodScheduled | 노드 배정 조건이다. 앱 종료 뒤에도 True일 수 있다. |
| containerStatuses.started | postStart hook과 startup probe 등 시작 완료 상태를 반영한다. 단순 running 여부와 같지 않다. |
ready=False라고 이미 연결된 트래픽·직접 Pod IP 접근까지 모두 차단되는 것은 아니다. 종료 endpoint는 EndpointSlice에 terminating으로 남으며 일반 ready는 False가 되고, 드레이닝을 위한 serving 조건도 구분한다.
137은 관례상 128+SIGKILL(9), 143은 128+SIGTERM(15)에 해당한다. 그러나 종료 코드 하나로 원인을 확정할 수 없다. 프로그램이 같은 코드로 직접 종료할 수도 있고, 137이면 OOM·명시적 kill 등 다른 원인도 조사해야 한다.
delete 뒤 약 30초 후 Failed·exitCode 137이 보고됐다. 유예 시간 만료 후 강제 종료와 부합하지만 런타임·커널 로그가 없어 종료 원인은 확정되지 않았다. 노드의 finishedAt=03:08:10Z와 API audit의 03:08:04Z 사이에도 시각 차이가 있다.
exitCode=0은 프로그램의 성공 종료 관례일 뿐 업무 데이터의 정상 처리까지 보증하지 않는다.
6. kubectl과 etcd에서 본 제거
화면 기록은 Terminating 뒤 Error를 보여 준다. 이를 status.phase=Terminating으로 바꾸어 기록하지 않는다.
당시 watch 화면
test-pod3 1/1 Terminating 0 29s
test-pod3 0/1 Error 0 59s
test-pod3 0/1 Error 0 59s
test-pod3 0/1 Error 0 59setcd 비교에서는 같은 키의 Version이 4→5로 바뀌고 마지막 조회 Count=0이 나온다. Version 증가와 value 변화만으로 어떤 필드가 정확히 바뀌었는지 확정할 수는 없다. 아래 바이트 자료의 필드를 비교하려면 API 객체 또는 올바른 디코딩 결과를 이용해야 한다.
이 etcd 비교의 CreateRevision·ModRevision은 위 audit의 resourceVersion과 범위가 다르고 Pod IP도 일부 다르다. 별도 실행을 비교한 자료일 수 있으므로 audit의 초 단위 타임라인에 끼워 넣지 않는다.
etcd 비교: 삭제 전
"ClusterID" : 5215609492266341580
"MemberID" : 17551526217476798369
"Revision" : 6812057
"RaftTerm" : 23
"Key" : "/registry/pods/default/test-pod3"
"CreateRevision" : 6811978
"ModRevision" : 6811990
"Version" : 4
"Value" : "POD_SERIALIZED_VALUE_REDACTED"
"Lease" : 0
"More" : false
"Count" : 1etcd 비교: 삭제 중
"ClusterID" : 5215609492266341580
"MemberID" : 17551526217476798369
"Revision" : 6812241
"RaftTerm" : 23
"Key" : "/registry/pods/default/test-pod3"
"CreateRevision" : 6811978
"ModRevision" : 6812201
"Version" : 5
"Value" : "POD_SERIALIZED_VALUE_REDACTED"
"Lease" : 0
"More" : false
"Count" : 1etcd 비교: 삭제 후 Count=0
"ClusterID" : 5215609492266341580
"MemberID" : 17551526217476798369
"Revision" : 6812343
"RaftTerm" : 23
"More" : false
"Count" : 07. 종료가 멈췄을 때의 확인 순서
- Pod UID·deletionTimestamp·유예 시간·finalizers를 확인한다.
- 해당 노드의 kubelet·런타임 상태와 실제 프로세스를 확인한다.
- preStop·앱의 신호 처리·볼륨 정리 등 어느 단계가 남았는지 확인한다.
- 소유자와 종속 객체, 관련 컨트롤러의 상태를 확인한다.
- 증거에 맞춰 조치하고 API 객체 제거와 실제 실행 종료를 각각 검증한다.
finalizer를 무조건 지우거나 강제 삭제부터 하면 외부 자원 정리를 건너뛸 수 있다. 이 실습은 정상 삭제 요청 뒤의 종료·제거 추적이며, 멈춘 리소스를 강제 복구한 사례는 아니다.