前提条件部署完k8s集群
1.首先在k8s集群部署naocs必须要采用存储,这边采用的是nfs存储
在master01上部署nfs-server
yum -y install nfs-utils
改配置文件
[root@k8s-master01 ~]# cat /etc/exports
/data/nfs-share *(rw,fsid=0,async,no_root_squash)
/data/mysql *(insecure,fsid=0,rw,async,no_root_squash) mysql采用自建的数据库不采用,挂载目录。
重启nfs服务
在k8s-node01上部署nfs-server,重启服务
[root@k8s-master01 nfs]# cat rbac.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: nfs-client-provisioner-runner
rules:
- apiGroups: [“”]
resources: [“persistentvolumes”]
verbs: [“get”, “list”, “watch”, “create”, “delete”] - apiGroups: [“”]
resources: [“persistentvolumeclaims”]
verbs: [“get”, “list”, “watch”, “update”] - apiGroups: [“”]
resources: [“endpoints”]
verbs: [“get”, “list”, “watch”, “create”, “update”, “patch”] - apiGroups: [“storage.k8s.io”]
resources: [“storageclasses”]
verbs: [“get”, “list”, “watch”] - apiGroups: [“”]
resources: [“events”]
verbs: [“create”, “update”, “patch”]
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: run-nfs-client-provisioner
subjects:
- kind: ServiceAccount
name: nfs-client-provisioner
namespace: default
roleRef:
kind: ClusterRole
name: nfs-clien