Created
April 25, 2023 23:06
-
-
Save EvilFreelancer/259dd52957b227504c297b83700e6a93 to your computer and use it in GitHub Desktop.
docker-compose with k3s server and agent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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