Refactor Kubernetes configuration to use Traefik for dashboard routing

This commit is contained in:
2024-07-19 22:18:54 +08:00
parent b216198cd4
commit 8460e24fd0
3 changed files with 6 additions and 0 deletions
View File
+5
View File
@@ -1,6 +1,11 @@
# to run define K3S_TOKEN, K3S_VERSION is optional, eg:
# export K3S_VERSION=v1.21.4+k3s1
# export K3S_TOKEN=your_secret_token
# export RANDOM="$(openssl rand -hex 8)"
# export RANDOM="$(python3 -c 'import secrets; print(secrets.token_urlsafe(32))')"
# export K3S_TOKEN=${RANDOM}${RANDOM}${RANDOM}
# docker compose -f k3s.yml up -d
# export KUBECONFIG=$(pwd)/config/kubeconfig.yaml
services:
server:
image: "rancher/k3s:${K3S_VERSION:-latest}"
+1
View File
@@ -3,6 +3,7 @@
```bash
export K3S_TOKEN=${RANDOM}${RANDOM}${RANDOM}
docker compose -f k3s.yml up -d
export KUBECONFIG=$(pwd)/config/kubeconfig.yaml
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v3.0/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v3.0/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml
kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v3.0/docs/content/user-guides/crd-acme/02-services.yml