Add linode block storage

This commit is contained in:
Adrien Reslinger 2020-04-22 16:11:23 +02:00
parent 7cb826a8f1
commit a314988c99
22 changed files with 602 additions and 2 deletions

54
tasks/linode.yml Normal file
View file

@ -0,0 +1,54 @@
---
# https://github.com/linode/linode-blockstorage-csi-driver
- name: Defined linode-storage state to present
set_fact:
storage_linode_state: present
when:
- storage_linode|bool
- name: find state of linode-storage
set_fact:
storage_linode_state: absent
when:
- not storage_linode|bool
- name: Add secret for Linode Access Key
k8s:
state: "{{ storage_linode_state }}"
context: "{{ my_context }}"
definition:
apiVersion: v1
kind: Secret
metadata:
name: linode
namespace: kube-system
type: Opaque
stringData:
token: "{{ LINODE_TOKEN }}"
region: "{{ LINODE_REGION }}"
- name: linode-storage need to be {{ storage_linode_state }}
k8s:
state: "{{ storage_linode_state }}"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('file', item) | from_yaml }}"
with_items:
- "linode/csinodeinfos.csi.storage.k8s.io-CustomResourceDefinition.yaml"
- "linode/csidrivers.csi.storage.k8s.io-CustomResourceDefinition.yaml"
- "linode/csi-node-sa-ServiceAccount.yaml"
- "linode/driver-registrar-role-ClusterRole.yaml"
- "linode/driver-registrar-binding-ClusterRoleBinding.yaml"
- "linode/csi-controller-sa-ServiceAccount.yaml"
- "linode/external-provisioner-role-ClusterRole.yaml"
- "linode/csi-controller-provisioner-binding-ClusterRoleBinding.yaml"
- "linode/external-attacher-role-ClusterRole.yaml"
- "linode/csi-controller-attacher-binding-ClusterRoleBinding.yaml"
- "linode/external-snapshotter-role-ClusterRole.yaml"
- "linode/csi-controller-snapshotter-binding-ClusterRoleBinding.yaml"
- "linode/linodebs.csi.linode.com-CSIDriver.yaml"
- "linode/linode-block-storage-StorageClass.yaml"
- "linode/linode-block-storage-retain-StorageClass.yaml"
- "linode/csi-linode-controller-StatefulSet.yaml"
- "linode/csi-linode-node-DaemonSet.yaml"
- "linode/get-linode-id-ConfigMap.yaml"

View file

@ -1,6 +1,7 @@
- name: Local Path setup
block:
- include_tasks: "local.yml"
- include_tasks: "linode.yml"
- name: Select the default StorageClass
k8s: