mirror of https://github.com/easzlab/kubeasz.git
Merge branch 'storage' into dev
commit
f239533d1b
|
@ -31,8 +31,3 @@ heapster_offline: "heapster_v1.5.1.tar"
|
|||
|
||||
# prometheus 自动安装
|
||||
#prometheus_install: "no"
|
||||
|
||||
# 动态存储自动安装
|
||||
nfsclient_install: "no"
|
||||
alicloudnas_install: "no"
|
||||
storage_install: "no"
|
||||
|
|
|
@ -79,32 +79,3 @@
|
|||
when: '"heapster" not in pod_info.stdout and heapster_install == "yes"'
|
||||
ignore_errors: true
|
||||
|
||||
- block:
|
||||
- name: 准备部署nfs-client动态存储
|
||||
template:
|
||||
src: storage/nfs/nfs-client-provisioner.yaml.j2
|
||||
dest: "{{ base_dir }}/manifests/storage/nfs/nfs-client-provisioner.yaml"
|
||||
- name: 开始部署nfs-client动态存储
|
||||
shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/nfs/nfs-client-provisioner.yaml"
|
||||
when: 'nfsclient_install == "yes"'
|
||||
|
||||
- block:
|
||||
- name: 准备部署alicloud-nas动态存储
|
||||
template:
|
||||
src: storage/alicloud-nas/alicloud-nas.yaml.j2
|
||||
dest: "{{ base_dir }}/manifests/storage/alicloud-nas/alicloud-nas.yaml"
|
||||
- name: 开始部署alicloud-disk存储
|
||||
shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/alicloud-nas/alicloud-disk.yaml"
|
||||
- name: 开始部署alicloud-nas动态存储
|
||||
shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/alicloud-nas/alicloud-nas.yaml"
|
||||
when: 'alicloudnas_install == "yes"'
|
||||
|
||||
- block:
|
||||
- name: 准备部署动态存储类
|
||||
template:
|
||||
src: storage/dynamic-storageclass.yaml.j2
|
||||
dest: "{{ base_dir }}/manifests/storage/dynamic-storageclass.yaml"
|
||||
- name: 开始部署动态存储类
|
||||
shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/dynamic-storageclass.yaml"
|
||||
when: 'storage_install == "yes"'
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
hosts: deploy
|
||||
roles:
|
||||
- cluster-storage
|
||||
vars:
|
||||
storage_type: nfs
|
||||
storage_server: 172.16.3.86
|
||||
storage_path: /data/nfs
|
||||
storage_class_name: nfs-dynamic-class
|
|
@ -0,0 +1,5 @@
|
|||
# 动态存储类型, 目前支持nfs和alicloud-nas
|
||||
storage_type: nfs
|
||||
storage_server: 172.16.3.86
|
||||
storage_path: /data/nfs
|
||||
storage_class_name: nfs-dynamic-class
|
|
@ -0,0 +1,27 @@
|
|||
- block:
|
||||
- name: 准备部署nfs-client动态存储
|
||||
template:
|
||||
src: nfs/nfs-client-provisioner.yaml.j2
|
||||
dest: "{{ base_dir }}/manifests/storage/nfs/nfs-client-provisioner.yaml"
|
||||
- name: 开始部署nfs-client动态存储
|
||||
shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/nfs/nfs-client-provisioner.yaml"
|
||||
when: 'storage_type == "nfs"'
|
||||
|
||||
- block:
|
||||
- name: 准备部署alicloud-nas动态存储
|
||||
template:
|
||||
src: alicloud-nas/alicloud-nas.yaml.j2
|
||||
dest: "{{ base_dir }}/manifests/storage/alicloud-nas/alicloud-nas.yaml"
|
||||
- name: 开始部署alicloud-disk存储
|
||||
shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/alicloud-nas/alicloud-disk.yaml"
|
||||
- name: 开始部署alicloud-nas动态存储
|
||||
shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/alicloud-nas/alicloud-nas.yaml"
|
||||
when: 'storage_type == "alicloud-nas"'
|
||||
|
||||
- block:
|
||||
- name: 准备部署动态存储类
|
||||
template:
|
||||
src: dynamic-storageclass.yaml.j2
|
||||
dest: "{{ base_dir }}/manifests/storage/dynamic-storageclass.yaml"
|
||||
- name: 开始部署动态存储类
|
||||
shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/dynamic-storageclass.yaml"
|
|
@ -48,11 +48,11 @@ spec:
|
|||
- name: PROVISIONER_NAME
|
||||
value: alicloud/nas
|
||||
- name: NFS_SERVER
|
||||
value: {{ STORAGE_SERVER }}
|
||||
value: {{ storage_server }}
|
||||
- name: NFS_PATH
|
||||
value: {{ STORAGE_PATH }}
|
||||
value: {{ storage_path }}
|
||||
volumes:
|
||||
- name: nfs-client-root
|
||||
nfs:
|
||||
server: {{ STORAGE_SERVER }}
|
||||
path: {{ STORAGE_PATH }}
|
||||
server: {{ storage_server }}
|
||||
path: {{ storage_path }}
|
|
@ -1,5 +1,5 @@
|
|||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: {{ STORAGE_CLASS_NAME }}
|
||||
name: {{ storage_class_name }}
|
||||
provisioner: prov
|
|
@ -69,11 +69,11 @@ spec:
|
|||
# 此处供应者名字供storageclass调用
|
||||
value: prov
|
||||
- name: NFS_SERVER
|
||||
value: {{ STORAGE_SERVER }}
|
||||
value: {{ storage_server }}
|
||||
- name: NFS_PATH
|
||||
value: {{ STORAGE_PATH }}
|
||||
value: {{ storage_path }}
|
||||
volumes:
|
||||
- name: nfs-client-root
|
||||
nfs:
|
||||
server: {{ STORAGE_SERVER }}
|
||||
path: {{ STORAGE_PATH }}
|
||||
server: {{ storage_server }}
|
||||
path: {{ storage_path }}
|
Loading…
Reference in New Issue