Skip to content

Instantly share code, notes, and snippets.

@phpclub
Forked from EvilFreelancer/docker-compose.yml
Created May 15, 2024 08:36
Show Gist options
  • Save phpclub/a1bb2cbba18169ea6ce7b8002d05afa7 to your computer and use it in GitHub Desktop.
Save phpclub/a1bb2cbba18169ea6ce7b8002d05afa7 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