voting-app.
Prerequisites:
- Minikube or a Kubernetes cluster
- kubectl configured to target your cluster
- Files saved under the
voting-appdirectory
- Source for the sample images: dockersamples/example-voting-app
- Kubernetes docs: https://kubernetes.io/docs/
Pod manifests
Create the following Pod YAML files inside thevoting-app directory.
Voting app Pod (voting-app-pod.yaml)

Using plain text environment variables for database credentials is convenient for demos, but in production you should store credentials in Kubernetes Secrets or a vault solution.
Service manifests
Create Services to expose the Pods. Redis and Postgres use internal ClusterIP Services. The frontends are exposed via NodePort so they are accessible from your host/Minikube. Redis Service (redis-service.yaml)db)
Resources summary
Apply manifests and verify
From thevoting-app directory (where all YAML files are saved), apply the manifests in the following recommended order (frontend first, then datastore services, then worker, then result frontend):
Example file listing
Access the frontends (Minikube)
If using Minikube, get accessible URLs:- Voting frontend records votes in Redis.
- Worker reads votes from Redis and writes aggregates into Postgres.
- Result frontend reads aggregated totals from Postgres and displays them.
- Verify Postgres env variables (POSTGRES_USER, POSTGRES_PASSWORD) match what worker/result expect.
- Ensure Service selectors match Pod labels exactly.
Conclusion
You have successfully deployed the multi-tier voting application to Kubernetes:- Created Pods for voting, result, redis, postgres, and worker.
- Provided ClusterIP services for internal components (redis, db).
- Exposed frontends via NodePort services (voting and result).
- Verified end-to-end behavior by casting votes and viewing results.