No description
Find a file
Guillaume B.B. Van Hemmen 8ed8495f92 #0000 - Add Kubernetes deployment for whoami app
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.
2024-12-26 22:24:46 +01:00
deployment.yaml #0000 - Add Kubernetes deployment for whoami app 2024-12-26 22:24:46 +01:00
LICENSE #0000 - Update LICENSE formatting and copyright details 2024-12-15 10:31:14 +01:00
README.md #0000 - Add Kubernetes deployment for whoami app 2024-12-26 22:24:46 +01:00

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:

  1. Verify Namespace:

    kubectl get namespace
    

    Output should include the whoami namespace.

  2. Check Pods:

    kubectl get pods -n whoami
    

    Ensure 3 pods are running.

  3. Check Service:

    kubectl get svc -n whoami
    

    Confirm the whoami service is created and exposing port 80.

  4. Check Ingress:

    kubectl get ingress -n whoami
    

    Ensure the Ingress is listed with the host whoami.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:

  1. Namespace:

    • All resources are isolated within the whoami namespace.
  2. Deployment:

    • The deployment runs 3 replicas of the traefik/whoami:latest container.
    • Each replica exposes port 80 internally.
  3. Service:

    • A ClusterIP service named whoami maps incoming traffic on port 80 to the containers.
  4. Ingress:

    • The Ingress resource routes the traffic for the domain whoami.van-hemmen.com via Traefik's websecure entrypoint.
    • A TLS certificate (created by cert-manager) is referenced by the secret name whoami-app-tls.

Updating the Deployment

To update any configurations:

  1. Edit the deployment.yaml file.
  2. Reapply the changes using:
    kubectl apply -f deployment.yaml
    

Troubleshooting

  1. Pods Not Running:

    • Check the pod logs:
      kubectl logs <pod-name> -n whoami
      
  2. 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.
  3. DNS Issues:

    • Ensure that external-dns has correctly created the DNS record for whoami.van-hemmen.com.

License

This project is licensed under the MIT License.