-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcloud-init.yaml
More file actions
22 lines (21 loc) · 1.12 KB
/
Copy pathcloud-init.yaml
File metadata and controls
22 lines (21 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#cloud-config
packages:
- curl
users:
- name: cluster
ssh-authorized-keys:
- ${local_ssh_public_key}
- ${worker_ssh_public_key}
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
runcmd:
- apt-get update -y
- curl https://get.k3s.io | INSTALL_K3S_EXEC="--tls-san ${public_ip} --disable traefik --disable servicelb --flannel-iface enp7s0 --write-kubeconfig-mode 644 --disable metrics-server --disable-cloud-controller --kubelet-arg cloud-provider=external" sh -
- kubectl -n kube-system create secret generic hcloud --from-literal=token=${hcloud_token} --from-literal=network=${hcloud_network}
- kubectl -n kube-system create secret generic hcloud-csi --from-literal=token=${hcloud_token}
- wget https://github.com/hetznercloud/hcloud-cloud-controller-manager/releases/latest/download/ccm-networks.yaml -O ccm-networks.yaml
- sed -i 's cluster-cidr=10.244.0.0/16 cluster-cidr=10.42.0.0/16 g' /root/ccm-networks.yaml
- kubectl apply -f ccm-networks.yaml
- kubectl apply -f https://raw.githubusercontent.com/hetznercloud/csi-driver/v2.6.0/deploy/kubernetes/hcloud-csi.yml
- apt clean
- apt auto-clean