2 Star 11 Fork 19

owen/mysql-kubernetes

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
nfs-client-provisioner.yaml 2.32 KB
一键复制 编辑 原始数据 按行查看 历史
owen 提交于 2021-01-16 21:36 . update
apiVersion: v1
kind: ServiceAccount
metadata:
name: nfs-client-provisioner
namespace: kube-system
---
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: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["list", "watch", "create", "update", "patch"]
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["create", "delete", "get", "list", "watch", "patch", "update"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: run-nfs-client-provisioner
subjects:
- kind: ServiceAccount
name: nfs-client-provisioner
namespace: kube-system
roleRef:
kind: ClusterRole
name: nfs-client-provisioner-runner
apiGroup: rbac.authorization.k8s.io
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: nfs-client-provisioner
namespace: kube-system
spec:
selector:
matchLabels:
app: nfs-client-provisioner
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: nfs-client-provisioner
spec:
serviceAccountName: nfs-client-provisioner
hostNetwork: true
containers:
- name: nfs-client-provisioner
image: 10.1.2.10:5000/nfs-client-provisioner:latest
imagePullPolicy: IfNotPresent
volumeMounts:
- name: nfs-client-root # 根据自己的名称来修改,与 storageclass.yaml 中的 provisioner 名字一致
mountPath: /persistentvolumes
env:
- name: PROVISIONER_NAME
value: nfs-client-provisioner
- name: NFS_SERVER
value: 10.1.2.20 # NFS服务器所在的 ip
- name: NFS_PATH
value: /nfs # 共享存储目录
volumes:
- name: nfs-client-root
nfs:
server: 10.1.2.20
path: /nfs
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: nfs-client-provisioner
provisioner: nfs-client-provisioner
reclaimPolicy: Delete
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/owen_tao/mysql-kubernetes.git
git@gitee.com:owen_tao/mysql-kubernetes.git
owen_tao
mysql-kubernetes
mysql-kubernetes
master

搜索帮助