当前位置: 首页 > news >正文

K8s使用nfs

改动点

  1. ip和路径改为自己的
---
apiVersion: v1
kind: ServiceAccount
metadata:name: nfs-client-provisioner# replace with namespace where provisioner is deployednamespace: nfs-client
---
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: ServiceAccountname: nfs-client-provisioner# replace with namespace where provisioner is deployednamespace: nfs-client
roleRef:kind: ClusterRolename: nfs-client-provisioner-runnerapiGroup: rbac.authorization.k8s.io
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:name: leader-locking-nfs-client-provisioner# replace with namespace where provisioner is deployednamespace: nfs-client
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# replace with namespace where provisioner is deployednamespace: nfs-client
subjects:- kind: ServiceAccountname: nfs-client-provisioner# replace with namespace where provisioner is deployednamespace: nfs-client
roleRef:kind: Rolename: leader-locking-nfs-client-provisionerapiGroup: rbac.authorization.k8s.io---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:name: managed-nfs-storage
provisioner: k8s-sigs.io/nfs-subdir-external-provisioner # or choose another name, must match deployment's env PROVISIONER_NAME'
parameters:archiveOnDelete: "false"---
apiVersion: apps/v1
kind: Deployment
metadata:name: nfs-client-provisionerlabels:app: nfs-client-provisioner# replace with namespace where provisioner is deployednamespace: nfs-client
spec:replicas: 1strategy:type: Recreateselector:matchLabels:app: nfs-client-provisionertemplate:metadata:labels:app: nfs-client-provisionerspec:serviceAccountName: nfs-client-provisionercontainers:- name: nfs-client-provisionerimage: gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner:v4.0.0volumeMounts:- name: nfs-client-rootmountPath: /persistentvolumesenv:- name: PROVISIONER_NAMEvalue: k8s-sigs.io/nfs-subdir-external-provisioner# value: fuseim.pri/ifs- name: NFS_SERVERvalue: 10.101.4.78- name: NFS_PATHvalue: /data/nfs/kubedatavolumes:- name: nfs-client-rootnfs:server: 10.101.4.78path: /data/nfs/kubedata

参考链接

https://www.cnblogs.com/lina-2159/p/16136317.html

http://www.lryc.cn/news/479960.html

相关文章:

  • 【大数据学习 | kafka高级部分】kafka的kraft集群
  • 爬虫策略规避:Python爬虫的浏览器自动化
  • Hive 实现查询用户连续三天登录记录
  • OceanBase 4.3.3 功能解析:列存副本
  • 2.Python解释器
  • 鸿蒙与团结引擎c#与ts简单交互
  • Any 的原理以及实现
  • SQLI LABS | Less-35 GET-Bypass Add Slashes (we dont need them) Integer Based
  • RNN(循环神经网络)详解
  • 【AI抠图整合包及教程】探索SAM 2:图像与视频分割领域的革新者
  • DevExpress中文教程 - 如何使用AI模型检查HTML编辑中的语法?
  • python包管理工具pip和conda的使用对比
  • Linux案例:DNS服务器配置
  • 【Python】__getitem__()方法
  • 《Atomic Picnic》进不去游戏解决方法
  • 学习日志007--python函数 学完再练习练
  • DOM操作和事件监听综合练习——轮播图
  • nodejs:下载,安装,系统环境配置,更换镜像
  • 【Django】视图函数
  • MySQL查询-补充
  • 【Python Tips】多个条件判断——一种更加简洁清晰的写法
  • 【Vue】简易博客项目跟做
  • 【HarmonyOS】PixelMap转化为Uri
  • 【架构论文-2】架构设计中存在的问题和改进方向
  • go语言中的结构体含义和用法详解
  • 985研一学习日记 - 2024.11.8
  • 编写一个基于React的聊天室
  • [前端]NodeJS常见面试题目
  • 【实测可用】Sublime Text4 4180 windows 已测可用
  • JAVA日期加减运算 JsonObject 转换对象List