nfs-provisioner WIP
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Adrien Reslinger 2020-07-12 00:49:52 +02:00
parent 8dd47900cf
commit 7f0a136cf7
13 changed files with 265 additions and 0 deletions

32
tasks/nfs.yml Normal file
View file

@ -0,0 +1,32 @@
---
# https://github.com/kubernetes-incubator/external-storage/blob/master/nfs/docs/deployment.md
# Ne pas oublier de "sudo chcon -Rt svirt_sandbox_file_t /srv" pour le stockage
# ou alors tourner le container en privileged
- name: Defined nfs-provisioner state to present
set_fact:
storage_nfs_state: present
when:
- storage_nfs|bool
- name: find state of nfs-provisioner
set_fact:
storage_nfs_state: absent
when:
- not storage_nfs|bool
- name: nfs-provisioner need to be {{ storage_nfs_state }}
k8s:
state: "{{ storage_nfs_state }}"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('file', item) | from_yaml }}"
with_items:
- "nfs/nfs-provisioner-PodSecurityPolicy.yaml"
- "nfs/nfs-provisioner-runner-ClusterRole.yaml"
- "nfs/run-nfs-provisioner-ClusterRoleBinding.yaml"
- "nfs/leader-locking-nfs-provisioner-Role.yaml"
- "nfs/leader-locking-nfs-provisioner-RoleBinding.yaml"
- "nfs/nfs-provisioner-ServiceAccount.yaml"
- "nfs/nfs-provisioner-Service.yaml"
- "nfs/nfs-provisioner-Deployment.yaml"
- "nfs/example-nfs-StorageClass.yaml"