I am trying to do this where I create the cluster and use the deployment file. For some reason the worker-deployment fails and the event states the following Container image “kodekloud/examplevotingapp_worker:v1” already present on machine. Can someone help ?
Any help or assistance would be greatly appreciated.
Please follow these full steps to know what you have missed and try again :
Note: We will create deployments again so please before following the steps, Run kubectl delete deployment --all to delete old deployments and avoid any conflicts.
Run kubectl create -f . if you create deployments for the first time, if you created the same deployments before Run kubectl apply -f . .
Run kubectl get service to get the exposed ports.
For example if the output of the command as above you can accces the voting app by hitting One_of_the_worker_nodes_IP:32733 on your browser and the same for the resulting app >> One_of_the_worker_nodes_IP:30013.
Note: The voting application only accepts one vote per client. It does not register votes if a vote has already been submitted from a client.
So i deleted all deployment as suggested. Made the necessary changes on the postgres deployment file. When I do a deployment get all command they show up but its not on a ready states. Please see below.
oot@Datix2021:/home/example-voting-app-kubernetes-v2# kubectl get deployments,svc
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/postgres-deployment 0/1 1 0 23s
deployment.apps/redis-deployment 0/1 1 0 71s
deployment.apps/voting-app-deployment 2/3 3 2 2m10s
deployment.apps/worker-app-deployment 0/3 3 0 12s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/db ClusterIP 10.100.111.33 5432/TCP 18s
service/kubernetes ClusterIP 10.100.0.1 443/TCP 3m52s
service/redis ClusterIP 10.100.97.198 6379/TCP 60s
service/voting-service LoadBalancer 10.100.85.255 a2e864e2c695841da8737fb05ee64a92-1670468843.us-east-2.elb.amazonaws.com 80:32097/TCP 116s
root@Datix2021:/home/example-voting-app-kubernetes-v2#