This project demonstrates the deployment of a simple web application using Docker and Kubernetes on a Linode Kubernetes cluster.
├── webapp/
│ ├── index.html # Web application HTML file
│ ├── Dockerfile # Dockerfile to build the web application container
├── hacluster-deployment.yaml # Kubernetes deployment manifest for HACluster
├── hacluster-service.yaml # Kubernetes service manifest for HACluster
├── templates/
│ ├── deployment.yaml # Template for Kubernetes deployment manifest
│ ├── service.yaml # Template for Kubernetes service manifest
└── README.md # Documentation
In docs you can find additional screenshots ande documentation. The folder linodeToken contains the hacluster-kubeconfig.yaml from Linode and is not to be shared.
- A Linode Kubernetes cluster.
- Docker installed locally for building the Docker image.
- Kubernetes CLI (
kubectl) configured to manage your Linode Kubernetes cluster. - Access to a container registry (e.g., Docker Hub or Linode Container Registry).
-
Navigate to the
webappdirectory:cd webapp -
Build the Docker image:
docker build -t <your-registry-username>/hacluster:v1.0 .
-
Push the image to your container registry:
docker push <your-registry-username>/hacluster:v1.0
- Update the
imagefield inhacluster-deployment.yamlwith the correct image tag:image: <your-registry-username>/hacluster:v1.0
-
Apply the deployment manifest:
kubectl apply -f hacluster-deployment.yaml
-
Apply the service manifest:
kubectl apply -f hacluster-service.yaml
-
Check the status of the deployment:
kubectl get deployments
-
Check the status of the service:
kubectl get services
-
Access the web application using the external IP provided by the service:
kubectl get service hacluster-service
Look for the
EXTERNAL-IPfield in the output and navigate tohttp://<EXTERNAL-IP>in your browser.
The templates folder contains reusable Kubernetes manifest templates. These can be customized for other deployments.
deployment.yaml: A template for Kubernetes deployments.service.yaml: A template for Kubernetes services.
- The current setup includes a deployment with 3 replicas to ensure high availability.
- The default Docker image tag
v1.0targets ARM architecture. You can update this tov2.0for x86 architecture orlatestas needed.
To remove the deployed resources, run:
kubectl delete -f hacluster-deployment.yaml
kubectl delete -f hacluster-service.yamlThis project is open source and available under the MIT License.