Add longhorn distributed storage to the k3s-cluster
This change adds longhorn, an addition to Kubernetes that adds the
ability to use distributed storage over all nodes to the cluster.
Note, that I tried that in December already but due to very high load on
the machines I rolled _everything_ back. Though, it turned out that the
high load was not because of longhorn, but instead because of bad
configuration of the server, as described in the see-also commit.
Reference: https://longhorn.io/
Reference: https://longhorn.io/docs/1.10.1/deploy/install/install-with-helm/
See-also: 4b8a3d12c4 Use etcd instead of sqlite for k3s-server
This commit is contained in:
3
roles/longhorn/defaults/main.yml
Normal file
3
roles/longhorn/defaults/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
longhorn_state: present
|
||||
longhorn_namespace: longhorn-system
|
||||
longhorn_chart_version: 1.10.1
|
||||
25
roles/longhorn/tasks/main.yml
Normal file
25
roles/longhorn/tasks/main.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
- name: Ensure longhorn chart
|
||||
kubernetes.core.helm_repository:
|
||||
name: longhorn
|
||||
repo_url: https://charts.longhorn.io
|
||||
|
||||
- name: Ensure longhorn is installed
|
||||
kubernetes.core.helm:
|
||||
name: longhorn
|
||||
chart_ref: longhorn/longhorn
|
||||
chart_version: "{{ longhorn_chart_version }}"
|
||||
release_namespace: "{{ longhorn_namespace }}"
|
||||
release_state: "{{ longhorn_state }}"
|
||||
create_namespace: True
|
||||
|
||||
- name: Ensure longhorn namespace
|
||||
kubernetes.core.k8s:
|
||||
state: "{{ longhorn_state }}"
|
||||
definition:
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: "{{ longhorn_namespace }}"
|
||||
labels:
|
||||
name: "{{ longhorn_namespace }}"
|
||||
|
||||
Reference in New Issue
Block a user