0

I am trying to deploy on a minimal cluster and failing

enter image description here

How can I tweak the configuration to make the availability green?

My Input:

My application is a spring- angular (please suggest an easy way where I can deploy both)

My docker-compose created 2 containers. I pushed them to registry (tagged)

When deploying in Workload, I added 1 container after another, and clicked Deploy. The result error is above

Is there a file I need to create - a kind of yml or yaml etc?

kubectl get pods



> NAME                       READY   STATUS             RESTARTS   AGE
> nginx-1-d...7-2s6hb   0/2     CrashLoopBackOff   18         25m
> nginx-1-6..d7-7645w   0/2     CrashLoopBackOff   18         25m
> nginx-1-6...7-9qgjx   0/2     CrashLoopBackOff   18         25m

Events from describe

Events:
  Type     Reason     Age                   From               Message
  ----     ------     ----                  ----               -------
  Normal   Scheduled  17m                   default-scheduler  Successfully assigned default/nginx-1-5d...56xp4 to gke-cluster-huge-default-pool-b6..60-4rj5
  Normal   Pulling    17m                   kubelet            Pulling image "eu.gcr.io/p..my/py...my_appserver@sha256:479bf3e12ee2b410d730...579b940adc8845be74956f5"
  Normal   Pulled     17m                   kubelet            Successfully pulled image "eu.gcr.io/py..my/py...emy_appserver@sha256:479bf3e12ee2b4..8b99a178ee05e8579b940adc8845be74956f5" in 11.742649177s
  Normal   Created    15m (x5 over 17m)     kubelet            Created container p..my-appserver-sha256-1
  Normal   Started    15m (x5 over 17m)     kubelet            Started container p..emy-appserver-sha256-1
  Normal   Pulled     15m (x4 over 17m)     kubelet            Container image "eu.gcr.io/py...my/pya...my_appserver@sha256:479bf3e12ee2b41..e05e8579b940adc8845be74956f5" already present on machine
  Warning  BackOff    2m42s (x64 over 17m)  kubelet            Back-off restarting failed container
Pit
  • 736
  • 3
  • 17
Kris Swat
  • 788
  • 1
  • 10
  • 39
  • Hi there! CrashLoopBackOff can mean a lot of things. Can you please share with us the `kubectl describe pod ` – Armando Cuevas Jul 13 '21 at 18:56
  • Do you have billing enabled? You will find that some quotas are at 0 or at the limit if billing is not enabled which means that some resources cannot be created. Check your project: https://console.cloud.google.com/iam-admin/quotas – John Hanley Jul 13 '21 at 19:06
  • John - 1 of 28 quotas are reaching limit - Compute Engine API . @Armando It is a big race, and added events – Kris Swat Jul 13 '21 at 19:13
  • ```Warning BackOff 2m42s (x64 over 17m) kubelet Back-off restarting failed container``` the error is about your container. What ever is happening, is caused by your container not being able to run. Do you have Readiness probes set to your deployment? – Armando Cuevas Jul 13 '21 at 20:44
  • what is Readiness probe? – Kris Swat Jul 13 '21 at 20:48
  • From the last 10 days, i was thinking that I will succeed deploying, but kept on switching from 1 to another. Move db to cloud sql, Cloud Run for Spring,(worked connecting to db), then had to get UI , so used docker-compose...now unable to deploy in GKE. After this, I do not know if nginx will be able to direct api calls to spring or not. hufff. DOnt understand how cpu can be 40% when nothing is happening...and there was a peak of 150. Its crazy – Kris Swat Jul 13 '21 at 20:56
  • But your issue has nothing to do with resources. The issue is that something inside NGINX is not correct. Are you using config maps to configue NGINX? About rediness probes you can red more about [here](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) – Armando Cuevas Jul 13 '21 at 22:19
  • If your problem was about resources, you will see [evictions](https://stackoverflow.com/questions/46419163/what-will-happen-to-evicted-pods-in-kubernetes) and that’s not the case. – Armando Cuevas Jul 13 '21 at 22:22
  • Looks like I need to create a secret for DB using kubectl – Kris Swat Jul 14 '21 at 00:02
  • Please review it from [Managing Secrets using kubectl](https://kubernetes.io/docs/tasks/configmap-secret/managing-secret-using-kubectl/) ```kubectl create secret generic db-user-pass \ --from-file=./username.txt \ --from-file=./password.txt``` – Pit Jul 14 '21 at 08:34
  • You may find useful to check [CrashLoopBackOff issue](https://stackoverflow.com/questions/41604499/my-kubernetes-pods-keep-crashing-with-crashloopbackoff-but-i-cant-find-any-lo) in order to learn investigate further. Please share the output from ```kubectl -n logs -p ``` – Pit Jul 14 '21 at 09:48
  • Where you able to solve the issue @KrisSwat? I faced similar situation. If I deploy a plain nginx:latest image, I can get 3 pods up and running. If I deploy an application (my case, gitlab-runner) I get similar error of availability. – Sirode Aug 18 '21 at 02:21
  • @Sirode I no longer use GKE. I bundled angular into my spring and deployed war to AppEngine – Kris Swat Aug 19 '21 at 21:24

0 Answers0