$ helm search repo redis NAME CHART VERSION APP VERSION DESCRIPTION bitnami/redis 17.1.6 7.0.4 Redis(R) is an open source.. bitnami/redis-cluster 8.2.2 7.0.4 Redis(R) is an open source...
CHART VERSION是char的版本,APP VERSION是redis的版本
4.2.2 查看应用版本列表
$ helm search repo bitnami/redis -l NAME CHART VERSION APP VERSION DESCRIPTION bitnami/redis 17.1.6 7.0.4 Redis(R) is an open source... bitnami/redis 17.1.5 7.0.4 Redis(R) is an open source... ... bitnami/redis 17.0.1 7.0.3 Redis(R) is an open source... bitnami/redis 16.13.2 6.2.7 Redis(R) is an open source... bitnami/redis 16.13.1 6.2.7 Redis(R) is an open source... ...
# 下面是测试访问服务方法 To get your password run: # 1.设置环境变量 export REDIS_PASSWORD=$(kubectl get secret --namespace default redis-server -o jsonpath="{.data.redis-password}" | base64 -d)
To connect to your Redis® server:
1. Run a Redis® pod that you can use as a client: # 2. 运行redis-client pod kubectl run --namespace default redis-client --restart='Never' --env REDIS_PASSWORD=$REDIS_PASSWORD --image docker.io/bitnami/redis:6.2.7-debian-11-r9 --command -- sleep infinity
Use the following command to attach to the pod: # 3. 进入pod kubectl exec --tty -i redis-client --namespace default -- bash
# 故意写错yaml语法,再次校验 $ helm lint helloword ==> Linting helloword [ERROR] Chart.yaml: unable to parse YAML error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context [ERROR] templates/: cannot load Chart.yaml: error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context [ERROR] : unable to load chart cannot load Chart.yaml: error converting YAML to JSON: yaml: line 2: mapping values are not allowed in this context
Error: 1 chart(s) linted, 1 chart(s) failed
5.6 安装
5.6.1 基于打包文件安装
# 基于打包文件安装 $ helm install hello-word helloword-0.1.0.tgz NAME: hello-word LAST DEPLOYED: Thu Sep 29 15:24:24 2022 NAMESPACE: default STATUS: deployed REVISION: 1 NOTES: 1. Get the application URL by running these commands: export NODE_PORT=$(kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services hello-word-app) export NODE_IP=$(kubectl get nodes --namespace default -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT
5.6.2 查看服务信息
# helm服务列表 $ helm list NAME NAMESPACE REVISION STATUS CHART APP VERSION hello-word default 1 deployed helloword-0.1.0 0.1.1 # 查看k8s service $ kubectl get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello-word-app NodePort 10.101.62.30 <none> 80:30001/TCP 7m11s # 查看k8s deploy $ kubectl get deploy NAME READY UP-TO-DATE AVAILABLE AGE IMAGES ... hello-word-app 1/1 1 1 7m46s docker.io/liuqinghui/gin-hello:v1 ... # 查看k8s pod $ kubectl get pod -o wide NAME READY STATUS RESTARTS IP NODE ... hello-word-app-d467dbcd8-g796n 1/1 Running 0 10.244.104.9 node2 ...