Skip to content

Instantly share code, notes, and snippets.

@rajasiman
Created November 24, 2019 10:38
Show Gist options
  • Select an option

  • Save rajasiman/675451e1eec0998b3abddf5d4391cbb1 to your computer and use it in GitHub Desktop.

Select an option

Save rajasiman/675451e1eec0998b3abddf5d4391cbb1 to your computer and use it in GitHub Desktop.
K3S docker-compose test
version: '3'
services:
server:
image: rancher/k3s:v0.10.0
command: server --disable-agent
environment:
- K3S_CLUSTER_SECRET=Kj2ILTIUvFU9KyipEazWFi94uHxAgPKXvqi0PIMnA2kajRJLabEBeFsCg4DMA64uxzUGTepzIkfWt00L
- K3S_KUBECONFIG_OUTPUT=/output/kubeconfig.yaml
- K3S_KUBECONFIG_MODE=666
volumes:
- k3s-server:/var/lib/rancher/k3s
# This is just so that we get the kubeconfig file out
- .:/output
ports:
- 6443:6443
node-1:
image: rancher/k3s:v0.10.0
tmpfs:
- /run
- /var/run
privileged: true
environment:
- K3S_URL=https://server:6443
- K3S_CLUSTER_SECRET=Kj2ILTIUvFU9KyipEazWFi94uHxAgPKXvqi0PIMnA2kajRJLabEBeFsCg4DMA64uxzUGTepzIkfWt00L
# Can also use K3S_TOKEN from /var/lib/rancher/k3s/server/node-token instead of K3S_CLUSTER_SECRET
#- K3S_TOKEN=K13849a67fc385fd3c0fa6133a8649d9e717b0258b3b09c87ffc33dae362c12d8c0::node:2e373dca319a0525745fd8b3d8120d9c
node-2:
image: rancher/k3s:v0.10.0
tmpfs:
- /run
- /var/run
privileged: true
environment:
- K3S_URL=https://server:6443
- K3S_CLUSTER_SECRET=Kj2ILTIUvFU9KyipEazWFi94uHxAgPKXvqi0PIMnA2kajRJLabEBeFsCg4DMA64uxzUGTepzIkfWt00L
node-3:
image: rancher/k3s:v0.10.0
tmpfs:
- /run
- /var/run
privileged: true
environment:
- K3S_URL=https://server:6443
- K3S_CLUSTER_SECRET=Kj2ILTIUvFU9KyipEazWFi94uHxAgPKXvqi0PIMnA2kajRJLabEBeFsCg4DMA64uxzUGTepzIkfWt00L
volumes:
k3s-server: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment