Hi Shivansh did you get a fix for your problem as I am getting the same issue
@Ayman Could you please give more details about this change on the postgress manifest? Why keep the user and password if Iâm passing the POSTGRES_HOST_AUTH_METHOD as âtrustâ?
There was a problem in the worker app original image and this was a workaround to add both credential methods so that the voting app works fine.
But for now, this issue is resolved, and using POSTGRES_HOST_AUTH_METHOD without adding the password will work fine.
Kindly clarify which modification you have done with?
Sorry, I had unintentionally modified the Redisâ ports. Problem solved. Thank you very much.
With pleasure and happy learning
For me adding in env: POSTGRES_HOST_AUTH_METHOD value: trust
in postgres pod worked finally
getting error âCrashLoopBackOffâ in creating pods for worker app. although my all the other 4 aps are installed and running fine.
Hello @deovrat.dubey,
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
git clone https://github.com/mmumshad/example-voting-app-kubernetes-v2.git
-
Run
cd example-voting-app-kubernetes-v2/
-
Run
vim postgres-deployment.yml
and modify itâs content as below then save and exit.
Note: Itâs a new update from Postgres.
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres-deployment
labels:
app: demo-voting-app
spec:
replicas: 1
selector:
matchLabels:
name: postgres-pod
app: demo-voting-app
template:
metadata:
name: postgres-pod
labels:
name: postgres-pod
app: demo-voting-app
spec:
containers:
- name: postgres
image: postgres:9.4
env:
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: postgres
- name: POSTGRES_HOST_AUTH_METHOD
value: trust
ports:
- containerPort: 5432
-
Run
kubectl create -f .
if you create deployments for the first time, if you created the same deployments before Runkubectl 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.
Check :
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.
Hope this helps!
Thanks,
KoudKloud Support
HI Ayman, you might be suggesting me for Deploying microservices using Deployments.
but i want to deploy microservice via installing pods and services manually one by one. in this case all the services and pods are installed and running except the worker pod which is giving the error can you provide me the solution and reason for this case.
One ore thing i canât see you are making any changes to worker node pod, which is where i am facing the issue.
Because the worker canât authenticate with the postgress service so we update the postgress YAML file to make the authentication works correctly and avoid falling into a loop.
Because the worker canât authenticate with the postgress service so we update the postgress YAML file to make the authentication works correctly and avoid falling into a loop.
great now it is working. But how to diagnose this issue like the pod which is giving error is not having the issue and the other pod which is running fine is causing the issue.
Thanks, this works now after making this change
all pods are runing well.
check this github repo
Thank you !!! this fixed the issue
Adding this to the postgres-pod.yaml file fixed the issue for me as well.