From 3554bccf97cbe65e24541c17af07573a90810574 Mon Sep 17 00:00:00 2001 From: Laszlo Fogas Date: Sat, 27 Apr 2019 22:45:32 +0200 Subject: [PATCH] K3s for integration testing --- .gitignore | 2 ++ docker-compose.k3s.yml | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 docker-compose.k3s.yml diff --git a/.gitignore b/.gitignore index 22527af4a..fce6790ce 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,7 @@ extras/ release/ cli/release/ +kubeconfig.yaml + server/swagger/files/*.json .idea/ diff --git a/docker-compose.k3s.yml b/docker-compose.k3s.yml new file mode 100644 index 000000000..332e3739c --- /dev/null +++ b/docker-compose.k3s.yml @@ -0,0 +1,32 @@ +version: '3' +services: + server: + image: rancher/k3s:v0.4.0 + command: server --disable-agent + environment: + - K3S_CLUSTER_SECRET=somethingtotallyrandom + - 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: + image: rancher/k3s:v0.4.0 + tmpfs: + - /run + - /var/run + privileged: true + depends_on: + - server + environment: + - K3S_URL=https://server:6443 + - K3S_CLUSTER_SECRET=somethingtotallyrandom + # Can also use K3S_TOKEN from /var/lib/rancher/k3s/server/node-token instead of K3S_CLUSTER_SECRET + #- K3S_TOKEN=K13849a67fc385fd3c0fa6133a8649d9e717b0258b3b09c87ffc33dae362c12d8c0::node:2e373dca319a0525745fd8b3d8120d9c + +volumes: + k3s-server: {}