summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2024-06-24 17:11:07 +0200
committerPatrick Spek <p.spek@tyil.nl>2024-06-24 17:11:07 +0200
commit9a8cb575776dadf3eeb03cc7195fc9fd00e5c797 (patch)
tree96ba39a14b4430da5c84124703946be6d401b4e9
parent55bbbe621cdd206992f6dc864c410d625ca4aa22 (diff)
Give up on dualstack k3s cluster
-rw-r--r--defaults12
-rw-r--r--playbooks.d/k3s-master/playbook.bash20
-rw-r--r--playbooks.d/k3s-node/playbook.bash11
3 files changed, 9 insertions, 34 deletions
diff --git a/defaults b/defaults
index 3e9d093..0f58630 100644
--- a/defaults
+++ b/defaults
@@ -11,23 +11,21 @@ dns.upstream.4=2001:470:71:6dc::53
etc-nixos.path=/etc/nixos
etc-portage.path=/etc/portage
k3s-master.bind-address&=k3s-node.bind-address
-k3s-master.cluster-cidr=fd00:8::0/48,172.28.0.0/16
+k3s-master.cluster-cidr=172.28.0.0/16
k3s-master.cluster-domain=k3s.tyil.nl
k3s-master.external-ip&=k3s-node.internal-ip
k3s-master.internal-ip&=k3s-node.internal-ip
-k3s-master.service-cidr=fd00:5::0/108,172.25.0.0/16
+k3s-master.service-cidr=172.25.0.0/16
k3s-master.service-node-port-min=1025
-k3s-master.flannel.interfaces.tinc&=k3s-node.flannel.interfaces.tinc
-k3s-node.bind-address&=vpn-tinc.ipv6
+k3s-node.bind-address&=vpn-tinc.ipv4
k3s-node.cluster-cidr&=k3s-master.cluster-cidr
k3s-node.cluster-domain&=k3s-master.cluster-domain
k3s-node.cluster-domain=k3s.tyil.nl
-k3s-node.entry.host=[fd68:1057:1992:3381:0:1:3317:1]
+k3s-node.entry.host=10.57.1.6
k3s-node.external-ip&=k3s-node.internal-ip
-k3s-node.flannel.interfaces.tinc=tyilnet1057
k3s-node.role=agent
k3s-node.service-cidr&=k3s-master.service-cidr
-k3s-node.service-node-port-min&=k3s-master.service-node-port-min
+k3s-node.internal-ip&=vpn-tinc.ipv4
nftables.input.icmp.ipv4.policy=accept
nftables.input.icmp.ipv4.rate=2/second
nftables.input.icmp.ipv6.policy=accept
diff --git a/playbooks.d/k3s-master/playbook.bash b/playbooks.d/k3s-master/playbook.bash
index 270e0cb..cfd0330 100644
--- a/playbooks.d/k3s-master/playbook.bash
+++ b/playbooks.d/k3s-master/playbook.bash
@@ -11,24 +11,12 @@ playbook_add() {
node-ip: "$(config "$BASHTARD_PLAYBOOK.internal-ip" "127.0.0.1")"
bind-address: "$(config "$BASHTARD_PLAYBOOK.bind-address" "0.0.0.0")"
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")"
- service-node-port-range: "$(config "$BASHTARD_PLAYBOOK.service-node-port-min" "30000")-$(config "$BASHTARD_PLAYBOOK.service-node-port-max" "32767")"
- flannel-ipv6-masq: true
+ service-cidr: "$(config "$BASHTARD_PLAYBOOK.service-cidr" "172.20.0.0/16")"
disable:
- traefik
EOF
- if [[ -n "$(config_subkeys "$BASHTARD_PLAYBOOK.flannel.interfaces")" ]]
- then
- printf "flannel-iface:\n"
-
- while read -r iface
- do
- printf -- "- %s\n" "$(config "$BASHTARD_PLAYBOOK.flannel.interfaces.$iface")"
- done < <( config_subkeys "$BASHTARD_PLAYBOOK.flannel.interfaces" )
- fi
-
if [[ -n "$(config "$BASHTARD_PLAYBOOK.external-ip" "")" ]]
then
printf "%s: \"%s\"\n" "node-external-ip" "$(config "$BASHTARD_PLAYBOOK.external-ip" "")"
@@ -38,13 +26,13 @@ playbook_add() {
info "$BASHTARD_PLAYBOOK/add" "Installing k3s"
curl -sfL https://get.k3s.io | sh -s - server --cluster-init # I hate this
- notice "$BASHTARD_PLAYBOOK/add" "Creating data directories"
- mkdir -pv -- "$(playbook_path "data")/manifests.d"
+ #notice "$BASHTARD_PLAYBOOK/add" "Creating data directories"
+ #mkdir -pv -- "$(playbook_path "data")/manifests.d"
notice "$BASHTARD_PLAYBOOK/add" "Waiting for node to become available"
{ grep -q -m 1 "${BASHTARD_PLATFORM[fqdn]}[[:space:]]\+Ready"; kill $!; } < <(k3s kubectl get node -w)
- playbook_sync
+ #playbook_sync
}
playbook_sync() {
diff --git a/playbooks.d/k3s-node/playbook.bash b/playbooks.d/k3s-node/playbook.bash
index bc041df..361c176 100644
--- a/playbooks.d/k3s-node/playbook.bash
+++ b/playbooks.d/k3s-node/playbook.bash
@@ -44,16 +44,6 @@ playbook_add() {
token: "$token"
EOF
- if [[ -n "$(config_subkeys "$BASHTARD_PLAYBOOK.flannel.interfaces")" ]]
- then
- printf "flannel-iface:\n"
-
- while read -r iface
- do
- printf -- "- \"%s\"\n" "$(config "$BASHTARD_PLAYBOOK.flannel.interfaces.$iface")"
- done < <( config_subkeys "$BASHTARD_PLAYBOOK.flannel.interfaces" )
- fi
-
if [[ -n "$(config "$BASHTARD_PLAYBOOK.external-ip" "")" ]]
then
printf "%s: \"%s\"\n" "node-external-ip" "$(config "$BASHTARD_PLAYBOOK.external-ip" "")"
@@ -67,7 +57,6 @@ playbook_add() {
cluster-domain: "$(config "$BASHTARD_PLAYBOOK.cluster-domain" "cluster.local")"
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")"
- flannel-ipv6-masq: true
disable:
- traefik
EOF