Move infra-setup and k3s-setup into dedicated directories
This changes makes it easier to differentiate and understand the different parts of the kubernetes setup. On one hand we have the bare infrastructure (servers, network, etc), on the other hand we have the software (k3s in this case). In the future we'll have a few more parts, like the minimal configuration of the kubernetes cluster, e.g. with a cert-manager. This is easier to manage with helm or terraform than with ansible. Therefore it makes even more sense to split the responsibilities into dedicated directories.
This commit is contained in:
17
infra/modules/hetzner/kubernetes/agent-init.yaml.tftpl
Normal file
17
infra/modules/hetzner/kubernetes/agent-init.yaml.tftpl
Normal file
@@ -0,0 +1,17 @@
|
||||
#cloud-config
|
||||
packages:
|
||||
- curl
|
||||
users:
|
||||
- name: cluster
|
||||
shell: /bin/bash
|
||||
runcmd:
|
||||
# configure correct routing via NAT
|
||||
- ip route add default via ${network_gateway}
|
||||
- NIC=$(ifconfig | grep -q enp7s0 && echo enp7s0 || echo ens10)
|
||||
- echo "[Match]" > /etc/systemd/network/10-$NIC.network
|
||||
- echo "Name=$NIC" >> /etc/systemd/network/10-$NIC.network
|
||||
- echo "[Network]" >> /etc/systemd/network/10-$NIC.network
|
||||
- echo "DHCP=yes" >> /etc/systemd/network/10-$NIC.network
|
||||
- echo "Gateway=${network_gateway}" >> /etc/systemd/network/10-$NIC.network
|
||||
- sed -e "s/#DNS=/DNS=${dns_servers}/" -i /etc/systemd/resolved.conf
|
||||
- systemctl restart systemd-resolved
|
||||
Reference in New Issue
Block a user