This project demonstrates deploying a simple client-server application on both virtual machines (VMs) and a Kubernetes cluster. The application converts user input text into ASCII art.
- Server:
- Listens on a specific port and processes client requests.
- Responds with ASCII art for the provided text.
- Client:
- Sends requests to the server and displays the ASCII art.
- Setup:
- Two VMs running Fedora/RHEL, networked within the same hypervisor.
- Manual configuration for dependencies and application deployment.
- Server:
- Scaled dynamically using Kubernetes deployments.
- Exposed as a
ClusterIP
service for internal cluster communication.
- Client:
- Configured via a
ConfigMap
to communicate with the server service. - Exposed to external users via a
NodePort
service.
- Configured via a
Advantages:
- Simple setup, suitable for basic environments.
- No need for advanced tools like Kubernetes.
- Direct control over system resources and configurations.
Disadvantages:
- Manual scaling and monitoring.
- Complex networking setup for inter-VM communication.
- Difficult to manage in large-scale production environments.
Advantages:
- Automated scaling and self-healing for server pods.
- Simplified networking using DNS-based service discovery.
- Easily integrates with CI/CD pipelines and modern DevOps practices.
Disadvantages:
- Requires a Kubernetes cluster setup, which adds complexity.
- Higher learning curve for beginners.
- VM Setup:
- Provisioned two Fedora VMs and ensured they were networked together.
- Application Deployment:
- Installed necessary dependencies (
figlet
, Python Flask). - Deployed the server on one VM and the client on the other.
- Installed necessary dependencies (
- Verification:
- Tested the interaction using hostname-based communication.
- Containerization:
- Created Docker/Podman images for client and server applications.
- Pushed images to Quay.io.
- Kubernetes Cluster:
- Set up a Minikube cluster.
- Server Deployment:
- Created a deployment for the server.
- Configured the server using a
ConfigMap
. - Exposed it as a
ClusterIP
service.
- Client Deployment:
- Created a deployment for the client.
- Configured the client using a
ConfigMap
. - Exposed the client via a
NodePort
service.
- Scaling:
- Increased the server replica count and verified load distribution.
- Verification:
- Used the browser and
curl
to test client-server interaction.
- Used the browser and
Dockerfiles
for client and server.- Kubernetes manifests:
- Deployments and services for client and server.
- ConfigMap for client configuration.
- Logs demonstrating successful client-server communication for both VM and Kubernetes setups.
- Screenshots of browser-based client interaction and Kubernetes dashboard.
To deploy the application locally on your Kubernetes cluster, follow these steps:
- Navigate to the
manifests
directory:cd manifests
- Apply the Kubernetes manifests:
kubectl apply -f manifests/config-map.yaml kubectl apply -f manifests/client-deployment.yaml kubectl apply -f manifests/server-deployment.yaml
- To view the ip of your application:
kubectl get nodes -o wide
- Locate the EXTERNAL-IP column in the output.
- Access the client in your browser::
http://<EXTERNAL IP>:30001
You can verify the application using a test job:
- Apply the test job manifest:
kubectl apply -f manifests/test-job.yaml
- List all pods to find the test job pod name:
kubectl get pods
- Look for a pod with the name test-job-.
- Check the logs of the test job pod:
kubectl logs test-job-<random-string>
- Replace with the actual suffix of the test job pod.
- The logs will indicate whether the test passed.
This exercise highlights the evolution from VM-based application deployment to a scalable and modern Kubernetes-based setup. While VMs provide simplicity for smaller use cases, Kubernetes excels in scalability, automation, and production-readiness.