Kubernetes Pod Not Terminating After Job Completion on v1.27 Despite Proper Configuration
I've been struggling with this for a few days now and could really use some help... I tried several approaches but none seem to work. I'm experiencing an issue where my Kubernetes Job is completing successfully, but the associated Pods are not terminating as expected. I have defined the Job using the following YAML configuration: ```yaml apiVersion: batch/v1 kind: Job metadata: name: my-job spec: template: spec: containers: - name: my-container image: my-image:latest command: ["/bin/sh", "-c", "echo Hello, Kubernetes!"] restartPolicy: Never backoffLimit: 4 ttlSecondsAfterFinished: 30 ``` I expected that after the Job completes, the Pod would terminate after the specified TTL (30 seconds). However, I noticed that the Pods remain in the `Completed` state indefinitely. I've confirmed that the Job itself is completing successfully, and I can see it in the `kubectl get jobs` output as follows: ``` NAME COMPLETIONS DURATION AGE my-job 1/1 10s 5m ``` I have tried modifying the `ttlSecondsAfterFinished` field to different values, but it seems to have no effect on the Pods. I also checked the Kubernetes documentation for version 1.27, and it mentions that TTL for finished Jobs should work as expected. My cluster is running on GKE, and I have the correct permissions set up. Additionally, I checked the events associated with the Pods using `kubectl describe pod <pod-name>` and noticed: ``` Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal SuccessfulCreate 2m job-controller Created pod: my-job-<unique-id> Normal Completed 2m kubelet Successfully terminated container my-container ``` Could there be some configuration or cluster-level setting that I'm missing? Any insights or suggestions would be greatly appreciated! For context: I'm using Yaml on Windows. Has anyone else encountered this? I'm coming from a different tech stack and learning Yaml. Hoping someone can shed some light on this. For context: I'm using Yaml on macOS. Thanks for any help you can provide! Could this be a known issue?