最新版Ceph( Reef版本)文件存储简单对接k8s(下集)

假如ceph集群已经创建

1.创建cephfs_pool存储池
ceph osd pool create fs_kube_data 16 162.创建cephfs_metadata存储池
ceph osd pool create fs_kube_metadata 16 163 创建cephfs
ceph fs new cephfs01 fs_kube_metadata fs_kube_data4 设置最大活动数
ceph fs set cephfs01 max_mds 25 创建卷子组(非常重要,reef版的文件存储多一步这个)
ceph fs subvolumegroup create cephfs01  myfsg

创建k8s访问cephfs的认证用户

#ceph auth get-or-create client.cephfs01 mon 'allow r' mds 'allow rw' osd 'allow rw pool=cephfs_data, allow rw pool=cephfs_metadata'# ceph auth get client.cephfs01
[client.cephfs01]key = AQAHRD9mmCOLCBAAb+gJ3WBM/KU/FbZEofGOJg==caps mds = "allow rw"caps mon = "allow r"caps osd = "allow rw pool=cephfs_data, allow rw pool=cephfs_metadata"#目前这个版本需要手动创建	# ceph auth get client.cephfs01 > /etc/ceph/ceph.client.cephfs01.keyring

本地测试挂载并创建目录

#目前这个版本需要手动创建	# ceph auth get client.cephfs01 > /etc/ceph/ceph.client.cephfs01.keyring#  mount.ceph ceph-163:6789:/ /mnt -o name=cephfs01,secret=AQAHRD9mmCOLCBAAb+gJ3WBM/KU/FbZEofGOJg==#挂着成功
# df -h | grep mnt
127.0.1.1:6789,192.168.0.163:6789:/  222G     0  222G   0% /mnt

在写你的外部config配置,如果不想使用,就不用写

cat <<EOF > config.yaml
apiVersion: v1
kind: ConfigMap
data:config.json: |-[{"clusterID": "588abbf6-0f74-11ef-ba10-bc2411f077b2","monitors": ["192.168.0.163:6789","192.168.0.164:6789","192.168.0.165:6789"],"cephFS": {"subVolumeGroup": "myfsg"}}]
metadata:name: ceph-csi-config
EOF

本次使用helm安装

请认真阅读完yaml在安装
# egrep -v "^#|^$" values.yaml
---
rbac:# Specifies whether RBAC resources should be createdcreate: true
serviceAccounts:nodeplugin:# Specifies whether a ServiceAccount should be createdcreate: true# The name of the ServiceAccount to use.# If not set and create is true, a name is generated using the fullnamename:provisioner:# Specifies whether a ServiceAccount should be createdcreate: true# The name of the ServiceAccount to use.# If not set and create is true, a name is generated using the fullnamename:
csiConfig:- clusterID: "588abbf6-0f74-11ef-ba10-bc2411f077b2"monitors:- "192.168.0.163:6789"- "192.168.0.164:6789"- "192.168.0.165:6789"cephFS:subvolumeGroup: "myfsg"#netNamespaceFilePath: "{{ .kubeletDir }}/plugins/{{ .driverName }}/net"
commonLabels: {}
logLevel: 5
sidecarLogLevel: 1
CSIDriver:fsGroupPolicy: "File"seLinuxMount: false
nodeplugin:name: nodeplugin# if you are using ceph-fuse client set this value to OnDeleteupdateStrategy: RollingUpdate# set user created priorityclassName for csi plugin pods. default is# system-node-critical which is highest prioritypriorityClassName: system-node-criticalhttpMetrics:# Metrics only available for cephcsi/cephcsi => 1.2.0# Specifies whether http metrics should be exposedenabled: true# The port of the container to expose the metricscontainerPort: 8081service:# Specifies whether a service should be created for the metricsenabled: true# The port to use for the serviceservicePort: 8080type: ClusterIP# Annotations for the service# Example:# annotations:#   prometheus.io/scrape: "true"#   prometheus.io/port: "9080"annotations: {}clusterIP: ""## List of IP addresses at which the stats-exporter service is available## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips##externalIPs: []loadBalancerIP: ""loadBalancerSourceRanges: []## Reference to one or more secrets to be used when pulling images##imagePullSecrets: []# - name: "image-pull-secret"profiling:enabled: falseregistrar:image:repository: registry.cn-shenzhen.aliyuncs.com/neway-sz/uattag: registrar-v2.10.1pullPolicy: IfNotPresentresources: {}plugin:image:repository: quay.io/cephcsi/cephcsi#tag: v3.11-canarytag: canarypullPolicy: IfNotPresentresources: {}nodeSelector: {}tolerations: []affinity: {}# Set to true to enable Ceph Kernel clients# on kernel < 4.17 which support quotas# forcecephkernelclient: true# common mount options to apply all mounting# example: kernelmountoptions: "recover_session=clean"kernelmountoptions: ""fusemountoptions: ""
provisioner:name: provisionerreplicaCount: 1strategy:# RollingUpdate strategy replaces old pods with new ones gradually,# without incurring downtime.type: RollingUpdaterollingUpdate:# maxUnavailable is the maximum number of pods that can be# unavailable during the update process.maxUnavailable: 50%# Timeout for waiting for creation or deletion of a volumetimeout: 60s# cluster name to set on the subvolume# clustername: "k8s-cluster-1"# set user created priorityclassName for csi provisioner pods. default is# system-cluster-critical which is less priority than system-node-criticalpriorityClassName: system-cluster-critical# enable hostnetwork for provisioner pod. default is false# useful for deployments where the podNetwork has no access to cephenableHostNetwork: falsehttpMetrics:# Metrics only available for cephcsi/cephcsi => 1.2.0# Specifies whether http metrics should be exposedenabled: true# The port of the container to expose the metricscontainerPort: 8081service:# Specifies whether a service should be created for the metricsenabled: true# The port to use for the serviceservicePort: 8080type: ClusterIP# Annotations for the service# Example:# annotations:#   prometheus.io/scrape: "true"#   prometheus.io/port: "9080"annotations: {}clusterIP: ""## List of IP addresses at which the stats-exporter service is available## Ref: https://kubernetes.io/docs/user-guide/services/#external-ips##externalIPs: []loadBalancerIP: ""loadBalancerSourceRanges: []## Reference to one or more secrets to be used when pulling images##imagePullSecrets: []# - name: "image-pull-secret"profiling:enabled: falseprovisioner:image:repository: registry.cn-shenzhen.aliyuncs.com/neway-sz/uattag: provisioner-v4.0.1pullPolicy: IfNotPresentresources: {}## For further options, check## https://github.com/kubernetes-csi/external-provisioner#command-line-optionsextraArgs: []# set metadata on volumesetmetadata: trueresizer:name: resizerenabled: trueimage:repository: registry.cn-shenzhen.aliyuncs.com/neway-sz/uattag: resizer-v1.10.1pullPolicy: IfNotPresentresources: {}## For further options, check## https://github.com/kubernetes-csi/external-resizer#recommended-optional-argumentsextraArgs: []snapshotter:image:repository: registry.cn-shenzhen.aliyuncs.com/neway-sz/uattag: snapshotter-v7.0.2pullPolicy: IfNotPresentresources: {}## For further options, check## https://github.com/kubernetes-csi/external-snapshotter#csi-external-snapshotter-sidecar-command-line-optionsextraArgs: []args:# enableVolumeGroupSnapshots enables support for volume group snapshotsenableVolumeGroupSnapshots: falsenodeSelector: {}tolerations: []affinity: {}
selinuxMount: false
storageClass:# Specifies whether the Storage class should be createdcreate: truename: csi-cephfs-sc# Annotations for the storage class# Example:# annotations:#   storageclass.kubernetes.io/is-default-class: "true"annotations: {}# String representing a Ceph cluster to provision storage from.# Should be unique across all Ceph clusters in use for provisioning,# cannot be greater than 36 bytes in length, and should remain immutable for# the lifetime of the StorageClass in use.clusterID: 588abbf6-0f74-11ef-ba10-bc2411f077b2# (required) CephFS filesystem name into which the volume shall be created# eg: fsName: myfsfsName: cephfs01# (optional) Ceph pool into which volume data shall be stored# pool: <cephfs-data-pool># For eg:# pool: "replicapool"#pool: "fs_kube_data"# (optional) Comma separated string of Ceph-fuse mount options.# For eg:# fuseMountOptions: debugfuseMountOptions: ""# (optional) Comma separated string of Cephfs kernel mount options.# Check man mount.ceph for mount options. For eg:# kernelMountOptions: readdir_max_bytes=1048576,norbyteskernelMountOptions: ""# (optional) The driver can use either ceph-fuse (fuse) or# ceph kernelclient (kernel).# If omitted, default volume mounter will be used - this is# determined by probing for ceph-fuse and mount.ceph# mounter: kernelmounter: ""# (optional) Prefix to use for naming subvolumes.# If omitted, defaults to "csi-vol-".# volumeNamePrefix: "foo-bar-"volumeNamePrefix: ""# The secrets have to contain user and/or Ceph admin credentials.provisionerSecret: csi-cephfs-secret# If the Namespaces are not specified, the secrets are assumed to# be in the Release namespace.provisionerSecretNamespace: ""controllerExpandSecret: csi-cephfs-secretcontrollerExpandSecretNamespace: ""nodeStageSecret: csi-cephfs-secretnodeStageSecretNamespace: ""reclaimPolicy: DeleteallowVolumeExpansion: truemountOptions:# Mount Options# Example:#mountOptions:- discard
secret:# Specifies whether the secret should be createdcreate: truename: csi-cephfs-secretannotations: {}# Key values correspond to a user name and its key, as defined in the# ceph cluster. User ID should have required access to the 'pool'# specified in the storage classuserID: cephfs01userKey: AQAHRD9mmCOLCBAAb+gJ3WBM/KU/FbZEofGOJg==adminID: adminadminKey: AQASMz9mgVCqNxAABEAu/WYy0gaEcTC5zC60Ug==
cephconf: |[global]auth_cluster_required = cephxauth_service_required = cephxauth_client_required = cephx# ceph-fuse which uses libfuse2 by default has write buffer size of 2KiB# adding 'fuse_big_writes = true' option by default to override this limit# see https://github.com/ceph/ceph-csi/issues/1928#fuse_big_writes = true
extraDeploy: []
provisionerSocketFile: csi-provisioner.sock
pluginSocketFile: csi.sock
kubeletDir: /var/lib/kubelet
driverName: cephfs.csi.ceph.com
configMapName: ceph-csi-config
externallyManagedConfigmap: false   <<<<----如果你是外部config文件就改成true
cephConfConfigMapName: ceph-config

最后部署你的csi驱动

helm 安装包点击下载

链接:分享文件:ceph-csi-cephfs-3.11.0.tgz

 helm install -n ceph-csi-cephfs ceph-csi-cephfs ceph-csi-cephfs-3.11.0.tgz -f values.yaml

在这里插入图片描述

编辑一个demon

cat <<EOF > pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:name: csi-cephfs-pvc
spec:accessModes:- ReadWriteManyresources:requests:storage: 1GistorageClassName: csi-cephfs-sc
EOF

不在解释了

# kubectl get pvc
NAME             STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS    AGE
csi-cephfs-pvc   Bound    pvc-e29b9393-9473-4c59-b981-0e24d5835018   1Gi        RWX            csi-cephfs-sc   31m

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/835806.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

fatal: fetch-pack: invalid index-pack output

解决方案&#xff1a;git clone --depth1 要克隆的git地址 下载最近一次提交的代码 其他分支的内容都不下载 这样整体下载体量就变小了 执行命令&#xff1a;git clone --depth 1 https://gitlab.scm321.com/ufx/xxxx.git

Mac idea gradle解决异常: SSL peer shut down incorrectly

系统&#xff1a;mac 软件&#xff1a;idea 解决异常: SSL peer shut down incorrectly 查看有没有安装 gradle -v安装 根据项目gradle提示安装版本 brew install gradle7idea的配置 在settings搜索gradle&#xff0c;配置Local installation&#xff0c;选择自己的安装目录…

机器学习入门到放弃2:朴素贝叶斯

1. 算法介绍 1.1 算法定义 朴素贝叶斯分类&#xff08;NBC&#xff09;是以贝叶斯定理为基础并且假设特征条件之间相互独立的方法&#xff0c;先通过已给定的训练集&#xff0c;以特征词之间独立作为前提假设&#xff0c;学习从输入到输出的联合概率分布&#xff0c;再基于学习…

物联网SCI期刊,潜力新刊,审稿速度快,收稿范围广泛!

一、期刊名称 Internet of Things 二、期刊简介概况 期刊类型&#xff1a;SCI 学科领域&#xff1a;物联网 影响因子&#xff1a;5.9 中科院分区&#xff1a;3区 出版方式&#xff1a;订阅模式/开放出版 版面费&#xff1a;选择开放出版需支付$2310 三、期刊征稿范围 I…

PTP 对时协议 IEEE1588 网络对时 计算原理

前言 本文将阐述 PTP 对时协议的原理&#xff0c;slave 节点如何根据获取的时间来纠正和更新自己的时间。 协议概述 整个通讯过程中会发送 4 种类型的数据包&#xff0c;用来支撑对时。下面是 4 个包的解释 Sync message: 由 master 发送&#xff0c;发起对时事务, slave 接…

Java - Json字符串转List<LinkedHashMap<String,String>>

需求&#xff1a;在处理数据时&#xff0c;需要将一个Object类型对象集合转为有序的Map类型集合。 一、问题 1.原代码&#xff1a; 但在使用时出现报错&#xff1a; Incompatible equality constraint: LinkedHashMap<String, String> and LinkedHashMap 不兼容的相等…

副产物四氯化硅综合利用满足可持续发展需求 行业发展意义重大

副产物四氯化硅综合利用满足可持续发展需求 行业发展意义重大 副产物四氯化硅综合利用&#xff0c;是以工业&#xff08;主要是多晶硅行业&#xff09;副产物四氯化硅为原料&#xff0c;制备高价值化学品的过程&#xff0c;可保护环境不受污染&#xff0c;同时实现废物资源化再…

JavaScript APIs

控制网页元素交互等各种网页交互效果。 一、Web API基本认知 声明数组和变量优先使用const 使用let声明变量的情况&#xff1a; 1、如果基本数据类型的值或者引用类型的地址发生变化的时候&#xff0c;需要用let 2、比如 一个变量进行加减运算&#xff0c;比如 for循环中的…

Linux日常管理和服务器配置(二)

一、在系统中配置FTP服务器&#xff1a; 准备工作&#xff1a; a.下载ftp命令 sudo apt install vsftpd 可以先用命令更新一下库 sudo apt-get update 接着输入 systemctl status vsftpd 检查ftp运行状态 然后进入vsftpd.conf文件中修改write为 vim /etc/vsftpdf.conf …

深入理解指针(1)

在之前我们学习了许多c语言的基础知识&#xff0c;让我们初步了解了c语言&#xff0c;接下来将来到c语言中一个重点的知识章节--指针&#xff0c;学习完指针后将会让我们对c语言有更深入的理解&#xff0c;接下来就开始指针的讲解 1.内存与地址 1.指针 在了解内存与地址前&am…

vue开发网站—①调用$notify弹窗、②$notify弹窗层级问题、③js判断两个数组是否相同等。

一、vue中如何使用vant的 $notify&#xff08;展示通知&#xff09; 在Vue中使用Vant组件库的$notify方法来展示通知&#xff0c;首先确保正确安装了Vant并在项目中引入了Notify组件。 1.安装vant npm install vant --save# 或者使用yarn yarn add vant2.引入&#xff1a;在ma…

词令蚂蚁新村今日答案:微信小程序怎么查看蚂蚁新村今天问题的正确答案?

微信小程序怎么查看蚂蚁新村今天问题的正确答案&#xff1f; 1、打开微信&#xff0c;点击搜索框&#xff1b; 2、打开搜索页面&#xff0c;选择小程序搜索&#xff1b; 3、在搜索框&#xff0c;输入词令搜索点击进入词令微信小程序&#xff1b; 4、打开词令微信小程序关键词口…

Python专题:九、元组

append&#xff08;&#xff09;函数添加列表元素 remove&#xff08;&#xff09;函数移除列表元素 数据存储知识 变量保存的就是数据在内存中的地址 id()函数查看变量存储地址 动态分配 内存地址是动态分配的&#xff0c;每次的数值不一致 copy&#xff08;&#xff09;函…

redis的双写一致性

双写一致性问题 1.先删除缓存或者先修改数据库都可能出现脏数据。 2.删除两次缓存&#xff0c;可以在一定程度上降低脏数据的出现。 3.延时是因为数据库一般采用主从分离&#xff0c;读写分离。延迟一会是让主节点把数据同步到从节点。 1.读写锁保证数据的强一致性 因为一般放…

音视频入门基础:像素格式专题(2)——不通过第三方库将RGB24格式视频转换为BMP格式图片

音视频入门基础&#xff1a;像素格式专题系列文章&#xff1a; 音视频入门基础&#xff1a;像素格式专题&#xff08;1&#xff09;——RGB简介 音视频入门基础&#xff1a;像素格式专题&#xff08;2&#xff09;——不通过第三方库将RGB24格式视频转换为BMP格式图片 一、引…

AI领域最伟大的论文检索网站

&#x1f4d1; 苏剑林&#xff08;Jianlin Su&#xff09;开发的“Cool Papers”网站旨在通过沉浸式体验提升科研工作者浏览论文的效率和乐趣。这个平台的核心优势在于利用Kimi的智能回答功能&#xff0c;帮助用户快速了解论文的常见问题&#xff08;FAQ&#xff09;&#xff0…

基于Qt的Model-View显示树形数据

目标 用qt的模型-视图框架实现树型层次节点的显示&#xff0c;从QAbstractItemModel派生自己的模型类MyTreeItemModel&#xff0c;用boost::property_tree::ptree操作树型数据结构&#xff0c;为了演示&#xff0c;此处只实现了个只读的模型 MyTreeItemModel的定义 #pragma o…

数据结构(一)绪论

2024年5月11日 一稿 数据元素+数据项 逻辑结构 集合 线性结构 树形结构 </

【驱动】SPI

1、简介 SPI(Serial Peripheral interface)串行外设接口。 特点: 高速:最大几十M,比如,AD9361的SPI总线速度可以达到40MHz以上全双工:主机在MOSI线上发送一位数据,从机读取它,而从机在MISO线上发送一位数据,主机读取它一主多从:主机产生时钟信号,通过片选引脚选择…

详解Python测试框架Pytest的参数化

&#x1f345; 视频学习&#xff1a;文末有免费的配套视频可观看 &#x1f345; 点击文末小卡片&#xff0c;免费获取软件测试全套资料&#xff0c;资料在手&#xff0c;涨薪更快 上篇博文介绍过&#xff0c;Pytest是目前比较成熟功能齐全的测试框架&#xff0c;使用率肯定也不…