helm是k8s的包管理,类似于管理docker镜像的docker hub
官网提供了很多中安装方式,看自己的爱好以及条件。以下是源码安装:
git clone https://github.com/helm/helm.gitcd helmmake
如果网络有问题,可以使用二进制安装
tar -zxvf helm-v3.0.0-linux-amd64.tar.gzmv linux-amd64/helm /usr/local/bin/helm
Three Big Concepts
AChart is a Helm package. It contains all of the resource definitions necessary to run an application, tool, or service inside of a Kubernetes cluster. Think of it like the Kubernetes equivalent of a Homebrew formula, an Apt dpkg, or a Yum RPM file.
ARepository is the place where charts can be collected and shared. It’s like Perl’s CPAN archive or the Fedora Package Database, but for Kubernetes packages.
ARelease is an instance of a chart running in a Kubernetes cluster. One chart can often be installed many times into the same cluster. And each time it is installed, a new release is created. Consider a MySQL chart. If you want two databases running in your cluster, you can install that chart twice. Each one will have its own release, which will in turn have its own release name.
参考这个网站可以在线安装
helm repoadd bitnami https://charts.bitnami.com/bitnami helminstall my-release bitnami/mysql
如果是内网,下载安装包后离线安装
helminstall my-release mysql-0.1.1.tgz
参考提示信息可以操作mysql
NAME: my-release LAST DEPLOYED: Sat Nov2011:21:222021 NAMESPACE: default STATUS: deployed REVISION:1 TEST SUITE: None NOTES: CHART NAME: mysql CHART VERSION:8.8.12 APP VERSION:8.0.27 ** Please be patientwhile the chart is being deployed ** Tip: Watch the deployment status using the command: kubectl get pods -w --namespace default Services:echo Primary: my-release-mysql.default.svc.cluster.local:3306 Execute the following to get the administrator credentials:echo Username: rootMYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default my-release-mysql -ojsonpath="{.data.mysql-root-password}"| base64 --decode) To connect to your database:1. Run a pod that you can use as a client: kubectl run my-release-mysql-client --rm --tty -i --restart='Never' --image docker.io/bitnami/mysql:8.0.27-debian-10-r8 --namespace default --command --bash2. To connect to primaryservice(read/write): mysql -h my-release-mysql.default.svc.cluster.local -uroot -p"$MYSQL_ROOT_PASSWORD" To upgrade this helm chart:1. Obtain the password as described on the'Administrator credentials' section andset the'root.password' parameter as shown below:ROOT_PASSWORD=$(kubectl get secret --namespace default my-release-mysql -ojsonpath="{.data.mysql-root-password}"| base64 --decode) helm upgrade --namespace default my-release bitnami/mysql --set auth.rootPassword=$ROOT_PASSWORD
使用mysql
拿到mysql的登录密码
echoMYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default my-release-mysql -ojsonpath="{.data.mysql-root-password}"| base64 --decode)
进入mysql容器pod
kubectlexec -ti my-release1-mysql-0 --bash
登录mysql
mysql -u root -p ysql> show databases;
查看
helmls
删除
helm delete my-release
热门文章
- 2月17日 | 最新SSR/Shadowrocket/V2ray/Clash高速免费节点,最高速度22.8M/S 免费Clash机场订阅地址
- 家用小型饲料颗粒机500元左右能用吗(家用小型饲料颗粒机500元左右能用吗)
- 私人协议签字按手印法律上生效吗(私人协议按手印有法律效应吗)
- 被野猫抓出一点点血有事吗(被野猫抓了一点点血)
- 为vscode开发一款svn右键菜单扩展
- Mysql数据库基本操作(六)多表查询-内连接查询,外连接查询
- 12月28日 | 最新Clash/V2ray/Shadowrocket/SSR高速免费节点,最高速度20.9M/S 免费Clash机场订阅地址
- 2月13日 | 最新V2ray/SSR/Shadowrocket/Clash高速免费节点,最高速度18.1M/S 免费Clash机场订阅地址
- 宠物粮食成本分析表(宠物粮食原材料)
- 开宠物用品店的优势和劣势分析论文(宠物用品店的开店详情)