-
-
Save vitaly-z/7f5573ef60dd6bb30aaa7550d88cc787 to your computer and use it in GitHub Desktop.
Start K3S Cluster on Docker
This file contains hidden or 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: | |
| server: | |
| image: "rancher/k3s:latest" | |
| command: server | |
| tmpfs: | |
| - /run | |
| - /var/run | |
| privileged: true | |
| environment: | |
| - K3S_TOKEN=token1234567890 | |
| - K3S_NODE_NAME=master | |
| - K3S_KUBECONFIG_OUTPUT=/output/kube.config | |
| - K3S_KUBECONFIG_MODE=666 | |
| volumes: | |
| - k3s-server:/var/lib/rancher/k3s | |
| - .:/output | |
| ports: | |
| - 6443:6443 | |
| - 80:80 | |
| - 443:443 | |
| - 8080:8080 | |
| restart: unless-stopped | |
| worker1: | |
| image: "rancher/k3s:latest" | |
| tmpfs: | |
| - /run | |
| - /var/run | |
| privileged: true | |
| environment: | |
| - K3S_URL=https://server:6443 | |
| - K3S_TOKEN=token1234567890 | |
| - K3S_NODE_NAME=worker-1 | |
| volumes: | |
| - k3s-worker1:/var/lib/rancher/k3s | |
| restart: unless-stopped | |
| worker2: | |
| image: "rancher/k3s:latest" | |
| tmpfs: | |
| - /run | |
| - /var/run | |
| privileged: true | |
| environment: | |
| - K3S_URL=https://server:6443 | |
| - K3S_TOKEN=token1234567890 | |
| - K3S_NODE_NAME=worker-2 | |
| volumes: | |
| - k3s-worker2:/var/lib/rancher/k3s | |
| restart: unless-stopped | |
| volumes: | |
| k3s-server: {} | |
| k3s-worker1: {} | |
| k3s-worker2: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment