Kubernetes云原生存储解决方案openebs部署实践-3.10.0版本(helm部署)

Kubernetes云原生存储解决方案openebs部署实践-3.10.0版本(helm部署)

记录在k8s 1.19.0集群环境下安装openebs 3.10.0。

环境信息如下:

[root@k8s-master ~]# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
[root@k8s-master ~]# uname -a
Linux k8s-master 3.10.0-1160.71.1.el7.x86_64 #1 SMP Tue Jun 28 15:37:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@k8s-master ~]# kubectl get node
NAME         STATUS   ROLES    AGE   VERSION
k8s-master   Ready    master   16d   v1.19.0
k8s-node1    Ready    worker   16d   v1.19.0
k8s-node2    Ready    worker   16d   v1.19.0
[root@k8s-master ~]# helm version
version.BuildInfo{Version:"v3.6.1", GitCommit:"61d8e8c4a6f95540c15c6a65f36a6dd0a45e7a2f", GitTreeState:"clean", GoVersion:"go1.16.5"}

1. 安装openebs

openebs支持kubectl基于yaml安装,也可以使用helm进行安装。本文基于helm方式。

  1. 配置helm仓库
[root@k8s-master ~]# helm repo add openebs https://openebs.github.io/charts

[root@k8s-master ~]# helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "grafana" chart repository
...Successfully got an update from the "ingress-nginx" chart repository
...Successfully got an update from the "bitnami" chart repository
...Successfully got an update from the "prometheus-community" chart repository
...Successfully got an update from the "openebs" chart repository
Update Complete. ⎈Happy Helming!
  1. 安装 openebs chart
[root@k8s-master ~]# helm install openebs --namespace openebs openebs/openebs --create-namespace
NAME: openebs
LAST DEPLOYED: Fri Jun 28 15:14:46 2024
NAMESPACE: openebs
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Successfully installed OpenEBS.

Check the status by running: kubectl get pods -n openebs

The default values will install NDM and enable OpenEBS hostpath and device
storage engines along with their default StorageClasses. Use `kubectl get sc`
to see the list of installed OpenEBS StorageClasses.

**Note**: If you are upgrading from the older helm chart that was using cStor
and Jiva (non-csi) volumes, you will have to run the following command to include
the older provisioners:

helm upgrade openebs openebs/openebs \
        --namespace openebs \
        --set legacy.enabled=true \
        --reuse-values

For other engines, you will need to perform a few more additional steps to
enable the engine, configure the engines (e.g. creating pools) and create
StorageClasses.

For example, cStor can be enabled using commands like:

helm upgrade openebs openebs/openebs \
        --namespace openebs \
        --set cstor.enabled=true \
        --reuse-values

For more information,
- view the online documentation at https://openebs.io/docs or
- connect with an active community on Kubernetes slack #openebs channel.
  1. 检查部署的资源:
# 部署的chart
[root@k8s-master ~]# helm ls -n openebs
NAME    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
openebs openebs         1               2024-06-28 15:14:46.982427602 +0800 CST deployed        openebs-3.10.0  3.10.0

# pods
[root@k8s-master ~]# kubectl get pod -n openebs -o wide
NAME                                           READY   STATUS    RESTARTS   AGE     IP             NODE         NOMINATED NODE   READINESS GATES
openebs-localpv-provisioner-685b678c88-lq57l   1/1     Running   0          9m49s   10.244.0.232   k8s-master   <none>           <none>
openebs-ndm-bxzwv                              1/1     Running   0          9m49s   192.168.0.51   k8s-master   <none>           <none>
openebs-ndm-d54bt                              1/1     Running   1          9m49s   192.168.0.53   k8s-node2    <none>           <none>
openebs-ndm-hjnpx                              1/1     Running   2          9m49s   192.168.0.52   k8s-node1    <none>           <none>
openebs-ndm-operator-c959d9d77-dscd2           1/1     Running   0          9m49s   10.244.0.233   k8s-master   <none>           <none>

# 存储类
[root@k8s-master ~]# kubectl get sc
NAME               PROVISIONER        RECLAIMPOLICY   VOLUMEBINDINGMODE      ALLOWVOLUMEEXPANSION   AGE
openebs-device     openebs.io/local   Delete          WaitForFirstConsumer   false                  16d
openebs-hostpath   openebs.io/local   Delete          WaitForFirstConsumer   false                  16d

本文安装的openebs版本较低,3.10.0版本,较新版本的chart仓库已经变更,详情参考官方文档:

官方文档:https://openebs.netlify.app/docs/quickstart-guide/installation

官方仓库:https://github.com/openebs/openebs

2. demo测试

openebs部署完成后会自动创建存储类,我们使用openebs-hostpath这个StorageClass来创建PVC

创建一个示例应用挂载openebs提供的存储进行测试。资源清单文件openebs-test.yaml,包括pvc和pod:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: local-hostpath-pvc
spec:
  storageClassName: openebs-hostpath
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi
---
apiVersion: v1
kind: Pod
metadata:
  name: hello-local-hostpath-pod
spec:
  volumes:
  - name: local-storage
    persistentVolumeClaim:
      claimName: local-hostpath-pvc
  containers:
  - name: hello-container
    image: busybox
    command:
       - sh
       - -c
       - 'while true; do echo "`date` [`hostname`] Hello from OpenEBS Local PV." >> /mnt/store/greet.txt; sleep $(($RANDOM % 5 + 300)); done'
    volumeMounts:
    - mountPath: /mnt/store
      name: local-storage

创建资源:kubectl create -f openebs-test.yaml,等待创建完成。

[root@k8s-master openebs]# kubectl get pod -o wide
NAME                       READY   STATUS    RESTARTS   AGE   IP            NODE        NOMINATED NODE   READINESS GATES
hello-local-hostpath-pod   1/1     Running   0          15m   10.244.1.65   k8s-node1   <none>           <none>

[root@k8s-master openebs]# kubectl get pvc
NAME                 STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS       AGE
local-hostpath-pvc   Bound    pvc-b240b152-718e-44e2-938f-0255e457ec8f   5Gi        RWO            openebs-hostpath   11m

[root@k8s-master openebs]# kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                        STORAGECLASS       REASON   AGE
pvc-b240b152-718e-44e2-938f-0255e457ec8f   5Gi        RWO            Delete           Bound    default/local-hostpath-pvc   openebs-hostpath            8m49s

# 检查node1节点的本地路径
[root@k8s-node1 ~]# cat /var/openebs/local/pvc-b240b152-718e-44e2-938f-0255e457ec8f/greet.txt
Fri Jun 28 08:11:00 UTC 2024 [hello-local-hostpath-pod] Hello from OpenEBS Local PV.
Fri Jun 28 08:16:04 UTC 2024 [hello-local-hostpath-pod] Hello from OpenEBS Local PV.
Fri Jun 28 08:21:08 UTC 2024 [hello-local-hostpath-pod] Hello from OpenEBS Local PV.

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

人工智能--图像语义分割

个人主页&#xff1a;欢迎来到 Papicatch的博客 课设专栏 &#xff1a;学生成绩管理系统 专业知识专栏&#xff1a;专业知识 ​ 文章目录 &#x1f349;引言 &#x1f349;介绍 &#x1f348;工作原理 &#x1f34d;数据准备 &#x1f34d;特征提取 &#x1f34d;像素分…

实习总结 --- 其他业务

一. 回归测试&#xff1a;回归测试与测新是对应的&#xff0c;当需求准入交付测试的时候首先要进行的就是测新&#xff0c;也就是对新功能对测试&#xff0c;一般是在sim环境下测试的&#xff1b;当测新通过后才会进行回归测试&#xff0c;回归测试的目的是为了保证老功能的正确…

人工智能 (AI) 基本概念 入门篇【C#】版

1. 什么是人工智能&#xff1f; 人工智能&#xff08;Artificial Intelligence, AI&#xff09;是指计算机系统能够执行通常需要人类智能的任务&#xff0c;如视觉识别、语音识别、决策和语言翻译等。AI的核心是通过算法和数据进行学习和推理&#xff0c;以实现智能行为。 2.…

2.3.2 主程序和外部IO交互 (文件映射方式)----IO Client实现

2.3.2 主程序和外部IO交互 &#xff08;文件映射方式&#xff09;----IO Client C实现 和IOServer主要差别&#xff1a; 1 使用Open_Client 连接 2 一定要先打开IOServer&#xff0c;再打开IO_Client 效果显示 1 C 代码实现 1.1 shareddataClient.h 头文件中引用 和sharedd…

PTA-线性表实验(JAVA)

题目1&#xff1a;Josephus环的问题及算法 【实验内容】 编程实现如下功能&#xff1a; 题意说明&#xff1a;古代某法官要判决n个犯人的死刑&#xff0c;他有一条荒唐的法律&#xff0c;将犯人站成一个圆圈&#xff0c;从第start个犯人开始数起&#xff0c;每数到第distance的…

Redis基础教程(一):redis配置

&#x1f49d;&#x1f49d;&#x1f49d;首先&#xff0c;欢迎各位来到我的博客&#xff0c;很高兴能够在这里和您见面&#xff01;希望您在这里不仅可以有所收获&#xff0c;同时也能感受到一份轻松欢乐的氛围&#xff0c;祝你生活愉快&#xff01; &#x1f49d;&#x1f49…

信息安全体系架构设计

对信息系统的安全需求是任何单一安全技术都无法解决的&#xff0c;要设计一个信息安全体系架构&#xff0c;应当选择合适的安全体系结构模型。信息系统安全设计重点考虑两个方面&#xff1b;其一是系统安全保障体系&#xff1b;其二是信息安全体系架构。 1.系统安全保障体系 安…

Go语言特点、编译及命令

本文主要分为三部分内容分别为&#xff1a;Go语言的特点介绍&#xff1b;编译windows、linux环境文件及Go命令。 目录 Go语言特点 编译文件 编译window文件 编译linux文件 Go命令&#xff08;build/run/install/env&#xff09; 编译文件 直接运行程序 安装程序 配置G…

【分布式数据仓库Hive】常见问题及解决办法

目录 一、启动hive时发现log4j版本和hadoop的版本有冲突 解决办法&#xff1a;删除hive下高版本的slf4j 二、启动hive报错 Exception in thread "main" java.lang.NoSuchMethodError:com.google.common.base.Preconditions.checkArgument(ZLjava/lang/Object;)V …

个人博客|PHP源码|支持多国语言切换

一. 前言 今天小编给大家带来了一款可学习&#xff0c;可商用的&#xff0c;支持多国语言的个人博客网站源码&#xff0c;支持二开&#xff0c;无加密。此博客相当简洁&#xff0c;也适合海外。详细界面和功能见下面视频演示。 如果您正好有此需求源码&#xff0c;请联系小编…

Zabbix 配置钉钉告警

Zabbix 配置钉钉告警 随着企业IT运维需求的不断增加&#xff0c;及时、准确地获取系统告警信息显得尤为重要。在众多告警工具中&#xff0c;Zabbix 因其强大的监控功能和灵活的告警机制&#xff0c;成为了很多企业的首选。同时&#xff0c;随着企业内部沟通工具的多样化&#…

苹果AI的国产大模型之争,没有悬念

文 | 智能相对论 作者 | 陈泊丞 苹果终于公布了最新的AI进程。 一个月前&#xff0c;正如此前预期的那样&#xff0c;人工智能是今年 WWDC 发布会的焦点。全程105分钟的主题演讲&#xff0c;就有40多分钟用于介绍苹果的AI成果。 苹果似乎还有意玩了一把“谐音梗”&#xff…

海外虚拟卡开卡平台有哪些?无限开卡,无其他限制

随着时代的发展很多小伙伴都需要海外虚拟卡&#xff0c;海外虚拟卡开卡平台我这里用的是Fomepay的&#xff0c;他们比较人性化&#xff0c;有客服&#xff0c;随时可咨询 对于消费者而言&#xff0c;虚拟卡号提供了隐私&#xff0c;因此广告商更难以跟踪和定位购买行为&#x…

深入浅出:进程管理的艺术

目录 进程的定义 进程的特征 进程的状态 进程与程序的区别 进程的控制和管理 进程的特点 1. 虚拟内存空间的分配 2. 时间片轮转调度 图解&#xff1a; 进程段 数据段&#xff08;Data Segment&#xff09; 正文段&#xff08;Text Segment&#xff09; 堆栈段&…

Redis持久化详解

【关闭文件、AOF 刷盘、释放内存这三个任务都有各自的任务队列】所以不是单线程 Redis有两种持久化方案&#xff1a; RDB持久化 AOF持久化 基于Redis集群解决单机Redis存在的问题 【Redis是单进程的】 【也有人做分布式section】 【主从集群中多个从就是做负载均衡的】 …

一维信号全变分(TV)降噪方法(MATLAB)

信号降噪一直是领域研究的热点&#xff0c;这是一项十分有意义并且极具挑战性的工作&#xff0c;经过几十年来相关科研人员的共同努力&#xff0c;降噪技术得到了极大的发展&#xff0c;并在现实生活中也得到了广泛的应用。其中&#xff0c;许多常用的方法有&#xff1a;小波变…

vector模拟实现【C++】

文章目录 全部的实现代码放在了文章末尾准备工作包含头文件定义命名空间和类类的成员变量 迭代器迭代器获取函数 构造函数默认构造使用n个值构造迭代器区间构造解决迭代器区间构造和用n个值构造的冲突拷贝构造 析构函数swap【交换函数】赋值运算符重载emptysize和capacityopera…

上位机网络通讯

目录 一 设计原型 二 后台源码 一 设计原型 二 后台源码 using System; using System.Net.Sockets; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;namespace 上位机网络通讯 {public partial class Form1 : Form{public Form1(){Initializ…

BUG TypeError: GPT2Model.forward() got an unexpected keyword argument ‘past’

TypeError: GPT2Model.forward() got an unexpected keyword argument past’ 环境 transformers 4.38.1详情 这是由于新版的transformers 对GPT2Model.forward() 参数进行了改变导致的错误。具体是past名称改为了 past_key_values 。 解决方法 找到错误语…

黑马点评-Redis的缓存击穿,缓存雪崩,缓存穿透,互斥锁,逻辑过期

文章目录 1.缓存穿透2.缓存雪崩3.缓存击穿3.1 互斥锁3.2 基于逻辑过期 1.缓存穿透 解决办法 写入NULL值到Redis缓存&#xff0c;以后就会命中Redis的控制缓存而不会出现请求直接打到数据库的问题&#xff01; 代码 2.缓存雪崩 这个概念很好理解&#xff0c;雪崩就是无数的…