Our Installation
- We run a single instance mongodb 7.0.7 in our dev aks kubernetes cluster.
- It’s deployed via bitnami mongodb helm chart.
- We use these parameters (amongst others):
useStatefulSet: true
architecture: standalone
Problem
Sometimes the mongodb is terminated and hangs in the Completion
state, without getting restarted.
Analysis
In the status section of the pod’s yaml (see below) I can see that the pod was terminated with status code 0, but I can’t see a reason, why the pod isn’t restarted.
Of course we have restartPolicy: Always
Question
- Why isn’t the pod restarted?
- Which kubernetes process should care about the restart? Can I find logs about that process?
Status YAML
status:
conditions:
...
- lastProbeTime: null
lastTransitionTime: "2024-04-30T23:48:10Z"
reason: PodCompleted
status: "False"
type: Ready
- lastProbeTime: null
lastTransitionTime: "2024-04-30T23:48:10Z"
reason: PodCompleted
status: "False"
type: ContainersReady
...
containerStatuses:
- containerID: containerd://12345
image: mongodb:7.0.7
imageID: mongodb@sha256:12345
lastState: {}
name: mongodb
ready: false
restartCount: 0
started: false
state:
terminated:
containerID: containerd://123345
exitCode: 0
finishedAt: "2024-04-30T23:48:09Z"
reason: Completed
startedAt: "2024-04-24T17:55:38Z"