Skip to content

Instantly share code, notes, and snippets.

@EvilFreelancer
Created April 25, 2023 23:06
Show Gist options
  • Save EvilFreelancer/259dd52957b227504c297b83700e6a93 to your computer and use it in GitHub Desktop.
Save EvilFreelancer/259dd52957b227504c297b83700e6a93 to your computer and use it in GitHub Desktop.
docker-compose with k3s server and agent
version: '3'
services:
k3s-server:
image: rancher/k3s
command: server --disable-agent
environment:
K3S_KUBECONFIG_OUTPUT: /output/kubeconfig.yaml
volumes:
- ./k3s-server:/var/lib/rancher/k3s
- ./kubeconfig.yaml:/output/kubeconfig.yaml
k3s-agent:
image: rancher/k3s
command: agent
environment:
K3S_URL: http://k3s-server:6443
K3S_TOKEN: mysecrettoken
volumes:
- ./k3s-agent:/var/lib/rancher/k3s
depends_on:
- k3s-server
volumes:
k3s-server:
k3s-agent:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment