helm安装nfs-client-provisioner和mariadb
helm3 部署nfs类型storageclass环境信息:k8s 1.18.3 单节点IP:192.168.86.12系统:centos7.7一、部署NFS1、nfs server端配置yum install -y nfs-commonnfs-utilssystemctl start nfs-utils.servicesystemctl enable nfs-utils.servicesyste
·
helm3 部署nfs类型storageclass
环境信息:
k8s 1.18.3 单节点
IP:192.168.86.12
系统:centos7.7
一、部署NFS
1、nfs server端配置
yum install -y nfs-common nfs-utils
systemctl start nfs-utils.service
systemctl enable nfs-utils.service
systemctl start nfs
systemctl enable nfs
mkdir /data-nfs/
echo "/data-nfs *(rw,async,no_root_squash)" >> /etc/exports
exportfs -r
showmount -e localhost
2 、各个节点安装nfs包
yum install -y nfs-common nfs-utils
systemctl start nfs-utils.service
systemctl enable nfs-utils.service
systemctl start nfs
systemctl enable nfs
3、nfs-client配置
helm repo add azure http://mirror.azure.cn/kubernetes/charts/
helm repo update
helm install nfs-storage azure/nfs-client-provisioner --set nfs.server=192.168.86.12 --set nfs.path=/data-nfs --set storageClass.name=nfs-storage --set storageClass.defaultClass=true
kubectl get sc
kubectl apply -f pvc.yaml
cat pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-storageclass
spec:
storageClassName: "nfs-storage"
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Mi
二、卸载
kubectl delete -f pvc.yaml
helm delete nfs-storage
rm -rf /etc/exports
rm -rf /data-nfs/
yum -y remove nfs-common nfs-utils
三、部署mariadb
1>master-slave模式
helm repo add stable http://mirror.azure.cn/kubernetes/charts/
helm repo update
helm install db stable/mariadb --set global.storageClass=nfs-storage --set rootUser.password=duan@1994 --set slave.replicas=3
2>多master模式
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm install mariadb-galera bitnami/mariadb-galera --set global.storageClass=nfs-storage --set persistence.size=10G --set rootUser.password=test@123
卸载
kubectl scale sts my-release-mariadb-galera --replicas=0
helm delete --purge my-release
执行升级时有必要指定现有密码,以确保机密不会被无效的随机生成的密码更新。请记住在升级图表时指定rootUser.password、db.password和参数的现有值:galera.mariabackup.password
helm upgrade my-release oci://REGISTRY_NAME/REPOSITORY_NAME/mariadb-galera \
--set rootUser.password=[ROOT_PASSWORD] \
--set db.password=[MARIADB_PASSWORD] \
--set galera.mariabackup.password=[GALERA_MARIABACKUP_PASSWORD]
更多推荐
已为社区贡献28条内容
所有评论(0)