This project is a small demo to run a containerized webservice in a kubernetes cluster.

Steps to reproduce

Requirements

please set up these beforehand:

change hardcoded values

  1. change the web access domain in
  2. The loaded web content is configured at

prepare image

  1. clone this repo into a folder
  2. generate SSL certs
    1. certbot certonly --standalone -d "my.domain" --agree-tos -m "[[email protected]](<mailto:[email protected]>)" --non-interactive
    2. mkdir certs/
    3. move the generated cert material into the certs/ folder
  3. build the image
    1. docker build -t web:1.0 .
  4. add image to minikube (the traefik will be polled from registry)
    1. minikube image load web:1.0

prepare minikube

  1. make life easier with alias kubectl='minikube kubectl --'

  2. now, apply the kubectl configs provided by traefik: kubectl apply -f [<https://raw.githubusercontent.com/traefik/traefik/v3.5/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml>](<https://raw.githubusercontent.com/traefik/traefik/v3.5/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml>)

    kubectl apply -f [<https://raw.githubusercontent.com/traefik/traefik/v3.5/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml>](<https://raw.githubusercontent.com/traefik/traefik/v3.5/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml>)

  3. apply the configs in the repo:

    1. kubectl apply -f k8s/traefik/namespace.yaml
    2. kubectl apply -f k8s/web/namespace.yaml
    3. kubectl apply -R -f k8s/