Guillaume B.B. Van Hemmen
8ed8495f92
Introduced a new deployment for the whoami application using Kubernetes. The deployment includes a Namespace, Deployment, Service, and Ingress configured for external access at whoami.van-hemmen.com. Updated the README with detailed setup instructions and troubleshooting steps. |
||
---|---|---|
deployment.yaml | ||
LICENSE | ||
README.md |
Whoami Kubernetes Deployment
This project provides a Kubernetes Deployment for the whoami
application using
the traefik/whoami
container. It creates all the necessary resources (
Deployment, Service, and Ingress) to expose the application at
whoami.van-hemmen.com
via Traefik.
Deployment Steps
Follow the steps below to deploy the whoami
application:
1. Apply the Configuration
Ensure the deployment.yaml
file is available, then apply it as follows:
kubectl apply -f deployment.yaml
This will create:
- A namespace
whoami
for all application resources. - A Deployment with 3 replicas running the
traefik/whoami:latest
container. - A Service in the
whoami
namespace to expose the pods via an internal ClusterIP. - An Ingress resource to route traffic from
whoami.van-hemmen.com
via Traefik.
2. Verify Resources
Check the status of the created resources using these commands:
-
Verify Namespace:
kubectl get namespace
Output should include the
whoami
namespace. -
Check Pods:
kubectl get pods -n whoami
Ensure 3 pods are running.
-
Check Service:
kubectl get svc -n whoami
Confirm the
whoami
service is created and exposing port 80. -
Check Ingress:
kubectl get ingress -n whoami
Ensure the
Ingress
is listed with the hostwhoami.van-hemmen.com
.
3. Access the Application
Once the Ingress
is configured, visit the application at:
- HTTP:
http://whoami.van-hemmen.com
- HTTPS:
https://whoami.van-hemmen.com
If everything is correctly set up, you should see the whoami
application's
response, displaying information about the client request.
Configuration Overview
Here are the key details of the deployment:
-
Namespace:
- All resources are isolated within the
whoami
namespace.
- All resources are isolated within the
-
Deployment:
- The deployment runs 3 replicas of the
traefik/whoami:latest
container. - Each replica exposes port 80 internally.
- The deployment runs 3 replicas of the
-
Service:
- A ClusterIP service named
whoami
maps incoming traffic on port 80 to the containers.
- A ClusterIP service named
-
Ingress:
- The
Ingress
resource routes the traffic for the domainwhoami.van-hemmen.com
via Traefik'swebsecure
entrypoint. - A TLS certificate (created by cert-manager) is referenced by the secret
name
whoami-app-tls
.
- The
Updating the Deployment
To update any configurations:
- Edit the
deployment.yaml
file. - Reapply the changes using:
kubectl apply -f deployment.yaml
Troubleshooting
-
Pods Not Running:
- Check the pod logs:
kubectl logs <pod-name> -n whoami
- Check the pod logs:
-
Ingress Not Working:
- Verify that the
Ingress
resource is correctly applied:kubectl describe ingress whoami-ingress -n whoami
- Check the external URL by inspecting the
Ingress
host and annotations.
- Verify that the
-
DNS Issues:
- Ensure that external-dns has correctly created the DNS record for
whoami.van-hemmen.com
.
- Ensure that external-dns has correctly created the DNS record for
License
This project is licensed under the MIT License.