"azure" has been added to your repositories ┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$helm repo add ali https://apphub.aliyuncs.com "ali" has been added to your repositories
查看刚才添加的yum源
1 2 3 4 5 6 7
┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$helm repo list NAME URL azure http://mirror.azure.cn/kubernetes/charts/ ali https://apphub.aliyuncs.com ┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$
┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$helm search repo mysql NAME CHART VERSION APP VERSION DESCRIPTION
ali/mysql 6.8.0 8.0.19 Chart to create a Highly available MySQL cluster ali/mysqldump 2.6.0 2.4.1 A Helm chart to help backup MySQL databases usi... ali/mysqlha 1.0.0 5.7.13 MySQL cluster with a single master and zero or ... ali/prometheus-mysql-exporter 0.5.2 v0.11.0 A Helm chart for prometheus mysql exporter with... azure/mysql 1.6.9 5.7.30 DEPRECATED - Fast, reliable, scalable, and easy... azure/mysqldump 2.6.2 2.4.1 DEPRECATED! - A Helm chart to help backup MySQL... azure/prometheus-mysql-exporter 0.7.1 v0.11.0 DEPRECATED A Helm chart for prometheus mysql 。。。。。。。。。。
┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$rm -rf mysql-1.6.4.tgz ; helm package mysql/ Successfully packaged chart and saved it to: /root/ansible/k8s-helm-create/mysql-1.6.4.tgz ┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$ls mysql mysql-1.6.4.tgz
下面我们修改chart中的对应镜像为已经下载好的mysql和busybox镜像
1 2 3 4 5 6 7 8 9 10 11 12 13 14
┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$ansible 192.168.26.82 -m shell -a "docker images | grep mysql" 192.168.26.82 | CHANGED | rc=0 >> mysql latest ecac195d15af 2 months ago 516MB mysql <none> 9da615fced53 3 months ago 514MB hub.c.163.com/library/mysql latest 9e64176cd8a2 4 years ago 407MB ┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$ansible 192.168.26.82 -m shell -a "docker images | grep busybox" 192.168.26.82 | CHANGED | rc=0 >> busybox latest ffe9d497c324 5 weeks ago 1.24MB busybox <none> 7138284460ff 2 months ago 1.24MB busybox <none> cabb9f684f8b 2 months ago 1.24MB busybox 1.27 6ad733544a63 4 years ago 1.13MB yauritux/busybox-curl latest 69894251bd3c 5 years ago 21.3MB
1 2 3 4 5
┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$fg vim ./k8s-helm-create/mysql/values.yaml ┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$
**通过修好的yaml文件创建chart**, 使用helm ls查看当前运行的chart
1 2 3
┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$helm ls NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$cd mysql/ ┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create/mysql] └─$helm install mydb . NAME: mydb LAST DEPLOYED: Thu Jan 13 01:51:42 2022 NAMESPACE: liruilong-network-create STATUS: deployed REVISION: 1 NOTES: MySQL can be accessed via port 3306 on the following DNS name from within your cluster: mydb-mysql.liruilong-network-create.svc.cluster.local
┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create/mysql] └─$mysql -h10.107.17.103 -uroot -ptesting Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 7 Server version: 5.7.18 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h'forhelp. Type '\c' to clear the current input statement.
MySQL [(none)]> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed
删除Release
1 2 3 4 5 6 7 8
┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create/mysql] └─$helm del mydb release "mydb" uninstalled ┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create/mysql] └─$helm ls NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION ┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create/mysql] └─$
┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$helm repo add liruilong_repo http://192.168.26.83:8080/charts "liruilong_repo" has been added to your repositories ┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$helm repo list NAME URL azure http://mirror.azure.cn/kubernetes/charts/ ali https://apphub.aliyuncs.com liruilong_repo http://192.168.26.83:8080/charts
私有源查找安装的chart
1 2 3 4 5
┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$helm search repo mysql | grep liruilong liruilong_repo/mysql 1.6.4 5.7.30 Fast, reliable, scalable, and easy to use open-... ┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$
┌──[root@vms81.liruilongs.github.io]-[~/ansible] └─$helm list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION ┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$helm install liruilongdb liruilong_repo/mysql NAME: liruilongdb LAST DEPLOYED: Thu Jan 13 02:42:41 2022 NAMESPACE: liruilong-network-create STATUS: deployed REVISION: 1 NOTES: MySQL can be accessed via port 3306 on the following DNS name from within your cluster: liruilongdb-mysql.liruilong-network-create.svc.cluster.local
┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$helm status liruilongdb NAME: liruilongdb LAST DEPLOYED: Thu Jan 13 02:42:41 2022 NAMESPACE: liruilong-network-create STATUS: deployed REVISION: 1 NOTES: MySQL can be accessed via port 3306 on the following DNS name from within your cluster: liruilongdb-mysql.liruilong-network-create.svc.cluster.local
┌──[root@vms81.liruilongs.github.io]-[~/ansible/k8s-helm-create] └─$kubectl get configmaps NAME DATA AGE kube-root-ca.crt 1 12d liruilongdb-mysql-test 1 2d19h