This repository contains a Helm chart and Docker setup for deploying the Tic-Tac-Toe application. The app can be tested using Docker, Minikube, and Helm to deploy it on a local Kubernetes cluster.
Before you begin, ensure you have the following tools installed:
- Docker
- Minikube
- kubectl
- Helm
If not, you can follow the official installation guides for these tools.
-
Build the Docker image with the following command:
docker build -t ajitirto/tic-tac-toe:2.0 -f Dockerfile.prod .
-
Run the Docker container:
docker run -p 3031:3000 ajitirto/tic-tac-toe:2.0
This will start the application on port
3000
inside the container and map it to port3031
on the host.
You can test the application by visiting http://localhost:3031
in your browser.
-
Start Minikube:
minikube start
This starts a local Kubernetes cluster using Minikube.
-
Apply the deployment and service manifests:
kubectl apply -f k8s/deployment.yaml kubectl apply -f k8s/service.yaml
This deploys the Tic-Tac-Toe application to the local Kubernetes cluster and exposes it as a service.
You can test the deployment by accessing the service through Minikube's IP and the NodePort:
-
Get the Minikube IP and NodePort:
curl http://$(minikube ip):$(kubectl get svc tic-tac-toe-service -o=jsonpath='{.spec.ports[0].nodePort}')
-
If you are using Ingress for routing, update your
/etc/hosts
file:echo "$(minikube ip) tic-tac-toe.local" | sudo tee -a /etc/hosts
-
Finally, access the app via the Ingress URL:
curl http://tic-tac-toe.local
-
Lint the Helm chart to check for any issues:
helm lint helm/
-
Install the Helm chart to deploy the application in Kubernetes:
helm install tic-tac-toe helm/
This will install the Tic-Tac-Toe application as a release called
tic-tac-toe
.
-
Check the status of the Helm deployment:
helm list
You should see the
tic-tac-toe
release listed with the statusdeployed
.
.
├── k8s/
│ ├── deployment.yaml # Kubernetes Deployment manifest
│ └── service.yaml # Kubernetes Service manifest
├── helm/
│ ├── Chart.yaml # Helm Chart metadata
│ ├── values.yaml # Helm values for customization
│ ├── deployment.yaml # Helm Deployment template
│ ├── ingress.yaml # Helm Ingress template
│ └── service.yaml # Helm Service template
├── Dockerfile.prod # Dockerfile for production build
└── README.md # This documentation
You can deploy and test the Tic-Tac-Toe application locally using Docker, Minikube, or Helm on Kubernetes. This allows for flexible development and testing environments depending on your needs.
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh