Skip to content

Commit

Permalink
Add logic to annotate volumesnapshotclasses if so desired (#8792)
Browse files Browse the repository at this point in the history
Co-authored-by: Wolfgang Kulhanek <WolfgangKulhanek@gmail.com>
  • Loading branch information
wkulhanek and Wolfgang Kulhanek authored Nov 12, 2024
1 parent 2a12891 commit 3a2ac43
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ ocp4_workload_kasten_k10_authentication_type: openshift
# - Set up authorization for normal users to use K10
ocp4_workload_kasten_k10_setup_demo: false

# Annotate volumesnapshotclasses as backup targets
# Set to empty array to not annotate any
ocp4_workload_kasten_k10_volumesnapshotclasses:
- ocs-external-storagecluster-rbdplugin-snapclass
- ocs-external-storagecluster-cephfsplugin-snapclass

# ObjectBucket properties
ocp4_workload_kasten_k10_objectbucket_name: kastenbackups
ocp4_workload_kasten_k10_objectbucket_storage_class: openshift-storage.noobaa.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@

# Jinja templates handle single/multi-user deployment
- name: Set up Demo environment
when: ocp4_workload_kasten_k10_setup_demo
when: ocp4_workload_kasten_k10_setup_demo | bool
kubernetes.core.k8s:
state: present
# template: objectbucketclaim.yaml.j2
definition: "{{ lookup('template', resource | from_yaml) }}"
loop:
- namespace.yaml.j2
Expand All @@ -69,6 +68,22 @@
loop_control:
loop_var: resource

- name: Annotate VolumeSnapshotClasses as backup targets
when:
- ocp4_workload_kasten_k10_setup_demo | bool
- ocp4_workload_kasten_k10_volumesnapshotclasses | default([]) | length > 0
kubernetes.core.k8s:
state: patched
api_version: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
name: "{{ volumesnapshotclass }}"
definition:
annotations:
k10.kasten.io/is-snapshot-class: "true"
loop: "{{ ocp4_workload_kasten_k10_volumesnapshotclasses }}"
loop_control:
loop_var: volumesnapshotclass

- name: Save AgnosticD user information for single user
when:
- ocp4_workload_kasten_k10_setup_demo | bool
Expand Down

0 comments on commit 3a2ac43

Please sign in to comment.