ansible-role-k8s-storage/tasks/main.yml
Adrien Reslinger d97acb68b0
All checks were successful
continuous-integration/drone/push Build is passing
Big update af the role
2022-03-03 12:06:46 +01:00

80 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
allowVolumeExpansion: true
when:
- storage_manual.enabled
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"