infrastructure/k8s/roles/cifs-csi/tasks/main.yml

49 lines
1.5 KiB
YAML
Raw Permalink Normal View History

2023-07-13 06:36:57 +00:00
---
- name: Add csi-driver-smb chart repo
kubernetes.core.helm_repository:
name: csi-driver-smb
repo_url: https://raw.githubusercontent.com/kubernetes-csi/csi-driver-smb/master/charts
- name: Deploy csi-driver-smb chart
kubernetes.core.helm:
name: csi-driver-smb
chart_ref: csi-driver-smb/csi-driver-smb
release_namespace: kube-system
chart_version: v1.11.0
update_repo_cache: true
values: {}
- name: Create StorageBox credentials secret
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Secret
metadata:
name: smbcreds
namespace: kube-system
data:
username: "{{ storage.cifs.username | b64encode }}"
password: "{{ storage.cifs.password | b64encode }}"
- name: Deploy StorageBox storage class
kubernetes.core.k8s:
state: present
definition:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: storage-box
provisioner: smb.csi.k8s.io
parameters:
source: "//u358507.your-storagebox.de/backup"
csi.storage.k8s.io/provisioner-secret-name: "smbcreds"
csi.storage.k8s.io/provisioner-secret-namespace: "kube-system"
csi.storage.k8s.io/node-stage-secret-name: "smbcreds"
csi.storage.k8s.io/node-stage-secret-namespace: "kube-system"
volumeBindingMode: Immediate
mountOptions:
- dir_mode=0770
- file_mode=0770
- uid=1001
- gid=1001