CrashLoopBackOff error when running worker-app-pod

Hi,
I was able to run all the pod except the worker pod. getting the below error:

NAME READY STATUS RESTARTS AGE
pod/db-app-pod 1/1 Running 0 3m1s
pod/redis-app-pod 1/1 Running 0 91s
pod/result-app-pod 1/1 Running 1 16m
pod/voting-app-pod 1/1 Running 0 16m
pod/worker-app-pod 0/1 CrashLoopBackOff 2 41s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/db ClusterIP 10.97.247.97 5432/TCP 2m49s
service/kubernetes ClusterIP 10.96.0.1 443/TCP 8d
service/redis ClusterIP 10.97.13.209 6379/TCP 13m
service/result-service NodePort 10.105.162.193 80:30005/TCP 13m
service/voting-service NodePort 10.110.200.160 80:30004/TCP 13m

using “kubectl describe pod worker-app-pod” :

Name: worker-app-pod
Namespace: default
Priority: 0
Node: minikube/192.168.99.101
Start Time: Wed, 26 Aug 2020 22:14:08 +0530
Labels: app=demo-voting-app
name=worker-app-pod
Annotations: Status: Running
IP: 172.17.0.5
IPs:
IP: 172.17.0.5
Containers:
worker-app:
Container ID: docker://b80a62e8827abe7bfe1413d15efdeff3145fe9563fdb765bd736ce049a3a013b
Image: shivansh123321/worker
Image ID: docker-pullable://shivansh123321/worker@sha256:c364804d835e9ca3d5966b5a3ac4efdc73e570de070474e052d3cb4f0766f10a
Port:
Host Port:
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: Error
Exit Code: 1
Started: Wed, 26 Aug 2020 22:17:21 +0530
Finished: Wed, 26 Aug 2020 22:17:22 +0530
Ready: False
Restart Count: 5
Environment:
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-dzm7w (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
default-token-dzm7w:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-dzm7w
Optional: false
QoS Class: BestEffort
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message


Normal Scheduled 4m47s default-scheduler Successfully assigned default/worker-app-pod to minikube
Normal Created 3m54s (x4 over 4m43s) kubelet, minikube Created container worker-app
Normal Started 3m54s (x4 over 4m43s) kubelet, minikube Started container worker-app
Warning BackOff 3m24s (x7 over 4m37s) kubelet, minikube Back-off restarting failed container
Normal Pulling 3m10s (x5 over 4m46s) kubelet, minikube Pulling image “shivansh123321/worker”
Normal Pulled 3m8s (x5 over 4m43s) kubelet, minikube Successfully pulled image “shivansh123321/worker”

Please let me know what is the issue?
Thank you

Hello, @Shivansh123321
What is the image you choose? Just to deploy only image is not enough. You have to write some code to make it container alive after pulling your image.

Hi @player001 ,

I used the image mentioned in the video :
source: https://github.com/dockersamples/example-voting-app.
I build the images and pushed them to my docker hub repo.

I was able to get the voting app screen and result app screen up with port:30004 and 30005 respectively but there is problem with the worker app .as I am always getting CrashLoopBackOff msg.
due to this, the data is not being updated in the Postgres database.