Asking for help? Comment out what you need so we can get more information to help you!
Cloud being used: (put bare-metal if not on a public cloud)
Host OS: OSX
CNI and version: no idea
CRI and version: no idea
Deploy I ran
kubectl apply -f web_deployment.yml was on this file:
--- apiVersion: apps/v1 kind: Deployment metadata: name: web spec: replicas: 3 selector: matchLabels: app: web strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 minReadySeconds: 5 template: metadata: labels: app: web spec: containers: - name: laravel image: smart48/smt-laravel:latest ports: - containerPort: 9000 resources: requests: cpu: 250m limits: cpu: 500m - name: nginx image: smart48/smt-nginx:latest ports: - containerPort: 80 --- apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: web spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: web minReplicas: 3 maxReplicas: 20 targetCPUUtilizationPercentage: 50 --- apiVersion: v1 kind: Service metadata: name: loadbalancer spec: type: LoadBalancer ports: - port: 80 selector: app: web
Then I checked the pods
kubectl get po --namespace default NAME READY STATUS RESTARTS AGE web-848fb4c7dc-5m2fp 1/2 CrashLoopBackOff 8 21m web-848fb4c7dc-ffv7n 1/2 CrashLoopBackOff 8 21m web-848fb4c7dc-mg65j 1/2 CrashLoopBackOff 8 21m
kubectl describe po web-848fb4c7dc-5m2fp showed me
vents: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 22m default-scheduler Successfully assigned default/web-848fb4c7dc-5m2fp to minikube Normal Pulling 22m kubelet, minikube Pulling image "smart48/smt-laravel:latest" Normal Pulled 21m kubelet, minikube Successfully pulled image "smart48/smt-laravel:latest" Normal Created 21m kubelet, minikube Created container laravel Normal Started 21m kubelet, minikube Started container laravel Normal Pulling 20m (x4 over 21m) kubelet, minikube Pulling image "smart48/smt-nginx:latest" Normal Pulled 20m (x4 over 21m) kubelet, minikube Successfully pulled image "smart48/smt-nginx:latest" Normal Created 20m (x4 over 21m) kubelet, minikube Created container nginx Normal Started 20m (x4 over 21m) kubelet, minikube Started container nginx Warning BackOff 2m23s (x86 over 21m) kubelet, minikube Back-off restarting failed container
Now I think there may be something wrong with the
yml or the images. But how can I figure that out? Does anyone see issues with the yaml here? The images are Laradock PHP FPM and Nginx and they built fine and are publicly accessible on Docker Hub so no idea what the issue is here…
This message says that it is in a
Back-off restarting failed container . This most likely means that Kubernetes started your container, then the container subsequently exited. As we all know, the Docker container should hold and keep pid 1 running or the container exits. When the container exits, Kubernetes will try to restart it. After restarting it a few times, it will declare this
BackOff state. However, Kubernetes will keep on trying to restart it.
source Managed Kube
So perhaps it is the image then?