Skip to content

Commit

Permalink
Switch to piraeus.io helm chart for CSI snapshot controller
Browse files Browse the repository at this point in the history
  • Loading branch information
sd109 authored and mkjpryor committed Dec 1, 2023
1 parent afbe394 commit b8a8987
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
22 changes: 14 additions & 8 deletions roles/velero/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,20 @@ velero_s3_creds_secret_name: velero-s3-config
velero_aws_access_key_id: "{{ undef(hint='velero_aws_access_key_id and velero_aws_secret_access_key must be set to provide credentials for the target object store') }}"
velero_aws_secret_access_key: "{{ undef(hint='velero_aws_access_key_id and velero_aws_secret_access_key must be set to provide credentials for the target object store') }}"


# Kubernetes CSI Snapshot controller config

# The source repo for the k8s snapshot controller
velero_k8s_snapshot_controller_repo: https://github.com/kubernetes-csi/external-snapshotter/

# The version of the snapshot controller to install
velero_k8s_snapshot_controller_git_version: release-6.2
# Kubernetes CSI Snapshot Controller config
velero_csi_snapshot_controller_chart_name: snapshot-controller
velero_csi_snapshot_controller_chart_repo: https://piraeus.io/helm-charts/
velero_csi_snapshot_controller_chart_version: 2.0.3
velero_csi_snapshot_controller_release_namespace: kube-system
velero_csi_snapshot_controller_release_name: csi-snapshot-controller
velero_csi_snapshot_controller_wait_timeout: 10m
velero_csi_snapshot_controller_release_defaults: {}
velero_csi_snapshot_controller_release_overrides: {}
velero_csi_snapshot_controller_release_values: >-
{{-
velero_csi_snapshot_controller_release_defaults |
combine(velero_csi_snapshot_controller_release_overrides, recursive = True)
}}
# The name to give to the installed volume snapshot class
velero_k8s_cinder_snapshot_class_name: cinder-csi-snapshot
Expand Down
27 changes: 11 additions & 16 deletions roles/velero/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@

- name: Check if CSI snapshot controller checkout exists
stat:
path: ~/external-snapshotter
register: external_snapshotter_checkout

- name: Clone CSI snapshot controller repo
ansible.builtin.command: git clone "{{ velero_k8s_snapshot_controller_repo }}" external-snapshotter
when: not external_snapshotter_checkout.stat.exists

- name: Ensure CSI snapshot controller is deployed
# Adapted from https://kubernetes-csi.github.io/docs/snapshot-controller.html
ansible.builtin.shell: |
cd ./external-snapshotter
git checkout "{{ velero_k8s_snapshot_controller_git_version }}"
kubectl kustomize client/config/crd | kubectl apply -f -
kubectl -n kube-system kustomize deploy/kubernetes/snapshot-controller | kubectl apply -f -
- name: Ensure CSI-snapshot-controller Helm chart is installed
kubernetes.core.helm:
chart_ref: "{{ velero_csi_snapshot_controller_chart_name }}"
chart_repo_url: "{{ velero_csi_snapshot_controller_chart_repo }}"
chart_version: "{{ velero_csi_snapshot_controller_chart_version }}"
release_namespace: "{{ velero_csi_snapshot_controller_release_namespace }}"
release_name: "{{ velero_csi_snapshot_controller_release_name }}"
release_values: "{{ velero_csi_snapshot_controller_release_values }}"
atomic: yes
wait: yes
wait_timeout: "{{ velero_csi_snapshot_controller_wait_timeout }}"

- name: Template Cinder VolumeSnapshotClass definition onto host
ansible.builtin.template:
Expand Down

0 comments on commit b8a8987

Please sign in to comment.