helm方便的命令系列

仓库

helm repo list
NAME        URL
stable      https://kubernetes-charts.storage.googleapis.com
local       http://127.0.0.1:8879/charts
incubator   http://storage.googleapis.com/kubernetes-charts-incubator

图表搜索

helm search mysql
NAME                                CHART VERSION   APP VERSION DESCRIPTION
incubator/mysqlha                   1.0.0           5.7.13      MySQL cluster with a single master and zero or more slave...
stable/mysql                        1.6.2           5.7.28      Fast, reliable, scalable, and easy to use open-source rel...
stable/mysqldump                    2.6.0           2.4.1       A Helm chart to help backup MySQL databases using mysqldump
stable/prometheus-mysql-exporter    0.5.2           v0.11.0     A Helm chart for prometheus mysql exporter with cloudsqlp...
stable/percona                      1.2.0           5.7.17      free, fully compatible, enhanced, open source drop-in rep...
stable/percona-xtradb-cluster       1.0.3           5.7.19      free, fully compatible, enhanced, open source drop-in rep...
stable/phpmyadmin                   4.2.12          5.0.1       phpMyAdmin is an mysql administration frontend
stable/gcloud-sqlproxy              0.6.1           1.11        DEPRECATED Google Cloud SQL Proxy
stable/mariadb                      7.3.9           10.3.22     Fast, reliable, scalable, and easy to use open-source rel...

下载存档

helm fetch stable/mysql
mysql-1.6.2.tgz

生成图表

模板将被创建。

helm create sample

档案

当你自己创建一个网页服务器并公开时

helm package sample
~/D/tmp ❯❯❯ helm package sample                                                               ✘ 127
Successfully packaged chart and saved it to: /Users/yuta/Desktop/tmp/sample-0.1.0.tgz

语法检查

helm lint sample-0.1.0.tgz
==> Linting sample-0.1.0.tgz
[INFO] Chart.yaml: icon is recommended

1 chart(s) linted, no failures

显示yaml文件的内容

helm template sample-0.1.0.tgz
---
# Source: sample/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: release-name-sample
  labels:
    app.kubernetes.io/name: sample
    helm.sh/chart: sample-0.1.0
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "1.0"
    app.kubernetes.io/managed-by: Tiller
---
# Source: sample/templates/service.yaml
apiVersion: v1

当想要获取已公开的Chart的yaml文件时。

~/D/tmp ❯❯❯ helm fetch stable/mysql
~/D/tmp ❯❯❯ helm template mysql-1.6.2.tgz

将chart安装到集群中

helm install sample
广告
将在 10 秒后关闭
bannerAds