Rook: Cloud Native On-Premises Persistent Storage for Kubernetes on Kubernetes

kubernetes存储:local,openEBS,rook ceph 文章目录Local 存储(PV)概念hostPathLocal PVstorageClassName指定延迟绑定动作pv的删除流程OpenEBS存储控制平面OpenEBS PV ProvisionerMaya-apiserverMaya Volume ExporterVolume 管理 Sidecars节点磁盘管理器数据平面JivacStorLocal PV(普通情况下使用,网络性较小)安装测试(一般简单的使用就是用OpenEBS的local PV)ceph简介高性能高可用性高可扩展性(分布式的特性)特性丰 阅读详情

Software defined storage is not something new. One of the most popular is Ceph. I started with Ceph five years ago because I was looking into unified storage for OpenStack. There are many other solutions, but I like the Ceph because it is all in one solution for the block, object and file storage, and it is opensource. Inktank the company behind Ceph is later acquired by RedHat, but that made things even better. If you already have Ceph cluster running, it is easy to make use of it for Kubernetes. But, if you are designing completely new on-premises Kubernetes cluster you can run Ceph on top of it, and still use it for other resources running on Kubernetes. This is where Rook comes into place. It provides deep Kubernetes integration made for cloud native environments.

I'm excited about Rook. Not only because it solves persistent storage problems for Kubernetes, but also because it uses Ceph in the background. I designed at least five production grade Ceph clusters, so I'm pretty familiar with Ceph. For weeks I've been looking to write a post about Rook and I finally made it.

Alen Komljen @alenkomljen

Thanks @rook_io!

If you didn't hear about Rook.io yet, it is a Ceph on Kubernetes. In short, a cloud-native storage service.

  • 12
  • See Alen Komljen's other Tweets

The Rook Way of Ceph deployment

The good news, you can run Ceph on Kubernetes and then use that storage for other Kubernetes resources. Rook, in a nutshell, is an operator which means that Rook will manage Ceph cluster for you. To learn more about operators, a few weeks ago I wrote about Elasticsearch operator and how it works, so you might take a look if you want to dig deeper. Rook architecture diagram:

rook_architecture

Of course, because Ceph requires extra drives to store the data you would need to have a set of dedicated Kubernetes nodes. Currently, Rook is in an alpha state, but I'm expecting it to be production ready soon.

The easiest way to install Rook is using Helm. If you still didn't try Helm, it is the right time to do that. Add the new Helm repo and install Rook operator in kube-system namespace:

⚡ helm repo add rook-master https://charts.rook.io/master

⚡ helm search rook
NAME                CHART VERSION         APP VERSION    DESCRIPTION
rook-master/rook    v0.7.0-10.g3bcee98                   File, Block, and Object Storage Services for yo...

⚡ helm install --name rook rook-master/rook \
  --namespace kube-system \
  --version v0.7.0-10.g3bcee98 \
  --set rbacEnable=false

This Helm chart will install Rook operator and agents on each node. Check if everything is running and ready:

⚡ kubectl -n kube-system get pods -l 'app in (rook-operator, rook-agent)'
NAME                            READY     STATUS    RESTARTS   AGE
rook-agent-4rhwt                1/1       Running   0          4m
rook-agent-6s9v8                1/1       Running   0          4m
rook-agent-8kgr9                1/1       Running   0          4m
rook-agent-wqg9l                1/1       Running   0          4m
rook-operator-845b8b8d4-p6cln   1/1       Running   0          4m

NOTE: If you are installing Rook on Kubernetes nodes running CoreOS or RancherOS you need to configure flexible volume first!

With Rook operator in place we have the new custom resources available. But, we still don't have Ceph cluster running.

To better understand Rook, first, you need to understand Ceph. Ceph is all in one solution for the block, object and file storage. The block storage (think of EBS) is what will probably be more interesting to you. Each time you create a Kubernetes Persistent Volume Claim or PVC, the Ceph will create the new volume. The main component responsible for block storage is Ceph OSD along with Ceph MON which provides cluster membership, configuration, and state. Those two components are enough to have a distributed block storage. There are other daemons for extra storage types and some helpers like API, etc.

Object storage (think of S3) is another layer and Ceph component responsible for it is Ceph RadosGW. If you want to learn more about Ceph check official architecture docs.

Each Ceph OSD daemon handles only one physical drive. OSD stores the data in small objects which are part of placements groups or PGs. The placement groups are part of one pool which is distributed across other OSD nodes. Of course, you can have many pools and each pool has defined number of replicas. Which means when you create a PVC, the data is everywhere, on each storage node and replicated.

For HA Ceph cluster you need at least three nodes. It is advisable to run an odd-number of monitors to have a quorum and default is set to three. Let's define the new Ceph cluster in rook namespace:

⚡ kubectl create namespace rook

⚡ cat <<EOF | kubectl create -n rook -f -
apiVersion: rook.io/v1alpha1
kind: Cluster
metadata:
  name: rook
spec:
  dataDirHostPath: /var/lib/rook
  storage:
    useAllNodes: true
    useAllDevices: false
    storeConfig:
      storeType: bluestore
      databaseSizeMB: 1024
      journalSizeMB: 1024
EOF

Please check the docs for all available options and explanation for above config. Wait a few minutes and Ceph cluster should be up and running:

⚡ kubectl get pods -n rook
NAME                              READY     STATUS    RESTARTS   AGE
rook-api-854ffcf7b-6hnmw          1/1       Running   0          15m
rook-ceph-mgr0-7957dc8d6c-xndkn   1/1       Running   0          15m
rook-ceph-mon0-x6782              1/1       Running   0          16m
rook-ceph-mon1-262tl              1/1       Running   0          16m
rook-ceph-mon2-v2xv8              1/1       Running   0          16m
rook-ceph-osd-6jfmh               1/1       Running   0          15m
rook-ceph-osd-9f7w2               1/1       Running   0          15m
rook-ceph-osd-ds4h7               1/1       Running   1          15m
rook-ceph-osd-hkx87               1/1       Running   0          15m

For an experienced Ceph user, you want to be able to run ceph commands to check your cluster state. The easiest way is to deploy a separate rook-toolbox Pod and run commands from there:

⚡ cat <<EOF | kubectl create -n rook -f -
apiVersion: v1
kind: Pod
metadata:
  name: rook-tools
  namespace: rook
spec:
  dnsPolicy: ClusterFirstWithHostNet
  containers:
  - name: rook-tools
    image: rook/toolbox:master
    imagePullPolicy: IfNotPresent
    env:
      - name: ROOK_ADMIN_SECRET
        valueFrom:
          secretKeyRef:
            name: rook-ceph-mon
            key: admin-secret
    securityContext:
      privileged: true
    volumeMounts:
      - mountPath: /dev
        name: dev
      - mountPath: /sys/bus
        name: sysbus
      - mountPath: /lib/modules
        name: libmodules
      - name: mon-endpoint-volume
        mountPath: /etc/rook
  hostNetwork: false
  volumes:
    - name: dev
      hostPath:
        path: /dev
    - name: sysbus
      hostPath:
        path: /sys/bus
    - name: libmodules
      hostPath:
        path: /lib/modules
    - name: mon-endpoint-volume
      configMap:
        name: rook-ceph-mon-endpoints
        items:
        - key: data
          path: mon-endpoints
EOF

Now, for example, you can run a Ceph status check command:

⚡ kubectl -n rook exec rook-tools -- ceph -s
  cluster:
    id:     053cd70f-9b43-4854-862e-5bed29f1060d
    health: HEALTH_OK

  services:
    mon: 3 daemons, quorum rook-ceph-mon1,rook-ceph-mon0,rook-ceph-mon2
    mgr: rook-ceph-mgr0(active)
    osd: 4 osds: 4 up, 4 in

  data:
    pools:   0 pools, 0 pgs
    objects: 0 objects, 0 bytes
    usage:   8199 MB used, 145 GB / 153 GB avail
    pgs:

Ceph should report HEALTH_OK status, but we have 0 pools available. Before we can consume this cluster we need to create at least one pool with the desired number of replicas. The number of replicas is usually set to three:

⚡ cat <<EOF | kubectl create -n rook -f -
apiVersion: rook.io/v1alpha1
kind: Pool
metadata:
  name: replicapool
spec:
  replicated:
    size: 3
EOF

And finally, it is time to define the StorageClass for the above pool. Then we will be able to create new PVCs:

⚡ cat <<EOF | kubectl create -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
   name: rook-block
provisioner: rook.io/block
parameters:
  pool: replicapool
EOF

Let's create a simple PVC to test if Ceph cluster is working fine:

⚡ cat <<EOF | kubectl create -f -
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: myclaim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 8Gi
  storageClassName: rook-block
EOF

⚡ kubectl get pvc
NAME      STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
myclaim   Bound     pvc-5f162665-1fa5-11e8-9056-525400474652   8Gi        RWO            rook-block     3s

There are a lot of options for how to configure Ceph cluster. Sometimes you have mixed drive types and you want to have different pools for them. For example, fast storage with SSDs and slow with HDDs. Also, you may want to tune the Ceph cluster a little bit, but all those are advanced features. I recommend that you learn more about Ceph before moving forward with Rook.

Summary

A few weeks ago Rook became CNCF project which is a good news. Keep in mind that Rook is not production ready yet, and some things can change. Can't wait to put it in place someday for large on-premises distributed storage. For any questions or concerns please leave a comment. Stay tuned for the next one.

【云原生存储中间件】Rook与OpenEBS对比 Rook与OpenEBS代表了云原生存储的两种路径:前者依托成熟生态实现企业级功能,后者以轻量化设计推动敏捷创新。选择时需权衡性能、运维复杂度与业务场景——大规模混合云可选Rook-Ceph,而快速迭代的容器化应用更适合OpenEBS。随着云原生技术的演进,两者的融合(如Rook集成OpenEBS引擎)或将成为新趋势。 阅读详情

相关推荐

【信息科学与工程学】【数据中心】第三十五篇 云计算数据中心的学科知识04

编号学科(课程)核心知识点在云计算/云存储/云网络/云安全/云MaaS中的作用代表教材/资料/论文 + 数学方程式列表工业界应用D1421​云原生数据库:TiDB​HTAP(混合事务/分析处理)、分布式SQL、水平扩展、强一致(Raft)、自动故障恢复、与MySQL兼容、TiFlash列式引擎提供弹性扩展的分布式数据库;支撑高并发在线交易与实时分析教材:《TiDB in Action》PingCAP(2020) 论文:《TiDB: A Raft-based HTAP Database》(2017)

weixin_49199313的博客 414

不吹不黑,今天我们来聊一聊 Kubernetes 落地的三种方式

作者 | 王国梁 Kubernetes 社区成员与项目维护者原文标题《Kubernetes 应用之道:让 Kubernetes落地的“三板斧”》,首发于知乎专栏:进击的云计算原文地址:https://zhuanlan.zhihu.com/p/82666719 出身豪门、大厂背书的 Kubernetes 项目自 2014 年 6 月开源以来,在众多厂商和开源爱好者的共同努力下迅速崛起,时至今日已成...

阿里巴巴云原生的博客 765

Kubernetes云原生实战06 使用Rook搭建Ceph集群

使用Rook搭建Ceph集群

飘渺Jam的博客 3807

Longhorn vs Rook vs OpenEBS vs Portworx vs IOMesh:细说 5 款 K8s 持久化存储产品优劣势

选择兼具高性能与稳定性的方案。

SmartX 超融合 2826

Rook部署可扩展NFS集群与导出CephFS.pptx

Rook部署可扩展NFS集群与导出CephFS.pptx

Android 关于佳博和汉印蓝牙热敏打印机开发,Android程序员必经的实践之路

针对于上面的问题,我总结出了互联网公司Android程序员面试涉及到的绝大部分面试题及答案,并整理做成了文档,以及系统的进阶学习视频资料。(包括Java在Android开发中应用、APP框架知识体系、高级UI、全方位性能调优,NDK开发,音视频技术,人工智能技术,跨平台技术等技术资料),希望能帮助到你面试前的复习,且找到一个好的工作,也节省大家在网上搜索资料的时间来学习。《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

2401_84149570的博客 1025

Kubernetes的五大开源存储项目

OpenEBS 是一个开源的容器化存储平台,它是专为 Kubernetes 设计的,旨在提供可靠且易于管理的持久化存储解决方案。LongHorn 是 Kubernetes 的开源、轻量级分布式块存储框架,它将你的块存储分成 LongHorn 卷,并使用微服务和容器实现分布式块存储。Ceph 是一种开源的存储解决方案,提供堆存储、块存储和对象存储。在Kubernetes中,关于数据的持久化管理是一种挑战,对此,社区提供了多种存储的解决方案,这些方案旨在简化和优化容器化应用程序的持久化数据管理。

海鸥 1416

告别手动归档:基于Allegro Skill的XTools一键生成Gerber与生产文件实践

本文详细介绍了基于Allegro Skill的XTools工具如何实现一键生成Gerber与生产文件,大幅提升PCB设计效率。通过自动化流程,解决了传统手动归档中的重复劳动、人为失误和标准不统一等问题,特别适合需要频繁输出生产文件的工程师。文章包含安装配置、实战操作、问题排查及进阶技巧,帮助用户快速掌握这一高效工具。

weixin_30505225的博客 461

使用 Rook 构建生产可用存储环境实践

Rook 是基于 Kubernetes 之上构建的存储服务框架。它支持 Ceph、NFS 等多种底层存储的创建和管理。帮助系统管理员自动化维护存储的整个生命周期。存储的整个生命周期包括部署...

u012516914的专栏 993

VirtualBox增强功能安装全指南:从下载到配置复制粘贴功能

本文详细介绍了VirtualBox增强功能的完整安装与配置流程,重点解决了虚拟机与主机间复制粘贴、文件拖放等核心协作难题。通过分步指南和故障排查,帮助用户在不同操作系统(如Windows、Linux)中实现无缝集成,提升虚拟化工作效率与体验。

weixin_29206669的博客 422

告别环境配置噩梦:VSCode + MinGW 下 OpenGL (glad/glm/glfw) 一站式配置指南(含常见错误排查)

本文提供了一份详细的VSCode与MinGW下OpenGL开发环境配置指南,涵盖glad、glm和glfw三大核心库的安装与调试。通过逐步指导解决常见错误,帮助开发者快速搭建高效的OpenGL开发环境,特别适合初学者避免环境配置中的常见陷阱。

weixin_42557803的博客 491

使用StorageClass动态创建pv

rook-ceph安装部署到位后,就可以开始来尝试使用StorageClass来动态创建pv了。 有状态的中间件在kubernetes上落地基本上都会用到StorageClass来动态创建pv(对于云上应用没有那么多烦恼,云硬盘很好用,但是对于自己学习和练习来说还是Ceph更加靠谱),这里小试一试动态创建pv的威力,为后续用它来玩转redis、zookeeper、elasticsearch做准备。

张兆坤 815

手把手教你给H3C MSR路由器配置4G/5G上网(保姆级图文教程)

本文提供H3C MSR路由器配置4G/5G上网的保姆级图文教程,涵盖硬件准备、运营商适配、命令行配置、多运营商策略优化及信号故障排查等全流程。通过实测数据和典型场景分析,帮助用户快速实现4G/5G模块的部署与优化,提升网络稳定性和业务连续性。

weixin_28745067的博客 441

从零到一:基于Rook构建云原生Ceph存储的全面指南(上)

从零到一:基于Rook构建云原生Ceph存储的全面指南

虽非技冠群英首,愿与同道共长歌; 大鹏一日同风起,扶摇直上九万里; 1862

【系统架构设计师】预测试卷四:综合知识(75道选择题)

本文整理系统架构设计师考试高频考点,涵盖计算机系统基础、计算机网络、数据库、软件工程与UML四大模块,共28道典型题目。重点解析Cache局部性原理、RISC/CISC区别、TCP三次握手、B+树索引优势、CAP定理、螺旋模型特点等核心概念,并标注易错选项,帮助考生快速掌握解题思路。 关键词:系统架构、Cache、RISC、TCP、B+树、CAP定理、螺旋模型

数据知道的博客 550

Codex 100个真实案例 - 用AI做英语单词计划学习工具(记忆曲线+测验)

背单词是英语学习的基本功,但市面上的背单词 APP 要么收费、要么广告太多。本案例用 Codex 从零打造一个 **英语单词计划学习工具**,实现 SM-2 间隔重复算法(Anki 的核心算法)、单词本增删改查、多种测验模式(选择题/拼写/听写)、TTS 发音播放,以及学习数据的可视化统计图表。全程用自然语言驱动 Codex,用 Python 写后端逻辑 + 终端 UI,打造你的私人背单词助手!

yueyeguzhuo的专栏 209

k8s 集群部署rook-ceph存储系统及使用

一、Rook 、ceph简介 Ceph分布式存储系统 Ceph是一种高度可扩展的分布式存储解决方案,提供对象、文件和块存储。在每个存储节点上,您将找到Ceph存储对象的文件系统和Ceph OSD(对象存储守护程序)进程。在Ceph集群上,您还可以找到Ceph MON(监控)守护程序,它们确保Ceph集群保持高可用性。 RookRook 是一个开源的cloud-native storage编排, .........

不忘初心,方得始终 8791

学Simulink——基于风力发电系统的建模与仿真场景:基于自适应控制的风力发电系统输出功率调节

本文详细介绍了使用Simulink搭建风力发电系统自适应控制模型的完整流程。首先阐述了风速波动对电网的影响及自适应控制的优势,然后逐步指导创建Simulink项目、搭建系统结构(包括风速源、风轮机、发电机等模块),重点讲解了模型参考自适应控制器(MRAC)的设计步骤和参数设置方法。通过仿真分析验证了系统在风速变化时仍能保持输出功率稳定,展示了自适应控制的响应速度和鲁棒性。最后提出了引入深度学习预测、多变量控制等优化方向,为新能源领域工程师提供了实用的建模与仿真指导。

amy_mhd的博客 220

k8s-8_-rook介绍与使用

k8s-8_Kubernetes-rook介绍与使用

mingqing的博客 2103

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

如何通过Kubernetes安装Kubernetes以及物理服务器

本文翻译自:https://kubernetes.io/blog/2021/12/22/kubernetes-in-kubernetes-and-pxe-bootable-server-farm/作者:Andrei Kvapil本文翻译自Andrei Kvapil的文章,其中对文字有部分的整理和删减。当你有两个数据中心,数千个物理机、虚拟机以及数十万个站点需要托管的时候,通过Kubernetes就可以很简单的实现上述需求。然而,使用Kubernetes,不仅可以声明式的描述应用,还可以声明式的描述基础设施。

wanger5354的博客 361

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

基于Rook的Kubernetes存储方案

简介Rook是专用于Cloud-Native环境的文件、块、对象存储服务。它实现了一个自我管理的、自我扩容的、自我修复的分布式存储服务。Rook支持自动部署、启动、配置、分配(provisioning)、扩容/缩容、升级、迁移、灾难恢复、监控,以及资源管理。 为了实现所有这些功能,Rook依赖底层的容器编排平台。目前Rook仍然处于Alpha版本,初期专注于Kubernetes+Ceph。Ceph...

mark's technic world 1万+

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Rook使用简介

Rook使用简介(Ceph) 1、简介 Rook是一个自管理的分布式存储编排系统,可以为Kubernetes提供便利的存储解决方案。Rook本身并不提供存储,而是在kubernetes和存储系统之间提供适配层,简化存储系统的部署与维护工作。目前,rook支持的存储系统包括:Ceph、CockroachDB、Cassandra、EdgeFS、Minio、NFS,其中Ceph为Stable状态,其余均...

迷途的攻城狮 2万+

Kubernetes部署云原生分布式存储Rook

rook简介 Rook官网:https://rook.io 容器的持久化存储 容器的持久化存储是保存容器存储状态的重要手段,存储插件会在容器里挂载一个基于网络或者其他机制的远程数据卷,使得在容器里创建的文件,实际上是保存在远程存储服务器上,或者以分布式的方式保存在多个节点上,而与当前宿主机没有任何绑定关系。这样,无论你在其他哪个宿主机上启动新的容器,都可以请求挂载指定的持久化存储卷,从而访问到数据...

IT 3万+

云原生通用存储框架:Rook介绍与使用

新钛云服已为您服务1007天基于Kubernetes (或K8S)的云原生应用程序已广泛用于生产环境,这带来了一个挑战:如何将传统存储系统集成到Kubernetes集群中?我们建议使用Ro...

NewTyun的博客 4947

Kubernetes 集群部署 NFS Provisioner

文章目录背景介绍配置要求配置NFS服务器配置环境安装nfs-utils和rpcbind创建存储的文件夹配置NFS设置开机启动并启动查看是否有可用的NFS地址客户端配置安装nfs-utils和rpcbind创建挂载的文件夹挂载nfs写入一个测试文件 背景介绍 Kubernetes 对 Pod 进行调度时,以当时集群中各节点的可用资源作为主要依据,自动选择某一个可用的节点,并将 Pod 分配到该节点上。在这种情况下,Pod 中容器数据的持久化如果存储在所在节点的磁盘上,就会产生不可预知的问题,例如,当 Pod

7DGroup,让技术更有价值! 1668

Rook下快速部署ceph分布式文件系统

由于CRD资源版本不匹配的问题,参考下面文章需要切换到0.9分支 https://github.com/rook/rook/issues/2338 $ git clone https://github.com/rook/rook.git #克隆仓库 $ cd rook/cluster/examples/kubernetes/ceph $ git checkout remotes/ori...

魂醉的一亩二分地 977
上一篇: 安装rook
下一篇: Ceph基础知识和基础架构认识
hxpjava1
博客等级 码龄19年 1365粉丝 511原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值