Default OpenStack Cinder Storage Class (#2083)
Add possibility to create default OpenStack Cinder Storage Class Closes: #1609
This commit is contained in:
parent
bfb25fa47b
commit
b2cb0725ac
7 changed files with 49 additions and 0 deletions
|
@ -159,6 +159,9 @@ istio_enabled: false
|
|||
# Local volume provisioner deployment
|
||||
local_volumes_enabled: false
|
||||
|
||||
# Add Persistent Volumes Storage Class for corresponding cloud provider ( OpenStack is only supported now )
|
||||
persistent_volumes_enabled: false
|
||||
|
||||
# Make a copy of kubeconfig on the host that runs Ansible in GITDIR/artifacts
|
||||
# kubeconfig_localhost: false
|
||||
# Download kubectl onto the host that runs Ansible in GITDIR/artifacts
|
||||
|
|
|
@ -33,3 +33,8 @@ dependencies:
|
|||
tags:
|
||||
- apps
|
||||
- istio
|
||||
- role: kubernetes-apps/persistent_volumes
|
||||
when: persistent_volumes_enabled
|
||||
tags:
|
||||
- apps
|
||||
- persistent_volumes
|
||||
|
|
8
roles/kubernetes-apps/persistent_volumes/meta/main.yml
Normal file
8
roles/kubernetes-apps/persistent_volumes/meta/main.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
dependencies:
|
||||
- role: kubernetes-apps/persistent_volumes/openstack
|
||||
when:
|
||||
- cloud_provider is defined
|
||||
- cloud_provider in [ 'openstack' ]
|
||||
tags:
|
||||
- persistent_volumes_openstack
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
persistent_volumes_enabled: false
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
- name: Kubernetes Persistent Volumes | Lay down OpenStack Cinder Storage Class template
|
||||
template:
|
||||
src: "{{item.file}}"
|
||||
dest: "{{kube_config_dir}}/{{item.file}}"
|
||||
with_items:
|
||||
- {file: openstack-storage-class.yml, type: StorageClass, name: storage-class }
|
||||
register: manifests
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
||||
|
||||
- name: Kubernetes Persistent Volumes | Add OpenStack Cinder Storage Class
|
||||
kube:
|
||||
name: "{{item.item.name}}"
|
||||
kubectl: "{{bin_dir}}/kubectl"
|
||||
resource: "{{item.item.type}}"
|
||||
filename: "{{kube_config_dir}}/{{item.item.file}}"
|
||||
state: "latest"
|
||||
with_items: "{{ manifests.results }}"
|
||||
when:
|
||||
- inventory_hostname == groups['kube-master'][0]
|
|
@ -0,0 +1,9 @@
|
|||
kind: StorageClass
|
||||
apiVersion: storage.k8s.io/v1
|
||||
metadata:
|
||||
name: standard
|
||||
annotations:
|
||||
storageclass.kubernetes.io/is-default-class: "true"
|
||||
provisioner: kubernetes.io/cinder
|
||||
parameters:
|
||||
availability: nova
|
|
@ -144,6 +144,7 @@ helm_enabled: false
|
|||
istio_enabled: false
|
||||
enable_network_policy: false
|
||||
local_volumes_enabled: false
|
||||
persistent_volumes_enabled: false
|
||||
|
||||
# Base path for local volume provisioner addon
|
||||
local_volume_base_dir: /mnt/disks
|
||||
|
|
Loading…
Reference in a new issue