summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-07-25 15:17:34 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-07-25 15:17:34 +0200
commit375223103704b3014be649f74633aa9db12ad4f6 (patch)
tree0b22068f9f64b6c09cff6c546cfbf8e3242fb222
parentd7f200cddda3a2267cf3d2e8cb45d86b1ad5bc25 (diff)
Playing around with k3s
-rw-r--r--playbooks.d/k3s/description.txt1
-rw-r--r--playbooks.d/k3s/playbook.bash26
-rw-r--r--playbooks.d/k3s/share/argocd.yaml6
-rw-r--r--registry.d/edephas.tyil.net1
4 files changed, 34 insertions, 0 deletions
diff --git a/playbooks.d/k3s/description.txt b/playbooks.d/k3s/description.txt
new file mode 100644
index 0000000..bf1fbab
--- /dev/null
+++ b/playbooks.d/k3s/description.txt
@@ -0,0 +1 @@
+Playbook for a k3s node
diff --git a/playbooks.d/k3s/playbook.bash b/playbooks.d/k3s/playbook.bash
new file mode 100644
index 0000000..c470b77
--- /dev/null
+++ b/playbooks.d/k3s/playbook.bash
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+playbook_add() {
+ pkg install k3s
+
+ mkdir -pv -- /etc/rancher/k3s
+ cat <<-EOF > /etc/rancher/k3s/config.yaml
+ node-name: ${BASHTARD_PLATFORM[fqdn]}
+ node-ip: $(config "vpn.ipv4")
+ bind-address: $(config "vpn.ipv4")
+ cluster-cidr: 10.57.40.0/20
+ service-cidr: 10.57.48.0/20
+ cluster-dns: 10.57.48.53
+ cluster-domain: k3s.tyil.nl
+ EOF
+
+ printf "Finish installation: %s\n" "curl -sfL https://get.k3s.io | sh -" # I hate this
+}
+
+playbook_sync() {
+ k3s kubectl apply -Rf "$BASHTARD_ETCDIR/playbooks.d/$BASHTARD_PLAYBOOK/share"
+}
+
+playbook_del() {
+ /usr/local/bin/k3s-uninstall.sh
+}
diff --git a/playbooks.d/k3s/share/argocd.yaml b/playbooks.d/k3s/share/argocd.yaml
new file mode 100644
index 0000000..eb10dd7
--- /dev/null
+++ b/playbooks.d/k3s/share/argocd.yaml
@@ -0,0 +1,6 @@
+---
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: argocd
+...
diff --git a/registry.d/edephas.tyil.net b/registry.d/edephas.tyil.net
index 6844c8c..8694b34 100644
--- a/registry.d/edephas.tyil.net
+++ b/registry.d/edephas.tyil.net
@@ -1,4 +1,5 @@
backup-borg
+k3s
ssh
user-tyil
vpn-tinc