diff options
author | Patrick Spek <p.spek@tyil.nl> | 2022-07-25 15:17:34 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2022-07-25 15:17:34 +0200 |
commit | 375223103704b3014be649f74633aa9db12ad4f6 (patch) | |
tree | 0b22068f9f64b6c09cff6c546cfbf8e3242fb222 /playbooks.d/k3s | |
parent | d7f200cddda3a2267cf3d2e8cb45d86b1ad5bc25 (diff) |
Playing around with k3s
Diffstat (limited to 'playbooks.d/k3s')
-rw-r--r-- | playbooks.d/k3s/description.txt | 1 | ||||
-rw-r--r-- | playbooks.d/k3s/playbook.bash | 26 | ||||
-rw-r--r-- | playbooks.d/k3s/share/argocd.yaml | 6 |
3 files changed, 33 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 +... |