赞
踩
---
apiVersion: v1
data:
mysql-root-password: bXlzcWwyMDIw
mysql-password: bXlzcWwyMDIw
mysql-replication-password: bXlzcWwyMDIw
kind: Secret
metadata:
name: mysql-secret
type: Opaque
使用的存储卷是 longhorn,具体部署可以参考本人的另一篇文章 查看
image: repository: bitnami/mysql master: persistence: size: "4Gi" storageClass: longhorn resources: limits: cpu: 100m memory: 1024Mi slave: replicas: 1 persistence: storageClass: longhorn size: "4Gi" existingSecret: mysql-secret db: user: lzf name: lzf replication: user: lzf_replica
helm repo add bitnami https://charts.bitnami.com/bitnami
#部署Secret
kubectl create -f mysql-secret.yaml -n [命名空间]
#部署MySql
helm upgrade --install mysql bitnami/mysql --namespace [命名空间] -f values.yaml
helm uninstall -n [命名空间] mysql
#查看Secret
kubectl get Secret -n [命名空间]
#查看helm部署情况
helm list -n [命名空间]
#查看命名空间里pod的情况
kubectl get pods -n [命名空间]
#查看pod的详情
kubectl describe pods mysql-master-0 -n [命名空间]
kubectl exec -it mysql-master-0 -n [命名空间]-- /bin/bash
mysql -u root -p
quit # 退出mysql
exit # 退出容器内部
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。