diff options
author | Christian Pointner <equinox@spreadspace.org> | 2022-08-21 17:25:05 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2022-08-21 17:25:05 +0200 |
commit | f154c11d49abc2a2696d8d55e7130f0ff55d0017 (patch) | |
tree | 94db66319d8ca11ebd78e2e4a05922ef1e56bfcc /roles/kubernetes/addons | |
parent | kubernetes/addon: add zfs-localpv provisioner (diff) |
kubernetes/addons: rename zfs-localpv to openebs-zfs
Diffstat (limited to 'roles/kubernetes/addons')
-rw-r--r-- | roles/kubernetes/addons/openebs-zfs/defaults/main.yml (renamed from roles/kubernetes/addons/zfs-localpv/defaults/main.yml) | 10 | ||||
-rw-r--r-- | roles/kubernetes/addons/openebs-zfs/tasks/main.yml | 42 | ||||
-rw-r--r-- | roles/kubernetes/addons/openebs-zfs/templates/storageclass.yml.j2 (renamed from roles/kubernetes/addons/zfs-localpv/templates/storageclass.yml.j2) | 0 | ||||
-rw-r--r-- | roles/kubernetes/addons/openebs-zfs/templates/zfs-operator.2.1.0.yml.j2 (renamed from roles/kubernetes/addons/zfs-localpv/templates/zfs-operator.2.1.0.yml.j2) | 8 | ||||
-rw-r--r-- | roles/kubernetes/addons/zfs-localpv/tasks/main.yml | 42 |
5 files changed, 51 insertions, 51 deletions
diff --git a/roles/kubernetes/addons/zfs-localpv/defaults/main.yml b/roles/kubernetes/addons/openebs-zfs/defaults/main.yml index 726e1eaf..beb510b3 100644 --- a/roles/kubernetes/addons/zfs-localpv/defaults/main.yml +++ b/roles/kubernetes/addons/openebs-zfs/defaults/main.yml @@ -1,17 +1,17 @@ --- -# kubernetes_zfs_localpv_version: 2.1.0 +# kubernetes_openebs_zfs_version: 2.1.0 -# kubernetes_zfs_localpv_node_selector: +# kubernetes_openebs_zfs_node_selector: # foo: bar -# kubernetes_zfs_localpv_node_affinity: +# kubernetes_openebs_zfs_node_affinity: # requiredDuringSchedulingIgnoredDuringExecution: # nodeSelectorTerms: # - matchExpressions: -# - key: k8s.example.com/zfs-localpv +# - key: k8s.example.com/openebs-zfs # operator: Exists -kubernetes_zfs_localpv_storage_classes: {} +kubernetes_openebs_zfs_storage_classes: {} # foo: # allowVolumeExpansion: true # parameters: diff --git a/roles/kubernetes/addons/openebs-zfs/tasks/main.yml b/roles/kubernetes/addons/openebs-zfs/tasks/main.yml new file mode 100644 index 00000000..577eef6d --- /dev/null +++ b/roles/kubernetes/addons/openebs-zfs/tasks/main.yml @@ -0,0 +1,42 @@ +--- +- name: create base directory for openebs-zfs addon + file: + path: /etc/kubernetes/addons/openebs-zfs + state: directory + +- name: copy config for openebs-zfs + template: + src: "zfs-operator.{{ kubernetes_openebs_zfs_version }}.yml.j2" + dest: /etc/kubernetes/addons/openebs-zfs/config.yml + +- name: check if openebs-zfs is already installed + check_mode: no + command: kubectl --kubeconfig /etc/kubernetes/admin.conf diff -f /etc/kubernetes/addons/openebs-zfs/config.yml + failed_when: false + changed_when: false + register: kube_openebs_zfs_config_diff_result + +- name: install openebs-zfs onto the cluster + when: kube_openebs_zfs_config_diff_result.rc != 0 + command: kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/addons/openebs-zfs/config.yml + + +- name: copy storageclasses config for openebs-zfs + loop: "{{ kubernetes_openebs_zfs_storage_classes | dict2items }}" + loop_control: + label: "{{ item.key }}" + template: + src: "storageclass.yml.j2" + dest: "/etc/kubernetes/addons/openebs-zfs/sc-{{ item.key }}.yml" + +- name: check if openebs-zfs storageclass already exists + loop: "{{ kubernetes_openebs_zfs_storage_classes | list }}" + check_mode: no + command: "kubectl --kubeconfig /etc/kubernetes/admin.conf diff -f /etc/kubernetes/addons/openebs-zfs/sc-{{ item }}.yml" + failed_when: false + changed_when: false + register: kube_openebs_zfs_sc_diff + +- name: install/update storageclasses for openebs-zfs + loop: "{{ kube_openebs_zfs_sc_diff.results | selectattr('rc', 'ne', 0) | map(attribute='item') }}" + command: "kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/addons/openebs-zfs/sc-{{ item }}.yml" diff --git a/roles/kubernetes/addons/zfs-localpv/templates/storageclass.yml.j2 b/roles/kubernetes/addons/openebs-zfs/templates/storageclass.yml.j2 index c1f30953..c1f30953 100644 --- a/roles/kubernetes/addons/zfs-localpv/templates/storageclass.yml.j2 +++ b/roles/kubernetes/addons/openebs-zfs/templates/storageclass.yml.j2 diff --git a/roles/kubernetes/addons/zfs-localpv/templates/zfs-operator.2.1.0.yml.j2 b/roles/kubernetes/addons/openebs-zfs/templates/zfs-operator.2.1.0.yml.j2 index b1a824bd..b2482485 100644 --- a/roles/kubernetes/addons/zfs-localpv/templates/zfs-operator.2.1.0.yml.j2 +++ b/roles/kubernetes/addons/openebs-zfs/templates/zfs-operator.2.1.0.yml.j2 @@ -2295,14 +2295,14 @@ spec: openebs.io/component-name: openebs-zfs-node openebs.io/version: 2.1.0 spec: -{% if kubernetes_zfs_localpv_node_selector is defined %} +{% if kubernetes_openebs_zfs_node_selector is defined %} nodeSelector: - {{ kubernetes_zfs_localpv_node_selector | to_nice_yaml(indent=2) | indent(width=8) -}} + {{ kubernetes_openebs_zfs_node_selector | to_nice_yaml(indent=2) | indent(width=8) -}} {% endif %} -{% if kubernetes_zfs_localpv_node_affinity is defined %} +{% if kubernetes_openebs_zfs_node_affinity is defined %} affinity: nodeAffinity: - {{ kubernetes_zfs_localpv_node_affinity | to_nice_yaml(indent=2) | indent(width=10) -}} + {{ kubernetes_openebs_zfs_node_affinity | to_nice_yaml(indent=2) | indent(width=10) -}} {% endif %} priorityClassName: openebs-zfs-csi-node-critical serviceAccount: openebs-zfs-node-sa diff --git a/roles/kubernetes/addons/zfs-localpv/tasks/main.yml b/roles/kubernetes/addons/zfs-localpv/tasks/main.yml deleted file mode 100644 index 57dd6cf4..00000000 --- a/roles/kubernetes/addons/zfs-localpv/tasks/main.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- name: create base directory for zfs-localpv addon - file: - path: /etc/kubernetes/addons/zfs-localpv - state: directory - -- name: copy config for zfs-localpv - template: - src: "zfs-operator.{{ kubernetes_zfs_localpv_version }}.yml.j2" - dest: /etc/kubernetes/addons/zfs-localpv/config.yml - -- name: check if zfs-localpv is already installed - check_mode: no - command: kubectl --kubeconfig /etc/kubernetes/admin.conf diff -f /etc/kubernetes/addons/zfs-localpv/config.yml - failed_when: false - changed_when: false - register: kube_zfs_localpv_config_diff_result - -- name: install zfs-localpv onto the cluster - when: kube_zfs_localpv_config_diff_result.rc != 0 - command: kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/addons/zfs-localpv/config.yml - - -- name: copy storageclasses config for zfs-localpv - loop: "{{ kubernetes_zfs_localpv_storage_classes | dict2items }}" - loop_control: - label: "{{ item.key }}" - template: - src: "storageclass.yml.j2" - dest: "/etc/kubernetes/addons/zfs-localpv/sc-{{ item.key }}.yml" - -- name: check if zfs-localpv storageclass already exists - loop: "{{ kubernetes_zfs_localpv_storage_classes | list }}" - check_mode: no - command: "kubectl --kubeconfig /etc/kubernetes/admin.conf diff -f /etc/kubernetes/addons/zfs-localpv/sc-{{ item }}.yml" - failed_when: false - changed_when: false - register: kube_zfs_localpv_sc_diff - -- name: install/update storageclasses for zfs-localpv - loop: "{{ kube_zfs_localpv_sc_diff.results | selectattr('rc', 'ne', 0) | map(attribute='item') }}" - command: "kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f /etc/kubernetes/addons/zfs-localpv/sc-{{ item }}.yml" |