Worker app in examplevoting lab is not coming up(crashloopback) in absolute beginners course

how can we make it up and running
padhisrikanth@master:~/CKA/CKA/example_votingapp/k8s-specifications$ kubectl get pods,svc -n votingapp
NAME READY STATUS RESTARTS AGE
pod/postgres-deploy-54cd495b8-6gkxs 1/1 Running 0 9m16s
pod/redis-deploy-c747f8f64-kmhfg 1/1 Running 0 8m48s
pod/result-app-deploy-d8b8bb466-457zc 1/1 Running 0 9m39s
pod/voting-app-deploy-6f449bdf75-5kldq 1/1 Running 0 10m
pod/worker-app-deploy-d84fddf59-jztrs 0/1 CrashLoopBackOff 6 (2m10s ago) 8m56s

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/db ClusterIP 10.110.169.15 5432/TCP 9m9s
service/redis ClusterIP 10.108.34.185 6379/TCP 8m42s
service/result-service LoadBalancer 10.107.81.76 80:31151/TCP 9m28s
service/voting-service LoadBalancer 10.111.171.243 80:30294/TCP 9m50s
padhisrikanth@master:~/CKA/CKA/example_votingapp/k8s-specifications$

padhisrikanth@master:~/CKA/CKA/example_votingapp/k8s-specifications$ kubectl logs worker-app-deploy-d84fddf59-jztrs -n votingapp
System.NotSupportedException: Authentication method not supported (Received: 10)
at Npgsql.NpgsqlConnector.ParseServerMessage(ReadBuffer buf, BackendMessageCode code, Int32 len, DataRowLoadingMode dataRowLoadingMode, Boolean isPrependedMessage)
at Npgsql.NpgsqlConnector.DoReadMessage(DataRowLoadingMode dataRowLoadingMode, Boolean isPrependedMessage)
at Npgsql.NpgsqlConnector.ReadMessageWithPrepended(DataRowLoadingMode dataRowLoadingMode)
at Npgsql.NpgsqlConnector.HandleAuthentication(String username, NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.ConnectorPool.Allocate(NpgsqlConnection conn, NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnection.OpenInternal()
at Worker.Program.OpenDbConnection(String connectionString) in /code/src/Worker/Program.cs:line 78
at Worker.Program.Main(String[] args) in /code/src/Worker/Program.cs:line 19
padhisrikanth@master:~/CKA/CKA/example_votingapp/k8s-specifications$
padhisrikanth@master:~/CKA/CKA/example_votingapp/k8s-specifications$
padhisrikanth@master:~/CKA/CKA/example_votingapp/k8s-specifications$

1 Like

Hello @padhisrikanth,
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.

  1. Run git clone https://github.com/mmumshad/example-voting-app-kubernetes-v2.git

  2. Run cd example-voting-app-kubernetes-v2/

  3. 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
  1. Run kubectl create -f . if you create deployments for the first time, if you created the same deployments before Run kubectl apply -f . .

  2. 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,
KodeKloud Support

1 Like

Thank you, its working now

You are welcome.
Happy learning!