From 9e30f385ccc8aaed7dd97de00932dda027a5ac3a Mon Sep 17 00:00:00 2001 From: Teck Meng Date: Mon, 15 Jul 2024 16:50:15 +0800 Subject: [PATCH] chore: Refactor Kubernetes configuration to use Traefik for dashboard routing --- kubernetes/k3s.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 kubernetes/k3s.yml diff --git a/kubernetes/k3s.yml b/kubernetes/k3s.yml new file mode 100644 index 0000000..29ea4f4 --- /dev/null +++ b/kubernetes/k3s.yml @@ -0,0 +1,30 @@ +server: + image: rancher/k3s:v1.17.2-k3s1 + command: server --disable-agent --no-deploy traefik + environment: + - K3S_CLUSTER_SECRET=somethingtotallyrandom + - K3S_KUBECONFIG_OUTPUT=/output/kubeconfig.yaml + - K3S_KUBECONFIG_MODE=666 + volumes: + # k3s will generate a kubeconfig.yaml in this directory. This volume is mounted + # on your host, so you can then 'export KUBECONFIG=/somewhere/on/your/host/out/kubeconfig.yaml', + # in order for your kubectl commands to work. + - ./config:/output + # This directory is where you put all the (yaml) configuration files of + # the Kubernetes resources. + - ./:/var/lib/rancher/k3s/server/manifests + ports: + - 6443:6443 + +node: + image: rancher/k3s:v1.17.2-k3s1 + privileged: true + links: + - server + environment: + - K3S_URL=https://server:6443 + - K3S_CLUSTER_SECRET=somethingtotallyrandom + volumes: + # this is where you would place a alternative traefik image (saved as a .tar file with + # 'docker save'), if you want to use it, instead of the traefik:v3.0 image. + - ~/custom-image:/var/lib/rancher/k3s/agent/images \ No newline at end of file