Есть такой под:
apiVersion: v1
kind: Pod
metadata:
name: myapp
labels:
name: myapp
spec:
containers:
- name: myapp
image: linuxcontainers/debian-slim
resources:
limits:
memory: "128Mi"
cpu: "100m"
requests:
memory: "128Mi"
cpu: "100m"
volumeMounts:
- name: localtime
mountPath: /etc/localtime
volumes:
- name: localtime
hostPath:
path: /usr/share/zoneinfo/Asia/Taipei
restartPolicy: Always
После применения
kubeclt apply -f pod.yml в
kubectl describe myapp происходит так:
Normal Created 26m (x4 over 27m) kubelet Created container myapp
Normal Started 26m (x4 over 27m) kubelet Started container myapp
Normal Pulling 25m (x5 over 27m) kubelet Pulling image "jitesoft/alpine"
Normal Pulled 25m kubelet Successfully pulled image "jitesoft/alpine" in 3.701s
Warning BackOff 2m37s (x113 over 27m) kubelet Back-off restarting failed container myapp in pod myapp_default(dc280bb6-13e3-4921-9dbe-05c6e60a6a96)
Но
если использовать другой образ, например, spec.containers.image:{httpd,nginx} - поды работают корректно (Running).