course_deploying_an_applica.../module3
2026-01-15 20:11:45 +01:00
..
k8s feat: replace ingress-nginx with traefik 2026-01-15 20:11:45 +01:00
.gitignore feat: add module3-6 2025-04-28 13:34:28 +02:00
README.md feat: replace ingress-nginx with traefik 2026-01-15 20:11:45 +01:00

Scrumlr K8s Deployment

Generate JWT Key

openssl ecparam -genkey -name secp521r1 -noout -out $(git rev-parse --show-toplevel)/module3/k8s/kustomize/scrumlr/jwt.key

Differences in deployment between local minikube cluster and SKE cluster

  • Skip PostgreSQL Deployment for SKE deployment, since we use external PostgreSQL
  • Set the right SCRUMLR_SERVER_DATABASE_URL value in the scrumlr-backend secret
  • Minikube: Ingress without Host and external-dns/ cert-manager annotations
  • SKE: Ingress with Host and external-dns/ cert-manager annotations

Deploy Scrumlr into local cluster using minikube

Local Deployment that can run on a lokal K8s cluster like a minikube cluster. As we don't have Postgres as an external service here, we also install Postgres directly in our local cluster.

cd $(git rev-parse --show-toplevel)/module3/k8s/

# Create Cluster with kind and start cloud-provider-kind for Ingress
minikube start
minikube tunnel

# Install traefik and nats with helm

helm repo add nats https://nats-io.github.io/k8s/helm/charts/
helm repo add traefik https://traefik.github.io/charts
helm repo update
helm upgrade \
  traefik traefik/traefik \
  --install \
  --namespace traefik \
  --create-namespace \
  --version 38.0.2 \
  --values helm/traefik/values.yaml
helm upgrade \
  --install \
  nats nats/nats \
  --namespace nats \
  --create-namespace \
  --version 2.12.3 \
  --values helm/nats/values.yaml


# Install kustomize applications

kubectl apply -k kustomize/postgres
kubectl apply -k kustomize/scrumlr

# Use external IP of your Ingress Controller in your Browser to open Scrumlr
kubectl get services --namespace traefik traefik --output jsonpath='{.status.loadBalancer.ingress[0].ip}'

# Destroy Cluster
minikube stop
minikube delete
# Optional: Connect to your PostgreSQL instance with psql (psql must be installed)
kubectl port-forward -n postgres services/postgres-scrumlr
psql -h localhost -U scrumlr -d scrumlr
# List all tables
scrumlr-# \dt
                 List of relations
 Schema |          Name          | Type  |  Owner  
--------+------------------------+-------+---------
 public | apple_users            | table | scrumlr
 public | azure_ad_users         | table | scrumlr
 public | board_session_requests | table | scrumlr
 public | board_sessions         | table | scrumlr
 public | board_templates        | table | scrumlr
 public | boards                 | table | scrumlr
 public | column_templates       | table | scrumlr
 public | columns                | table | scrumlr
 public | deleted_boards         | table | scrumlr
 public | github_users           | table | scrumlr
 public | google_users           | table | scrumlr
 public | microsoft_users        | table | scrumlr
 public | notes                  | table | scrumlr
 public | oidc_users             | table | scrumlr
 public | reactions              | table | scrumlr
 public | schema_migrations      | table | scrumlr
 public | users                  | table | scrumlr
 public | votes                  | table | scrumlr
 public | votings                | table | scrumlr
(19 rows)