“Helm3”的版本间的差异
跳到导航
跳到搜索
(未显示同一用户的12个中间版本) | |||
第1行: | 第1行: | ||
+ | [[category:k8s]][[category:devops]] | ||
+ | |||
− | [[Helm基础]] 姐妹篇这个是helm2 | + | [[Helm基础]] 姐妹篇这个是helm2, 现在直接看本文 helm3 |
=helm3= | =helm3= | ||
+ | helm [helm] v.掌(舵);掌握;给…戴上头盔 | ||
+ | |||
==ins == | ==ins == | ||
+ | |||
+ | [https://www.cnblogs.com/lvzhenjiang/p/14878279.html 轻松完爆Helm私有仓库] | ||
<pre> | <pre> | ||
+ | wget -c https://get.helm.sh/helm-v3.9.3-linux-amd64.tar.gz | ||
+ | tar xvf helm-v3.9.3-linux-amd64.tar.gz | ||
+ | sudo mv linux-amd64/helm /usr/local/bin/helm | ||
+ | |||
wget -c https://get.helm.sh/helm-v3.0.3-linux-amd64.tar.gz | wget -c https://get.helm.sh/helm-v3.0.3-linux-amd64.tar.gz | ||
tar xvf helm-v3.0.3-linux-amd64.tar.gz | tar xvf helm-v3.0.3-linux-amd64.tar.gz | ||
第15行: | 第25行: | ||
</pre> | </pre> | ||
+ | |||
==添加 Chart 仓库== | ==添加 Chart 仓库== | ||
<pre> | <pre> | ||
第63行: | 第74行: | ||
helm status nginx -n mydlqcloud | helm status nginx -n mydlqcloud | ||
+ | |||
+ | ===helm redis-cluster === | ||
+ | <pre> | ||
+ | 1. 添加 bitnami 的仓库 | ||
+ | helm repo add bitnami https://charts.bitnami.com/bitnami #国内网络不太成功的 | ||
+ | helm repo add azure http://mirror.azure.cn/kubernetes/charts | ||
+ | helm repo add bitnami "https://helm-charts.itboon.top/bitnami" --force-update | ||
+ | helm repo update bitnami | ||
+ | |||
+ | |||
+ | 2. 查询 Redis 资源 | ||
+ | helm repo update | ||
+ | redis# helm search repo redis | ||
+ | NAME CHART VERSION APP VERSION DESCRIPTION | ||
+ | azure/prometheus-redis-exporter 3.5.1 1.3.4 DEPRECATED Prometheus exporter for Redis metrics | ||
+ | azure/redis 10.5.7 5.0.7 DEPRECATED Open source, advanced key-value stor... | ||
+ | azure/redis-ha 4.4.6 5.0.6 DEPRECATED - Highly available Kubernetes implem... | ||
+ | bitnami/redis 20.1.5 7.4.0 Redis(R) is an open source, advanced key-value ... | ||
+ | bitnami/redis-cluster 11.0.5 7.4.0 Redis(R) is an open source, scalable, distribut... | ||
+ | |||
+ | 3. 拉取 chart 到本地 | ||
+ | helm pull bitnami/redis-cluster --version 11.0.5 | ||
+ | cd redis/ | ||
+ | |||
+ | 1277 tar xvf redis-cluster-11.0.5.tgz | ||
+ | 1278 cp redis-cluster/values.yaml ./values-test.yaml | ||
+ | |||
+ | 4. 对本地 valuse-test.yaml 修改 | ||
+ | /redis# kubectl get storageclasses | ||
+ | NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE | ||
+ | nfs nfs-nfs Delete Immediate false 4d23h | ||
+ | nfs-client k8s-sigs.io/nfs-subdir-external-provisioner Delete Immediate false 4d17h | ||
+ | |||
+ | cat values-test.yaml | ||
+ | |||
+ | global: | ||
+ | storageClass: "nfs-client" # 配置sc为nfs | ||
+ | redis: | ||
+ | password: "redis123" # 定义 redis 密码 | ||
+ | |||
+ | 因为你懂的原因 有很多个地方 直接替换 | ||
+ | 把 image 有关的 docker.io 改为 m.daocloud.io/docker.io | ||
+ | 样子如下 | ||
+ | |||
+ | ## @param image.debug Enable image debug mode | ||
+ | ## | ||
+ | image: | ||
+ | registry: m.daocloud.io/docker.io | ||
+ | repository: bitnami/redis-cluster | ||
+ | tag: 7.4.0-debian-12-r4 | ||
+ | |||
+ | 5. 安装 Redis 集群 | ||
+ | # 创建 mynamespace 名称空间 | ||
+ | $ kubectl create ns mynamespace | ||
+ | |||
+ | # 安装 Redis 集群 | ||
+ | $ helm -n mynamespace install redis-cluster redis-cluster -f values-test.yaml | ||
+ | NAME: redis-cluster | ||
+ | LAST DEPLOYED: Thu Oct 10 02:22:11 2024 | ||
+ | NAMESPACE: mynamespace | ||
+ | STATUS: deployed | ||
+ | REVISION: 1 | ||
+ | TEST SUITE: None | ||
+ | NOTES: | ||
+ | CHART NAME: redis-cluster | ||
+ | CHART VERSION: 11.0.5 | ||
+ | APP VERSION: 7.4.0** Please be patient while the chart is being deployed ** | ||
+ | |||
+ | |||
+ | To get your password run: | ||
+ | export REDIS_PASSWORD=$(kubectl get secret --namespace "mynamespace" redis-cluster -o jsonpath="{.data.redis-password}" | base64 -d) | ||
+ | |||
+ | You have deployed a Redis® Cluster accessible only from within you Kubernetes Cluster.INFO: The Job to create the cluster will be created.To connect to your Redis® cluster: | ||
+ | |||
+ | 1. Run a Redis® pod that you can use as a client: | ||
+ | kubectl run --namespace mynamespace redis-cluster-client --rm --tty -i --restart='Never' \ | ||
+ | --env REDIS_PASSWORD=$REDIS_PASSWORD \ | ||
+ | --image m.daocloud.io/docker.io/bitnami/redis-cluster:7.4.0-debian-12-r4 -- bash | ||
+ | |||
+ | 2. Connect using the Redis® CLI: | ||
+ | |||
+ | redis-cli -c -h redis-cluster -a $REDIS_PASSWORD | ||
+ | |||
+ | |||
+ | |||
+ | WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs: | ||
+ | - redis.resources | ||
+ | - updateJob.resources | ||
+ | +info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ | ||
+ | |||
+ | ⚠ SECURITY WARNING: Original containers have been substituted. This Helm chart was designed, tested, and validated on multiple platforms using a specific set of Bitnami and Tanzu Application Catalog containers. Substituting other containers is likely to cause degraded security and performance, broken chart features, and missing environment variables. | ||
+ | |||
+ | Substituted images detected: | ||
+ | - m.daocloud.io/docker.io/bitnami/redis-cluster:7.4.0-debian-12-r4 | ||
+ | - m.daocloud.io/docker.io/bitnami/os-shell:12-debian-12-r30 | ||
+ | - m.daocloud.io/docker.io/bitnami/redis-exporter:1.63.0-debian-12-r0 | ||
+ | - m.daocloud.io/docker.io/bitnami/os-shell:12-debian-12-r30 | ||
+ | |||
+ | |||
+ | ## helm -n NAMESAPCE install SERVER_NAME FILE_NAME -f CONFIG_FILE | ||
+ | -n 指定 kubernetes 集群名称空间 | ||
+ | -f 指定使用的配置文件,文件中定义的配置可以覆盖 redis-cluster/values.yaml 文件中配置 | ||
+ | |||
+ | /redis# helm -n mynamespace list | ||
+ | NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION | ||
+ | redis-cluster mynamespace 1 2024-10-10 02:22:11.203808604 +0000 UTC deployed redis-cluster-11.0.5 7.4.0 | ||
+ | |||
+ | kubectl -n mynamespace get pods -l helm.sh/chart=redis-cluster-11.0.5 | ||
+ | NAME READY STATUS RESTARTS AGE | ||
+ | redis-cluster-0 1/1 Running 1 (21m ago) 24m | ||
+ | redis-cluster-1 1/1 Running 1 (21m ago) 24m | ||
+ | redis-cluster-2 1/1 Running 1 (21m ago) 24m | ||
+ | redis-cluster-3 1/1 Running 1 (21m ago) 24m | ||
+ | redis-cluster-4 1/1 Running 0 24m | ||
+ | redis-cluster-5 1/1 Running 0 24m | ||
+ | |||
+ | edis# kubectl -n mynamespace get pods,sts,svc -l helm.sh/chart=redis-cluster-11.0.5 | ||
+ | NAME READY STATUS RESTARTS AGE | ||
+ | pod/redis-cluster-0 1/1 Running 1 (25m ago) 28m | ||
+ | pod/redis-cluster-1 1/1 Running 1 (25m ago) 28m | ||
+ | pod/redis-cluster-2 1/1 Running 1 (25m ago) 28m | ||
+ | pod/redis-cluster-3 1/1 Running 1 (25m ago) 28m | ||
+ | pod/redis-cluster-4 1/1 Running 0 28m | ||
+ | pod/redis-cluster-5 1/1 Running 0 28m | ||
+ | |||
+ | NAME READY AGE | ||
+ | statefulset.apps/redis-cluster 6/6 28m | ||
+ | |||
+ | NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
+ | service/redis-cluster ClusterIP 10.233.79.164 <none> 6379/TCP 28m | ||
+ | service/redis-cluster-headless ClusterIP None <none> 6379/TCP,16379/TCP 28m | ||
+ | |||
+ | |||
+ | 6. 连接 Redis 集群 验证服务 | ||
+ | |||
+ | kubectl get secret --namespace "mynamespace" redis-cluster -o jsonpath="{.data.redis-password}" | base64 -d | ||
+ | 1301 export REDIS_PASSWORD=$(kubectl get secret --namespace "mynamespace" redis-cluster -o jsonpath="{.data.redis-password}" | base64 -d) | ||
+ | 1302 kubectl run --namespace mynamespace redis-cluster-client --rm --tty -i --restart='Never' --env REDIS_PASSWORD=$REDIS_PASSWORD --image m.daocloud.io/docker.io/bitnami/redis-cluster:7.4.0-debian-12-r4 -- bash | ||
+ | |||
+ | </pre> | ||
+ | https://juejin.cn/post/7353197221742018600 | ||
+ | |||
+ | |||
+ | [https://www.cnblogs.com/Merbleue/p/17903263.html Helm Chart 部署 Redis 的完美指南] | ||
+ | |||
+ | ==== trouble==== | ||
+ | <pre>root@ubuntu-2004aug-1:~/redis# kubectl -n mynamespace get pods -l helm.sh/chart=redis-cluster-11.0.5 | ||
+ | NAME READY STATUS RESTARTS AGE | ||
+ | redis-cluster-0 0/1 ImagePullBackOff 0 92s | ||
+ | redis-cluster-1 0/1 ImagePullBackOff 0 91s | ||
+ | redis-cluster-2 0/1 ContainerCreating 0 90s | ||
+ | redis-cluster-3 0/1 ContainerCreating 0 90s | ||
+ | redis-cluster-4 0/1 ContainerCreating 0 89s | ||
+ | redis-cluster-5 0/1 ContainerCreating 0 89s | ||
+ | |||
+ | |||
+ | 原因 | ||
+ | Pulling image "docker.io/bitnami/redis-cluster:7.4.0-debian-12-r4" | ||
+ | |||
+ | |||
+ | |||
+ | m.daocloud.io/docker.io/library/xtrabackup:1.0 | ||
+ | |||
+ | |||
+ | m.daocloud.io/docker.io/bitnami/redis-cluster:7.4.0-debian-12-r4</pre> | ||
=== ins mysql=== | === ins mysql=== | ||
第111行: | 第287行: | ||
=see also= | =see also= | ||
+ | |||
+ | =renference= | ||
+ | [https://blog.csdn.net/Bruce1114/article/details/126034972 国内helm快速安装和添加常用charts仓库] | ||
+ | |||
+ | [https://github.com/sir5kong/helm-charts-hub Helm Charts 像站,中国区网络加速 ] | ||
+ | |||
+ | https://artifacthub.io/packages/helm/bitnami/redis-cluster | ||
+ | |||
+ | |||
https://helm.sh/docs/intro/install/ | https://helm.sh/docs/intro/install/ | ||
+ | |||
+ | |||
+ | [https://juejin.cn/post/6844903928404918286 从入门到实践:创作一个自己的 Helm Chart ] | ||
+ | [https://blog.csdn.net/qq_35887546/article/details/106051393 k8s (二十二) --- kubernetes Helm详解及使用helm部署redis高可用集群] | ||
[https://www.cnblogs.com/Erik_Xu/p/8893725.html Helm - Kubernetes服务编排的利器] | [https://www.cnblogs.com/Erik_Xu/p/8893725.html Helm - Kubernetes服务编排的利器] | ||
第133行: | 第322行: | ||
[https://cloud.tencent.com/developer/article/1433261 Kubernetes 集群使用 Helm 搭建 GitLab 并配置 Ingress] | [https://cloud.tencent.com/developer/article/1433261 Kubernetes 集群使用 Helm 搭建 GitLab 并配置 Ingress] | ||
+ | |||
+ | |||
+ | [https://www.jianshu.com/p/4bd853a8068b Helm 从入门到实践] |
2024年10月10日 (四) 03:39的最新版本
Helm基础 姐妹篇这个是helm2, 现在直接看本文 helm3
目录
helm3
helm [helm] v.掌(舵);掌握;给…戴上头盔
ins
wget -c https://get.helm.sh/helm-v3.9.3-linux-amd64.tar.gz tar xvf helm-v3.9.3-linux-amd64.tar.gz sudo mv linux-amd64/helm /usr/local/bin/helm wget -c https://get.helm.sh/helm-v3.0.3-linux-amd64.tar.gz tar xvf helm-v3.0.3-linux-amd64.tar.gz sudo mv linux-amd64/helm /usr/local/bin/helm 果想要更舒服一些,那么可以添加自动完成的代码: # source <(helm completion bash)
添加 Chart 仓库
在 Helm 3.0 版本中,默认是不会添加 Chart 仓库,所以这里我们需要手动添加,下面是添加一些常用的 Charts 库,命令如下: $ helm repo add elastic https://helm.elastic.co $ helm repo add gitlab https://charts.gitlab.io $ helm repo add harbor https://helm.goharbor.io $ helm repo add bitnami https://charts.bitnami.com/bitnami $ helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com $ helm repo add stable https://kubernetes-charts.storage.googleapis.com 增加完仓库后,需要执行更新命令,将仓库中的信息进行同步: $ helm repo update 注意:如果有的仓库不能正常解析,请更换 DNS 地址,在测试过程中,发现有的能正常解析,有的不能。如果还不行,就直接将域名和对应的地址写死在 Host 文件中
Helm 的基本操作
安装应用
通过 Helm 在 Repo 中查询可安装的 nginx
helm search repo nginx NAME CHART VERSION APP VERSION DESCRIPTION aliyun/nginx-ingress 0.9.5 0.10.2 An nginx Ingress controller that uses ConfigMap... aliyun/nginx-lego 0.3.1 Chart for nginx-ingress-controller and kube-lego apphub/nginx 5.1.5 1.16.1 Chart for the nginx server apphub/nginx-ingress 1.30.3 0.28.0 An nginx Ingress controller that uses ConfigMap... apphub/nginx-ingress-controller 5.3.4 0.29.0 Chart for the nginx Ingress controller apphub/nginx-lego 0.3.1 Chart for nginx-ingress-controller and kube-lego apphub/nginx-php 1.0.0 nginx-1.10.3_php-7.0 Chart for the nginx php server bitnami/nginx 5.1.7 1.16.1 Chart for the nginx server helm search repo redis NAME CHART VERSION APP VERSION DESCRIPTION aliyun/redis 1.1.15 4.0.8 Open source, advanced key-value store. It is of... aliyun/redis-ha 2.0.1 Highly available Redis cluster with multiple se...
安装测试:
–namespace:指定安装的 Namespace
helm install nginx bitnami/nginx -n mydlqcloud
查看应用状态
helm status nginx -n mydlqcloud
helm redis-cluster
1. 添加 bitnami 的仓库 helm repo add bitnami https://charts.bitnami.com/bitnami #国内网络不太成功的 helm repo add azure http://mirror.azure.cn/kubernetes/charts helm repo add bitnami "https://helm-charts.itboon.top/bitnami" --force-update helm repo update bitnami 2. 查询 Redis 资源 helm repo update redis# helm search repo redis NAME CHART VERSION APP VERSION DESCRIPTION azure/prometheus-redis-exporter 3.5.1 1.3.4 DEPRECATED Prometheus exporter for Redis metrics azure/redis 10.5.7 5.0.7 DEPRECATED Open source, advanced key-value stor... azure/redis-ha 4.4.6 5.0.6 DEPRECATED - Highly available Kubernetes implem... bitnami/redis 20.1.5 7.4.0 Redis(R) is an open source, advanced key-value ... bitnami/redis-cluster 11.0.5 7.4.0 Redis(R) is an open source, scalable, distribut... 3. 拉取 chart 到本地 helm pull bitnami/redis-cluster --version 11.0.5 cd redis/ 1277 tar xvf redis-cluster-11.0.5.tgz 1278 cp redis-cluster/values.yaml ./values-test.yaml 4. 对本地 valuse-test.yaml 修改 /redis# kubectl get storageclasses NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE nfs nfs-nfs Delete Immediate false 4d23h nfs-client k8s-sigs.io/nfs-subdir-external-provisioner Delete Immediate false 4d17h cat values-test.yaml global: storageClass: "nfs-client" # 配置sc为nfs redis: password: "redis123" # 定义 redis 密码 因为你懂的原因 有很多个地方 直接替换 把 image 有关的 docker.io 改为 m.daocloud.io/docker.io 样子如下 ## @param image.debug Enable image debug mode ## image: registry: m.daocloud.io/docker.io repository: bitnami/redis-cluster tag: 7.4.0-debian-12-r4 5. 安装 Redis 集群 # 创建 mynamespace 名称空间 $ kubectl create ns mynamespace # 安装 Redis 集群 $ helm -n mynamespace install redis-cluster redis-cluster -f values-test.yaml NAME: redis-cluster LAST DEPLOYED: Thu Oct 10 02:22:11 2024 NAMESPACE: mynamespace STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: CHART NAME: redis-cluster CHART VERSION: 11.0.5 APP VERSION: 7.4.0** Please be patient while the chart is being deployed ** To get your password run: export REDIS_PASSWORD=$(kubectl get secret --namespace "mynamespace" redis-cluster -o jsonpath="{.data.redis-password}" | base64 -d) You have deployed a Redis® Cluster accessible only from within you Kubernetes Cluster.INFO: The Job to create the cluster will be created.To connect to your Redis® cluster: 1. Run a Redis® pod that you can use as a client: kubectl run --namespace mynamespace redis-cluster-client --rm --tty -i --restart='Never' \ --env REDIS_PASSWORD=$REDIS_PASSWORD \ --image m.daocloud.io/docker.io/bitnami/redis-cluster:7.4.0-debian-12-r4 -- bash 2. Connect using the Redis® CLI: redis-cli -c -h redis-cluster -a $REDIS_PASSWORD WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs: - redis.resources - updateJob.resources +info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ ⚠ SECURITY WARNING: Original containers have been substituted. This Helm chart was designed, tested, and validated on multiple platforms using a specific set of Bitnami and Tanzu Application Catalog containers. Substituting other containers is likely to cause degraded security and performance, broken chart features, and missing environment variables. Substituted images detected: - m.daocloud.io/docker.io/bitnami/redis-cluster:7.4.0-debian-12-r4 - m.daocloud.io/docker.io/bitnami/os-shell:12-debian-12-r30 - m.daocloud.io/docker.io/bitnami/redis-exporter:1.63.0-debian-12-r0 - m.daocloud.io/docker.io/bitnami/os-shell:12-debian-12-r30 ## helm -n NAMESAPCE install SERVER_NAME FILE_NAME -f CONFIG_FILE -n 指定 kubernetes 集群名称空间 -f 指定使用的配置文件,文件中定义的配置可以覆盖 redis-cluster/values.yaml 文件中配置 /redis# helm -n mynamespace list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION redis-cluster mynamespace 1 2024-10-10 02:22:11.203808604 +0000 UTC deployed redis-cluster-11.0.5 7.4.0 kubectl -n mynamespace get pods -l helm.sh/chart=redis-cluster-11.0.5 NAME READY STATUS RESTARTS AGE redis-cluster-0 1/1 Running 1 (21m ago) 24m redis-cluster-1 1/1 Running 1 (21m ago) 24m redis-cluster-2 1/1 Running 1 (21m ago) 24m redis-cluster-3 1/1 Running 1 (21m ago) 24m redis-cluster-4 1/1 Running 0 24m redis-cluster-5 1/1 Running 0 24m edis# kubectl -n mynamespace get pods,sts,svc -l helm.sh/chart=redis-cluster-11.0.5 NAME READY STATUS RESTARTS AGE pod/redis-cluster-0 1/1 Running 1 (25m ago) 28m pod/redis-cluster-1 1/1 Running 1 (25m ago) 28m pod/redis-cluster-2 1/1 Running 1 (25m ago) 28m pod/redis-cluster-3 1/1 Running 1 (25m ago) 28m pod/redis-cluster-4 1/1 Running 0 28m pod/redis-cluster-5 1/1 Running 0 28m NAME READY AGE statefulset.apps/redis-cluster 6/6 28m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/redis-cluster ClusterIP 10.233.79.164 <none> 6379/TCP 28m service/redis-cluster-headless ClusterIP None <none> 6379/TCP,16379/TCP 28m 6. 连接 Redis 集群 验证服务 kubectl get secret --namespace "mynamespace" redis-cluster -o jsonpath="{.data.redis-password}" | base64 -d 1301 export REDIS_PASSWORD=$(kubectl get secret --namespace "mynamespace" redis-cluster -o jsonpath="{.data.redis-password}" | base64 -d) 1302 kubectl run --namespace mynamespace redis-cluster-client --rm --tty -i --restart='Never' --env REDIS_PASSWORD=$REDIS_PASSWORD --image m.daocloud.io/docker.io/bitnami/redis-cluster:7.4.0-debian-12-r4 -- bash
https://juejin.cn/post/7353197221742018600
trouble
root@ubuntu-2004aug-1:~/redis# kubectl -n mynamespace get pods -l helm.sh/chart=redis-cluster-11.0.5 NAME READY STATUS RESTARTS AGE redis-cluster-0 0/1 ImagePullBackOff 0 92s redis-cluster-1 0/1 ImagePullBackOff 0 91s redis-cluster-2 0/1 ContainerCreating 0 90s redis-cluster-3 0/1 ContainerCreating 0 90s redis-cluster-4 0/1 ContainerCreating 0 89s redis-cluster-5 0/1 ContainerCreating 0 89s 原因 Pulling image "docker.io/bitnami/redis-cluster:7.4.0-debian-12-r4" m.daocloud.io/docker.io/library/xtrabackup:1.0 m.daocloud.io/docker.io/bitnami/redis-cluster:7.4.0-debian-12-r4
ins mysql
参考官方 https://helm.sh/docs/intro/quickstart/
helm repo add stable https://kubernetes-charts.storage.googleapis.com/ $ helm repo update # Make sure we get the latest list of charts $ helm install stable/mysql --generate-name NAME: mysql-1583911857 LAST DEPLOYED: Wed Mar 11 15:31:01 2020 NAMESPACE: default STATUS: deployed REVISION: 1 NOTES: MySQL can be accessed via port 3306 on the following DNS name from within your cluster: mysql-1583911857.default.svc.cluster.local To get your root password run: MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default mysql-1583911857 -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo) To connect to your database: 1. Run an Ubuntu pod that you can use as a client: kubectl run -i --tty ubuntu --image=ubuntu:16.04 --restart=Never -- bash -il 2. Install the mysql client: $ apt-get update && apt-get install mysql-client -y 3. Connect using the mysql cli, then provide your password: $ mysql -h mysql-1583911857 -p To connect to your database directly from outside the K8s cluster: MYSQL_HOST=127.0.0.1 MYSQL_PORT=3306 # Execute the following command to route the connection: kubectl port-forward svc/mysql-1583911857 3306 mysql -h ${MYSQL_HOST} -P${MYSQL_PORT} -u root -p${MYSQL_ROOT_PASSWORD}
see also
renference
https://artifacthub.io/packages/helm/bitnami/redis-cluster
https://helm.sh/docs/intro/install/
从入门到实践:创作一个自己的 Helm Chart
k8s (二十二) --- kubernetes Helm详解及使用helm部署redis高可用集群