Amr El-sheikh:
hello,
i have a problem in running voting-app-demo as it was in the kubernetes for absolute beginner course
i made all the yaml files as it was in the demo and i published the services also i open voting and result apps in browser and they work but when i click on cats or dogs to vote the page showed me an error " Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. "
can anyone help me with this errorplease ?
Mohamed Ayman:
Hello,
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|https://github.com/mmumshad/example-voting-app-kubernetes-v2.git
- Run cd example-voting-app-kubernetes-v2/
- Run vim postgres-deployment.ymland 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
- name: POSTGRES_USER
- name: postgres
- 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.
Hope this helps!
Amr El-sheikh:
thanks a lot Mohamed!
i have tried your steps and now it is working.
Thank you again for your efforts.