From 284d72727d8f312865cf5800e2f2d975142547a8 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 8 Feb 2022 16:38:17 -0600 Subject: [PATCH] Install longhorn helm chart --- ansible/k3s-node/tasks/prepare-host.yml | 20 +++++++++---------- .../tasks/use-firewalld-with-iptables.yml | 9 --------- cluster/home/longhorn-system/0namespace.yml | 6 ++++++ .../home/longhorn-system/longhorn-helm.yml | 10 ++++++++++ 4 files changed, 26 insertions(+), 19 deletions(-) delete mode 100644 ansible/k3s-node/tasks/use-firewalld-with-iptables.yml create mode 100644 cluster/home/longhorn-system/0namespace.yml create mode 100644 cluster/home/longhorn-system/longhorn-helm.yml diff --git a/ansible/k3s-node/tasks/prepare-host.yml b/ansible/k3s-node/tasks/prepare-host.yml index 7a92a20..326f645 100644 --- a/ansible/k3s-node/tasks/prepare-host.yml +++ b/ansible/k3s-node/tasks/prepare-host.yml @@ -7,17 +7,17 @@ vars: aur_helper_pkg: paru-bin -# common -- include_tasks: ./use-firewalld-with-iptables.yml - -# - name: open http and https ports in firewalld -# ansible.builtin.command: > -# sudo firewall-cmd --add-port=443/tcp --permanent \ -# && sudo firewall-cmd --add-port=80/tcp --permanent \ -# && sudo firewall-cmd --reload - - include_tasks: ./upgrade-all-packages.yml vars: aur_helper_command: paru - # _todo: net.ipv4.ip_forward = 1 +# TODO: is per-node host-level time sync necessary? + +- name: install necessary utilities for longhorn + when: ansible_facts.os_family == 'Archlinux' + community.general.pacman: + executable: 'paru' + name: + - nfs-utils + - open-iscsi + state: present diff --git a/ansible/k3s-node/tasks/use-firewalld-with-iptables.yml b/ansible/k3s-node/tasks/use-firewalld-with-iptables.yml deleted file mode 100644 index de24883..0000000 --- a/ansible/k3s-node/tasks/use-firewalld-with-iptables.yml +++ /dev/null @@ -1,9 +0,0 @@ -#- name: uninstall nftables, install firewalld, configure it to use iptables, and activate it -# when: ansible_facts.os_family == 'Archlinux' -# become: true -# ansible.builtin.command: > -# pacman -Rs nftables \ -# && pacman -Sy firewalld \ -# && sed -i 's/FirewallBackend=.*/FirewallBackend=iptables/g' /etc/firewalld/firewalld.conf \ -# && systemctl enable firewalld \ -# && systemctl restart firewalld diff --git a/cluster/home/longhorn-system/0namespace.yml b/cluster/home/longhorn-system/0namespace.yml new file mode 100644 index 0000000..91399b7 --- /dev/null +++ b/cluster/home/longhorn-system/0namespace.yml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: longhorn-system + labels: + name: longhorn-system diff --git a/cluster/home/longhorn-system/longhorn-helm.yml b/cluster/home/longhorn-system/longhorn-helm.yml new file mode 100644 index 0000000..2ef40e6 --- /dev/null +++ b/cluster/home/longhorn-system/longhorn-helm.yml @@ -0,0 +1,10 @@ +apiVersion: helm.fluxcd.io/v1 +kind: HelmRelease +metadata: + name: longhorn + namespace: longhorn-system +spec: + chart: + repository: https://charts.longhorn.io/longhorn + name: podinfo + version: 1.2.3