ansible-role-k8s-storage/tasks/main.yml
Adrien Reslinger cf4bab4db7
All checks were successful
continuous-integration/drone/push Build is passing
Change Secrets Store deployment
2021-04-03 14:32:31 +02:00

79 lines
2 KiB
YAML

- name: Local Path setup
block:
- name: Define Manual StorageClass
k8s:
state: present
context: "{{ my_context }}"
definition:
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: manual
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
when:
- storage_manual|bool
tags:
- manual
- storage
- include_tasks: "local-path.yml"
tags:
- local-path
- storage
- include_tasks: "longhorn.yml"
tags:
- longhorn
- storage
- include_tasks: "nfs.yml"
tags:
- nfs
- storage
- include_tasks: "secrets-store.yml"
tags:
- secrets-store
- storage
# https://medium.com/asl19-developers/create-readwritemany-persistentvolumeclaims-on-your-kubernetes-cluster-3a8db51f98e3
# https://github.com/ctrox/csi-s3
# https://github.com/kahing/goofys
# https://github.com/reactr-io/gocachefs
# - include_tasks: "digital_ocean.yml"
# - include_tasks: "linode.yml"
- name: Select the default StorageClass
k8s:
state: present
context: "{{ my_context }}"
definition:
apiVersion: v1
kind: StorageClass
metadata:
name: "{{ storage_default_storageclass }}"
annotations:
storageclass.kubernetes.io/is-default-class: "true"
when:
- storage_default_storageclass is defined
tags:
- manual
- local-path
- nfs
- longhorn
- storage
- name: Select the default VolumeSnapshotClass
k8s:
state: present
context: "{{ my_context }}"
definition:
apiVersion: v1
kind: VolumeSnapshotClass
metadata:
name: "{{ storage_default_storageclass }}"
annotations:
snapshot.storage.kubernetes.io/is-default-class: "true"
when:
- storage_default_storageclass is defined
- storage_default_storageclass == "do-block-storage"