![No se puede iniciar el pod de Busybox](https://rvso.com/image/776323/No%20se%20puede%20iniciar%20el%20pod%20de%20Busybox.png)
Si inicio un pod de Kubernetes como este, falla:
k run bb --image=busybox
k describe pod bb
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Pulling 14m (x35 over 164m) kubelet Pulling image "busybox"
Warning BackOff 4m23s (x736 over 164m) kubelet Back-off restarting failed container
¿Cuál es la razón?
Los run
comandos funcionan bien para la nginx
imagen.
Respuesta1
busybox
no es un servidor. No inicia el ciclo interminable de "escuchar entradas".
Lo mismo ocurre con la alpine
imagen.
Pero puedes crear un bucle sin fin como este:
apiVersion: v1
kind: Pod
metadata:
name: bb
spec:
containers:
- image: busybox
command: ['sh', '-c', 'while true; do date; sleep 3; done']
name: bb
k apply -f bb.yaml
k describe pod bb
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 6s default-scheduler Successfully assigned default/bb to minikube-m02
Normal Pulling 5s kubelet Pulling image "busybox"
Normal Pulled 3s kubelet Successfully pulled image "busybox" in 2.256262371s
Normal Created 3s kubelet Created container bb
Normal Started 3s kubelet Started container bb
Y puedes ver los registros:
guettli@p15:~/.kube$ k logs bb
Fri Apr 8 20:38:30 UTC 2022
Fri Apr 8 20:38:33 UTC 2022
Fri Apr 8 20:38:36 UTC 2022