Deploy Voting App on Kubernetes

HI Team/All ,

@Ayman @mmumshad @Tej-Singh-Rana @Inderpreet @rahul456 @ko

I did not click the finish button or refresh but my task session got closed automatically within 10 mins after starting it, now my task showing as failed.
can you please move the task to pending state please.

please check this

hi @sunthar, sorry for the issue, this is marked pending for you, please give it an another try.

1 Like

Many thanks, @rahul456 for your prompt response.
:+1: :+1: :handshake:


Hello @everyone
@Ayman @Tej-Singh-Rana

I need help related to this error that is putting a hole in my brain…
I have tried several changes to fix the error and nothing happens and it should be simple, but I can’t

I’ve focused only in 2 components, since there forward everything would run okay

Attach images and yaml

1)

apiVersion: v1
kind: Namespace
metadata:
name: vote
/----

2)

apiVersion: apps/v1
kind: Deployment
metadata:
name: db-deployment
namespace: vote
labels:
name: db
app: kkevoteapp
spec:
replicas: 1
selector:
matchLabels:
name: db
app: kkevoteapp
template:
metadata:
labels:
name: db
app: kkevoteapp
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”
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: db-data
ports:
- containerPort: 5432
volumes:
- name: db-data
emptyDir: {}
/—

3)

apiVersion: v1
kind: Service
metadata:
name: db
namespace: vote
labels:
name: db
app: kkevoteapp
spec:
type: ClusterIP
selector:
name: db
app: kkevoteapp
ports:
- port: 5432
targetPort: 5432
/—

4)

apiVersion: apps/v1
kind: Deployment
metadata:
name: worker
namespace: vote
spec:
replicas: 1
selector:
matchLabels:
name: worker-deployment
app: kkevoteapp
template:
metadata:
labels:
name: worker-deployment
app: kkevoteapp
spec:
containers:
- name: worker
image: “kodekloud/examplevotingapp_worker”

Hello, @juancgarciaco
Are you still facing the issue?

My task expired, I wait my next turn

My task failed. Saying exposed service endpoint: vote-deployment.
Please check the below configuration:

apiVersion: v1
kind: Namespace
metadata:
name: vote


apiVersion: v1
kind: Service
metadata:
name: vote-service
namespace: vote
labels:
name: vote-service
app: voting-app
spec:
type: NodePort
selector:
name: vote-deployment
app: voting-app
ports:

  • port: 5000
    targetPort: 80
    nodePort: 31000

apiVersion: apps/v1
kind: Deployment
metadata:
name: vote-deployment
namespace: vote
labels:
app: voting-app
name: vote-deployment
spec:
replicas: 1
selector:
matchLabels:
app: voting-app
template:
metadata:
labels:
app: voting-app
spec:
containers:
- name: vote
image: kodekloud/examplevotingapp_vote:before
ports:
- containerPort: 80


apiVersion: v1
kind: Service
metadata:
name: redis
namespace: vote
spec:
type: ClusterIP
selector:
app: voting-app
name: redis-deployment
ports:
- name: client
port: 6379
targetPort: 6379


apiVersion: apps/v1
kind: Deployment
metadata:
name: redis-deployment
namespace: vote
labels:
app: voting-app
name: redis-deployment
spec:
replicas: 1
selector:
matchLabels:
app: voting-app
template:
metadata:
labels:
app: voting-app
spec:
containers:
- name: redis
image: redis:alpine
volumeMounts:
- name: redis-data
mountPath: /data
volumes:
- name: redis-data
emptyDir: {}


apiVersion: apps/v1
kind: Deployment
metadata:
name: worker
namespace: vote
labels:
app: voting-app
name: worker
spec:
replicas: 1
selector:
matchLabels:
app: voting-app
template:
metadata:
labels:
app: voting-app
spec:
containers:
- name: worker
image: kodekloud/examplevotingapp_worker


apiVersion: v1
kind: Service
metadata:
name: db
namespace: vote
labels:
name: db
app: voting-app
spec:
type: ClusterIP
selector:
app: voting-app
name: db-deployment
ports:

  • port: 5432
    targetPort: 5432

apiVersion: apps/v1
kind: Deployment
metadata:
name: db-deployment
namespace: vote
labels:
app: voting-app
name: db-deployment
spec:
replicas: 1
selector:
matchLabels:
app: voting-app
template:
metadata:
labels:
app: 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
volumeMounts:
- name: db-data
mountPath: /var/lib/postgresql/data
volumes:
- name: db-data
emptyDir: {}


apiVersion: apps/v1
kind: Deployment
metadata:
name: result-deployment
namespace: vote
labels:
app: voting-app
name: result-deployment
spec:
replicas: 1
selector:
matchLabels:
app: voting-app
template:
metadata:
labels:
app: voting-app
spec:
containers:
- name: result
image: kodekloud/examplevotingapp_result:before
ports:
- containerPort: 80


apiVersion: v1
kind: Service
metadata:
name: result-service
namespace: vote
labels:
name: result-service
app: voting-app
spec:
type: NodePort
selector:
app: voting-app
name: result-deployment
ports:

  • port: 5001
    targetPort: 80
    nodePort: 31001

hi @Mederbek, sorry for the issue, marked pending for you, please give it an another try.

@rahul456 please mark it pending again, my messages in review section are disappearing.

hi @Mederbek, seems like you have completed your task.

1 Like

Yes, thank you. @rahul456