Skip to content

Commit

Permalink
fix 阿里云nas动态pv脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Nov 6, 2018
1 parent f4b8a01 commit 69001e8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
18 changes: 9 additions & 9 deletions roles/cluster-storage/tasks/alicloud-nas.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
- name: 准备alicloud-nas配置目录
file: name={{ base_dir }}/manifests/storage/alicloud-nas state=directory
file: name=/opt/kube/kube-system/storage/alicloud-nas state=directory

- name: 生成alicloud-nas动态存储配置
template:
src: alicloud-nas/alicloud-nas.yaml.j2
dest: "{{ base_dir }}/manifests/storage/alicloud-nas/{{ storage.aliyun_nas.controller_name }}.yaml"
dest: "/opt/kube/kube-system/storage/alicloud-nas/{{ storage.aliyun_nas.controller_name }}.yaml"

- name: 复制alicloud-disk配置
copy:
src: alicloud-disk.yaml
dest: "{{ base_dir }}/manifests/storage/alicloud-nas/alicloud-disk.yaml"
#- name: 复制alicloud-disk配置
# copy:
# src: alicloud-disk.yaml
# dest: "{{ base_dir }}/manifests/storage/alicloud-nas/alicloud-disk.yaml"

- name: 开始部署alicloud-disk存储
shell: "{{ bin_dir }}/kubectl apply -f {{ base_dir }}/manifests/storage/alicloud-nas/alicloud-disk.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/{{ storage.aliyun_nas.controller_name }}.yaml"
shell: "{{ bin_dir }}/kubectl apply -f /opt/kube/kube-system/storage/alicloud-nas/{{ storage.aliyun_nas.controller_name }}.yaml"
18 changes: 18 additions & 0 deletions roles/cluster-storage/templates/alicloud-nas/alicloud-nas.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ metadata:
name: alicloud-nas-controller
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: alicloud-disk-controller-runner
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
Expand Down

0 comments on commit 69001e8

Please sign in to comment.