AWS Builder Center
Deploying a Microservices Voting Application on Amazon EKS: From Kubernetes Pods to Deployments

Deploying a Microservices Voting Application on Amazon EKS: From Kubernetes Pods to Deployments

In this hands-on project, I built and deployed a microservices-based Voting Application on Amazon EKS. I implemented the application using Kubernetes Pods and then Deployments to understand scaling, replica management, self-healing, and Services. The project includes Voting App, Redis, Worker, PostgreSQL, and Result App. I also configured an EKS cluster using eksctl and practiced Kubernetes networking, deployment, monitoring, and troubleshooting.

From Kubernetes Pods to Deployments: Building a Voting Application on Amazon EKS

Introduction

As part of my hands-on learning in AWS and DevOps, I worked on a Kubernetes-based microservices project and deployed it on Amazon Elastic Kubernetes Service (Amazon EKS).
The main goal of this project was not only to deploy an application, but also to understand how Kubernetes manages application workloads, networking, scaling, and availability.
I implemented the application in two stages:
  1. Deploying the application using individual Kubernetes Pods
  1. Migrating the application to Kubernetes Deployments
This approach helped me understand the practical difference between directly creating Pods and using Kubernetes controllers to manage application workloads.



Project Architecture

The application is a microservices-based Voting Application consisting of five main components:
  • Voting App
  • Redis
  • Worker
  • PostgreSQL
  • Result App
The basic application flow is:
User → Voting App → Redis → Worker → PostgreSQL → Result App → User
The Voting App accepts votes from users and places the vote data into Redis. The Worker processes the data and stores the required information in PostgreSQL. The Result App reads the stored information and presents the voting results.
For external access, I used Kubernetes LoadBalancer Services, while internal components communicate through ClusterIP Services.



Amazon EKS Setup

For the cloud environment, I created an Amazon EKS cluster using  eksctl .
The command I used was:
eksctl create cluster --name somesh --nodegroup-name Tarra --nodes 4 --node-type t2.medium --managed

The main configuration was:
Configuration
Value
Cluster Name
somesh
AWS Region
us-east-1
Node Group
Tarra
Worker Nodes
4
Instance Type
t2.medium
Node Group
Managed
Kubernetes Version
1.34
After the cluster was created, I configured  kubectl  to communicate with the EKS cluster:
aws eks update-kubeconfig --region us-east-1 --name somesh

I then verified the worker nodes using:
kubectl get nodes

This was my first step toward running the application on a real managed Kubernetes environment rather than only using a local cluster.



Phase 1: Deploying the Application Using Pods

I started the project by creating individual Kubernetes Pods.
The Pod-based project contains YAML files for the application and its Services:
miniproject-with-pod/
├── 1-voting-app.yaml
├── 2-voting-server.yaml
├── 3-redis-app.yaml
├── 4-redis-server.yaml
├── 5-worker-app.yaml
├── 6-postgres-app.yaml
├── 7-postgres-server.yaml
├── 8-result-app.yaml
├── 9-result-server.yaml
└── Jenkinsfile

Each application component was represented by a Kubernetes Pod.
The main components were:
Voting App Pod → Redis Pod → Worker Pod → PostgreSQL Pod → Result App Pod
Kubernetes Services were used to provide stable communication between the components.
I deployed the resources using:
kubectl apply -f miniproject-with-pod/

Then I checked the resources:
kubectl get pods
kubectl get services
kubectl get all

This stage helped me understand the basic Kubernetes object structure and how Pods and Services work together.



What I Learned From the Pod-Based Approach

Working directly with Pods was useful for understanding Kubernetes fundamentals.
However, I also started to see some limitations.
If an application is directly represented by individual Pods, managing replicas, scaling, application updates, and maintaining a desired number of instances becomes an operational responsibility.
For a small learning environment, this approach is useful. For application workloads that need controlled scaling and lifecycle management, Kubernetes Deployments provide a better abstraction.
This became the reason for the second phase of the project.



Phase 2: Moving From Pods to Deployments

In the second phase, I created a Deployment-based version of the same application.
The folder contains:
miniproject-deployment-files/
├── 1-voting-deploy.yaml
├── 2-voting-server.yaml
├── 3-redis-deploy.yaml
├── 4-redis-server.yaml
├── 5-worker-deploy.yaml
├── 6-postgres-deploy.yaml
├── 7-postgres-server.yaml
├── 8-result-deployment.yaml
└── 9-result-server.yaml

Instead of creating application Pods directly, I used:
apiVersion: apps/v1
kind: Deployment

One of the important concepts I learned was the relationship between a Deployment, ReplicaSet, and Pod.
The basic structure is:
Deployment → ReplicaSet → Pods
For example, a Deployment configured with:
replicas: 3

instructs Kubernetes to maintain three Pods for that workload.
This is a major difference from manually creating individual Pods.



Labels and Selectors

Another important part of the project was understanding Kubernetes labels and selectors.
For example, a Deployment can define labels for its Pod template, while a Service uses a selector to identify the Pods to which traffic should be sent.
This means that the labels and selectors need to be configured consistently.
Understanding this relationship was especially useful when troubleshooting Service connectivity.
A simplified flow is:
Service → Selector → Matching Pod Labels → Application Container



Kubernetes Services

I used different types of Kubernetes Services based on the communication requirement.

ClusterIP

ClusterIP was used for internal application communication.
For example:
  • Redis Service
  • PostgreSQL Service
These components do not need to be directly exposed to users.

LoadBalancer

LoadBalancer Services were used for application components that need external access.
For example:
  • Voting App
  • Result App
This provides an external entry point while Kubernetes forwards traffic to the appropriate backend Pods.



Scaling With Deployments

One of the most useful demonstrations was scaling a Deployment.
For example:
kubectl scale deployment <deployment-name> --replicas=5

I could then verify the new Pods using:
kubectl get pods

This helped me understand how Kubernetes maintains the desired replica count.
I could also scale the application back down:
kubectl scale deployment <deployment-name> --replicas=3

This was much easier than manually creating or deleting individual Pods.



Self-Healing Demonstration

Another important Kubernetes concept I explored was self-healing through Deployments and their ReplicaSets.
After checking the running Pods:
kubectl get pods

I deleted one of the Pods:
kubectl delete pod <pod-name>

I then checked the Pods again:
kubectl get pods

The Deployment controller detects that the desired number of replicas is no longer available and creates a replacement Pod.
This experiment helped me understand why Deployments are useful for maintaining the desired state of an application.



Pod vs Deployment

The project gave me a practical way to compare Pods and Deployments.
Feature
Pod
Deployment
Runs containers
Yes
Yes
Replica management
No controller-level desired replica management
Yes
Scaling
Manual
Simple
Self-healing through controller
No
Yes
Rolling updates
No Deployment mechanism
Yes
Desired state
Limited
Yes
Application workload management
Basic
Better suited
The biggest takeaway for me was that a Pod is the basic execution unit, while a Deployment provides a higher-level mechanism for managing application Pods.



Troubleshooting

During the implementation, Kubernetes troubleshooting commands became an important part of the workflow.
Some commands I used were:
kubectl get pods
kubectl get deployments
kubectl get services
kubectl get rs
kubectl get all

For deeper investigation:
kubectl describe pod <pod-name>
kubectl describe deployment <deployment-name>
kubectl describe service <service-name>

For application logs:
kubectl logs <pod-name>

These commands helped me understand the current state of the cluster and identify configuration issues.



What I Learned

This project helped me move beyond just writing Kubernetes YAML files.
I gained practical experience with:
  • Amazon EKS
  • Kubernetes Pods
  • Deployments
  • ReplicaSets
  • Kubernetes Services
  • ClusterIP
  • LoadBalancer
  • Labels and selectors
  • Kubernetes networking
  • Replica management
  • Scaling
  • Pod replacement
  •  kubectl 
  •  eksctl 
  • Microservices architecture
  • AWS cloud infrastructure
The most valuable part was implementing the application first with Pods and then with Deployments. Seeing the difference through an actual application made the concepts much easier to understand.



Challenges and Observations

One of the main learning points was that Kubernetes configuration is highly dependent on relationships between resources.
For example, a Service may exist and still not route traffic correctly if its selector does not match the labels on the application Pods.
Similarly, changing from a Pod-based architecture to a Deployment-based architecture requires understanding how the Deployment selector and Pod template work together.
The EKS environment also helped me understand that Kubernetes is not just a local development tool. It involves cloud networking, worker nodes, AWS infrastructure, and Kubernetes resources working together.



Future Improvements

There are several areas I would like to explore further with this project:
  • Kubernetes Ingress
  • HTTPS/TLS
  • Kubernetes Secrets
  • ConfigMaps
  • Persistent Volumes
  • StatefulSets for stateful workloads
  • Resource requests and limits
  • Readiness and liveness probes
  • Horizontal Pod Autoscaler
  • Network Policies
  • Prometheus and Grafana monitoring
  • Jenkins CI/CD
  • Helm
  • GitOps with Argo CD
These would help take the project further toward a more production-oriented Kubernetes architecture.



Conclusion

This project gave me practical exposure to deploying a real multi-component application on Kubernetes and Amazon EKS.
Starting with individual Pods helped me understand the fundamentals. Moving the same workloads to Deployments showed me the advantages of desired-state management, replicas, scaling, and Pod replacement.
The project also gave me a better understanding of how Kubernetes Services connect microservices and how Amazon EKS provides a managed Kubernetes environment in AWS.
Overall, this was a valuable hands-on step in my journey toward building stronger skills in AWS, Kubernetes, Cloud, and DevOps.



Project Resources

The complete Kubernetes YAML files, architecture diagrams, screenshots, and detailed project documentation are available in my GitHub repository.
I plan to continue improving this project and explore more advanced Kubernetes and AWS services.
#AWS #AmazonEKS #Kubernetes #DevOps #CloudComputing #Docker #AWSCloud #KubernetesDeployment #CloudEngineering #LearningByDoing

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article