暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

K8s用Helm部署NFS

DevOps架构实战 2022-04-13
1342

点击关注公众号

分享到“朋友圈”,每天上午 08:00,干货推送!

[root@master ~]# kubectl get cs

Warning: v1 ComponentStatus is deprecated in v1.19+

NAME                 STATUS    MESSAGE             ERROR

scheduler            Healthy   ok                  

controller-manager   Healthy   ok                  

etcd-0               Healthy   {"health":"true"}   

创建 NFS 存储目录

[root@mha ~]# mkdir /data/nfs

安装nfs服务

[root@mha ~]# yum -y install nfs-utils rpcbind

[root@mha ~]# cat /etc/exports

/data/nfs *(rw,sync,no_root_squash,no_subtree_check)

启动服务

systemctl start nfs && systemctl start rpcbind

[root@mha ~]# systemctl start nfs

[root@mha ~]# systemctl start rpcbind

创建NFS 动态PV专属命名空间

[root@master ~]# kubectl create ns nfs

namespace/nfs created

安装Helm

[root@master ~]# tar -zxvf helm-v3.4.2-linux-amd64.tar.gz

linux-amd64/

linux-amd64/helm

linux-amd64/README.md

linux-amd64/LICENSE

[root@master ~]# mv linux-amd64/helm  /usr/bin/

[root@master ~]# hel

helm  help  

[root@master ~]# helm version

version.BuildInfo{Version:"v3.4.2", GitCommit:"23dd3af5e19a02d4f4baa5b2f242645a1a3af629", GitTreeState:"clean", GoVersion:"go1.14.13"}

[root@master ~]# helm repo add helm-stable https://charts.helm.sh/stable

[root@master ~]# helm repo add aliyun https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts

[root@master ~]# helm repo update

[root@master ~]# helm search repo helm-stable/nfs-client-provisioner

NAME                              CHART VERSIONAPP VERSIONDESCRIPTION                                       

helm-stable/nfs-client-provisioner1.2.11       3.1.0      DEPRECATED - nfs-client is an automatic provisi...

[root@master ~]# cat nfs.yaml

nfs:

  server: 192.168.20.18

  path: /data/nfs

storageClass:

  name: nfs-client

  reclaimPolicy: Retain

image:

  repository: kubesphere/nfs-client-provisioner

replicaCount: 1

[root@master ~]# helm install nfs-storage -n nfs --values nfs.yaml helm-stable/nfs-client-provisioner --version 1.2.11

[root@master ~]# kubectl get pods -n nfs

NAME                      READY   STATUS    RESTARTS   AGE

nfs-storage-nfs-client-provisioner-8bb7ddd46-vwfln   1/1       Running      0          4m7s

文章转载自DevOps架构实战,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论