summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2023-08-01 13:16:48 +0200
committerPatrick Spek <p.spek@tyil.nl>2023-08-01 13:16:48 +0200
commitadb182b14b81997819fef19b56b8623634b3fb9f (patch)
treed2b597a78bd4cd6b7994804e10881ba5478c7c9c
parentefaab854d2a2b101a21059e0479e6e7aab1ba9d0 (diff)
Add nouki as control-plane node to oolah
-rw-r--r--hosts.d/nouki.tyil.net1
-rw-r--r--playbooks.d/k3s-node/playbook.bash14
-rw-r--r--registry.d/nouki.tyil.net1
3 files changed, 8 insertions, 8 deletions
diff --git a/hosts.d/nouki.tyil.net b/hosts.d/nouki.tyil.net
index 609e69a..049d795 100644
--- a/hosts.d/nouki.tyil.net
+++ b/hosts.d/nouki.tyil.net
@@ -1,3 +1,4 @@
bashtard.ssh.host=10.57.101.20
+k3s-node.role=server
meta.provider=self
vpn-tinc.ipv4=10.57.101.20
diff --git a/playbooks.d/k3s-node/playbook.bash b/playbooks.d/k3s-node/playbook.bash
index e4fc48a..6d4fcc5 100644
--- a/playbooks.d/k3s-node/playbook.bash
+++ b/playbooks.d/k3s-node/playbook.bash
@@ -9,20 +9,18 @@ playbook_add() {
info "$BASHTARD_PLAYBOOK" "Writing config.yaml for k3s"
mkdir -pv -- /etc/rancher/k3s
cat <<-EOF > /etc/rancher/k3s/config.yaml
- node-name: "${BASHTARD_PLATFORM[fqdn]}"
- node-ip: "$(config "$BASHTARD_PLAYBOOK.node-ip" "$(config "bashtard.ssh.host")")"
cluster-cidr: "$(config "$BASHTARD_PLAYBOOK.cluster-cidr" "172.19.0.0/16")"
- service-cidr: "$(config "$BASHTARD_PLAYBOOK.service-cidr" "172.20.0.0/16")"
cluster-domain: "$(config "$BASHTARD_PLAYBOOK.cluster-domain" "cluster.local")"
+ node-ip: "$(config "$BASHTARD_PLAYBOOK.node-ip" "$(config "bashtard.ssh.host")")"
+ node-name: "${BASHTARD_PLATFORM[fqdn]}"
+ server: "https://$(config "$BASHTARD_PLAYBOOK.entry.host"):$(config "$BASHTARD_PLAYBOOK.entry.port" "6443")"
+ service-cidr: "$(config "$BASHTARD_PLAYBOOK.service-cidr" "172.20.0.0/16")"
service-node-port-range: "$(config "$BASHTARD_PLAYBOOK.service-node-port-min" "30000")-$(config "$BASHTARD_PLAYBOOK.service-node-port-max" "32767")"
+ token: "$(config "$BASHTARD_PLAYBOOK.entry.token")"
EOF
info "$BASHTARD_PLAYBOOK" "Installing k3s"
- curl -sfL https://get.k3s.io \
- | K3S_TOKEN_SECRET="$(config "$BASHTARD_PLAYBOOK.entry.token")" \
- sh -s - \
- "$(config "$BASHTARD_PLAYBOOK.role" "agent")" \
- https://"$(config "$BASHTARD_PLAYBOOK.entry.host"):$(config "$BASHTARD_PLAYBOOK.entry.port)"
+ curl -sfL https://get.k3s.io | sh -s - "$(config "$BASHTARD_PLAYBOOK.role" "agent")"
notice "$BASHTARD_PLAYBOOK" "Waiting for node to become available"
{ grep -q -m 1 "${BASHTARD_PLATFORM[fqdn]}[[:space:]]\+Ready"; kill $!; } < <(k3s kubectl get node -w)
diff --git a/registry.d/nouki.tyil.net b/registry.d/nouki.tyil.net
index 3255b0d..912e4c3 100644
--- a/registry.d/nouki.tyil.net
+++ b/registry.d/nouki.tyil.net
@@ -1,4 +1,5 @@
etc-portage
+k3s-node
ssh
user-tyil
vpn-tinc