K8S部署Redis单节点Rdb数据长久化故障演练恢复

创建rbac.yaml 文件
 
root@k8s-master1:pvc # cat rbac.yaml  
kind: ServiceAccount 
apiVersion: v1 
metadata: 
  name: nfs-client-provisioner 
--- 
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: ["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-client-provisioner-runner 
  apiGroup: rbac.authorization.k8s.io 
--- 
kind: Role 
apiVersion: rbac.authorization.k8s.io/v1 
metadata: 
  name: leader-locking-nfs-client-provisioner 
rules: 
  - apiGroups: [""] 
    resources: ["endpoints"] 
    verbs: ["get", "list", "watch", "create", "update", "patch"] 
--- 
kind: RoleBinding 
apiVersion: rbac.authorization.k8s.io/v1 
metadata: 
  name: leader-locking-nfs-client-provisioner 
subjects: 
  - kind: ServiceAccount 
    name: nfs-client-provisioner 
    # replace with namespace where provisioner is deployed 
    namespace: default 
roleRef: 
  kind: Role 
  name: leader-locking-nfs-client-provisioner 
  apiGroup: rbac.authorization.k8s.io 

dawei

【声明】:站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。