4.1 安装 helm

helm 官方网站

github 仓库地址

官方可用的 Chart 列表:https://hub.kubeapps.com

4.1.2 安装 helm3

helm3 与 helm2 最大的区别就是:不再需要 tiller,直接使用 kubectl 的上下文权限 (kubeconfig),这里主要介绍 helm3 的安装和使用

helm 最新版本为3.8.0

下载安装 helm3

wget https://get.helm.sh/helm-v3.8.0-linux-amd64.tar.gz
tar xf helm-v3.8.0-linux-amd64.tar.gz -C /usr/local/bin --strip-components 1 linux-amd64/helm

如果是 MacOS 可以直接使用 brew 进行安装

brew install helm

查看 helm 版本

helm version
version.BuildInfo{Version:"v3.8.0", GitCommit:"d14138609b01886f544b2025f5000351c9eb092e", GitTreeState:"clean", GoVersion:"go1.17.5"}

添加 helm 仓库

默认情况下没有自带仓库的

helm repo list
Error: no repositories to show

添加仓库

仓库地址根据你的安装需要可以从artifacthub.io获取

比如添加 bitnami

helm repo add bitnami https://charts.bitnami.com/bitnami
"bitnami" has been added to your repositories

查看仓库列表

helm repo list
NAME    URL
bitnami https://charts.bitnami.com/bitnami

# 查询 bitnami 下的 charts
helm search repo bitnami

输出如下

NAME                                            CHART VERSION   APP VERSION     DESCRIPTION                                       
bitnami/bitnami-common                          0.0.9           0.0.9           DEPRECATED Chart with custom templates used in ...
bitnami/airflow                                 11.4.1          2.2.3           Apache Airflow is a platform to programmaticall...
bitnami/apache                                  9.0.1           2.4.52          Chart for Apache HTTP Server                      
bitnami/argo-cd                                 3.0.2           2.2.3           Declarative, GitOps continuous delivery tool fo...
bitnami/argo-workflows                          0.2.3           3.2.7           Argo Workflows is meant to orchestrate Kubernet...
bitnami/aspnet-core                             3.1.0           6.0.1           ASP.NET Core is an open-source framework create...
bitnami/cassandra                               9.1.5           4.0.1           Apache Cassandra is an open source distributed ...
bitnami/cert-manager                            0.4.3           1.7.0           Cert Manager is a Kubernetes add-on to automate...
bitnami/common                                  1.10.4          1.10.0          A Library Helm Chart for grouping common logic ...
bitnami/concourse                               0.2.2           7.6.0           Concourse is a pipeline-based continuous thing-...
bitnami/consul                                  10.2.3          1.11.2          Highly available and distributed service discov...
bitnami/contour                                 7.3.3           1.19.1          Contour Ingress controller for Kubernetes         
bitnami/contour-operator                        0.2.5           1.19.1          The Contour Operator extends the Kubernetes API...
bitnami/dataplatform-bp1                        9.0.8           1.0.1           OCTO Data platform Kafka-Spark-Solr Helm Chart    
bitnami/dataplatform-bp2                        10.0.8          1.0.1           OCTO Data platform Kafka-Spark-Elasticsearch He...
bitnami/discourse                               5.2.3           2.7.13          A Helm chart for deploying Discourse to Kubernetes
bitnami/dokuwiki                                12.2.1          20200729.0.0    DokuWiki is a standards-compliant, simple to us...
bitnami/drupal                                  11.0.4          9.3.3           One of the most versatile open source content m...
bitnami/ejbca                                   5.1.2           7.4.3-2         Enterprise class PKI Certificate Authority buil...
bitnami/elasticsearch                           17.8.0          7.16.3          A highly scalable open-source full-text search ...
bitnami/etcd                                    6.13.2          3.5.1           etcd is a distributed key value store that prov...
bitnami/external-dns                            6.1.2           0.10.2          ExternalDNS is a Kubernetes addon that configur...
bitnami/fluentd                                 5.0.1           1.14.4          Fluentd is an open source data collector for un...
bitnami/geode                                   0.4.4           1.14.3          Apache Geode is a data management platform that...
bitnami/ghost                                   16.0.4          4.34.0          Ghost is an open source publishing platform des...
bitnami/grafana                                 7.6.4           8.3.4           Grafana is an open source, feature rich metrics...
bitnami/grafana-operator                        2.2.2           4.1.1           Kubernetes Operator based on the Operator SDK f...
bitnami/grafana-tempo                           1.0.2           1.2.1           Grafana Tempo is an open source, easy-to-use an...
bitnami/haproxy                                 0.3.1           2.5.1           HAProxy is a TCP proxy and a HTTP reverse proxy...
bitnami/harbor                                  11.2.2          2.4.1           Harbor is an an open source trusted cloud nativ...
bitnami/influxdb                                3.0.2           2.1.1           InfluxDB™ is an open source time-series d...
bitnami/jasperreports                           12.0.4          7.8.1           The JasperReports server can be used as a stand...
bitnami/jenkins                                 8.1.4           2.319.2         The leading open source automation server         
bitnami/joomla                                  12.0.3          4.0.6           Joomla! is an award winning open source CMS pla...
bitnami/jupyterhub                              0.4.3           1.5.0           JupyterHub brings the power of notebooks to gro...
bitnami/kafka                                   15.0.1          3.1.0           Apache Kafka is a distributed streaming platfor...
bitnami/keycloak                                6.1.1           16.1.1          Keycloak is a high performance Java-based ident...
bitnami/kiam                                    0.4.2           3.6.0           kiam is a proxy that captures AWS Metadata API ...
bitnami/kibana                                  9.3.2           7.16.3          Kibana is an open source, browser based analyti...
bitnami/kong                                    5.0.4           2.7.1           Kong is an open source Microservice API gateway...
bitnami/kube-prometheus                         6.6.5           0.54.0          Prometheus Operator provides easy monitoring de...
bitnami/kube-state-metrics                      2.2.4           2.3.0           kube-state-metrics is a simple service that lis...
bitnami/kubeapps                                7.7.2           2.4.2           Kubeapps is a dashboard for your Kubernetes clu...
bitnami/kubernetes-event-exporter               1.3.2           0.11.0          This tool allows exporting the often missed Kub...
bitnami/kubewatch                               3.2.24          0.1.0           Kubewatch is a Kubernetes watcher that currentl...
bitnami/logstash                                3.7.3           7.16.3          Logstash is an open source, server-side data pr...
bitnami/magento                                 19.2.3          2.4.3           A feature-rich flexible e-commerce solution. It...
bitnami/mariadb                                 10.3.2          10.5.13         Fast, reliable, scalable, and easy to use open-...
bitnami/mariadb-cluster                         1.0.2           10.2.14         DEPRECATED Chart to create a Highly available M...
bitnami/mariadb-galera                          6.2.2           10.6.5          MariaDB Galera is a multi-master database clust...
bitnami/mean                                    6.1.2           4.6.2           DEPRECATED MEAN is a free and open-source JavaS...
bitnami/mediawiki                               13.0.2          1.37.1          Extremely powerful, scalable software and a fea...
bitnami/memcached                               6.0.2           1.6.13          Memcached is an high-performance, distributed m...
bitnami/metallb                                 2.6.2           0.11.0          The Metal LB for Kubernetes                       
bitnami/metrics-server                          5.11.0          0.6.0           Metrics Server aggregates resource usage data, ...
bitnami/minio                                   10.1.1          2022.1.28       MinIO(R) is an object storage server, compatibl...
bitnami/mongodb                                 11.0.0          4.4.12          MongoDB(R) is a relational open source NoSQL da...
bitnami/mongodb-sharded                         4.0.1           4.4.12          MongoDB(R) is an open source NoSQL database tha...
bitnami/moodle                                  12.0.3          3.11.5          Moodle(TM) LMS is an open source online Learnin...
bitnami/mxnet                                   2.4.2           1.9.0           A flexible and efficient library for deep learning
bitnami/mysql                                   8.8.23          8.0.28          Chart to create a Highly available MySQL cluster  
bitnami/nats                                    7.1.3           2.7.0           An open-source, cloud-native messaging system     
bitnami/nginx                                   9.7.5           1.21.6          NGINX Open Source is a web server that can be a...
bitnami/nginx-ingress-controller                9.1.5           1.1.1           NGINX Ingress Controller is an Ingress controll...
bitnami/nginx-intel                             0.1.1           0.4.7           NGINX Open Source for Intel is a lightweight se...
bitnami/node                                    16.2.5          16.13.2         Event-driven I/O server-side JavaScript environ...
bitnami/node-exporter                           2.4.1           1.3.1           Prometheus exporter for hardware and OS metrics...
bitnami/oauth2-proxy                            2.0.1           7.2.1           A reverse proxy and static file server that pro...
bitnami/odoo                                    20.2.4          15.0.20220110   A suite of web based open source business apps.   
bitnami/opencart                                11.0.4          3.0.3-8         A free and open source e-commerce platform for ...
bitnami/orangehrm                               11.0.3          4.9.0-0         DEPRECATED OrangeHRM is a free HR management sy...
bitnami/osclass                                 13.0.3          8.0.1           Osclass is a php script that allows you to quic...
bitnami/owncloud                                11.0.4          10.9.1          A file sharing server that puts the control and...
bitnami/parse                                   15.1.1          4.10.4          Parse is a platform that enables users to add a...
bitnami/phabricator                             11.0.30         2021.26.0       DEPRECATED Collection of open source web applic...
bitnami/phpbb                                   11.0.3          3.3.5           Community forum that supports the notion of use...
bitnami/phpmyadmin                              9.0.2           5.1.2           phpMyAdmin is a free software tool written in P...
bitnami/postgresql                              10.16.2         11.14.0         Chart for PostgreSQL, an object-relational data...
bitnami/postgresql-ha                           8.2.7           11.14.0         Chart for PostgreSQL with HA architecture (usin...
bitnami/prestashop                              14.0.4          1.7.8-3         PrestaShop is a powerful open source eCommerce ...
bitnami/prometheus-operator                     0.31.1          0.41.0          DEPRECATED The Prometheus Operator for Kubernet...
bitnami/pytorch                                 2.3.24          1.10.1          Deep learning platform that accelerates the tra...
bitnami/rabbitmq                                8.27.0          3.9.13          Open source message broker software that implem...
bitnami/rabbitmq-cluster-operator               2.2.2           1.11.0          The RabbitMQ Cluster Kubernetes Operator automa...
bitnami/redis                                   16.2.1          6.2.6           Open source, advanced key-value store. It is of...
bitnami/redis-cluster                           7.2.1           6.2.6           Open source, advanced key-value store. It is of...
bitnami/redmine                                 17.2.3          4.2.3           A flexible project management web application.
bitnami/solr                                    3.0.2           8.11.1          Apache Solr is an open source enterprise search...
bitnami/sonarqube                               0.2.4           9.2.4           SonarQube is an open source quality management ...
bitnami/spark                                   5.8.5           3.2.1           Apache Spark is a high-performance engine for l...
bitnami/spring-cloud-dataflow                   5.0.5           2.9.2           Spring Cloud Data Flow is a microservices-based...
bitnami/sugarcrm                                1.0.6           6.5.26          DEPRECATED SugarCRM enables businesses to creat...
bitnami/suitecrm                                10.0.3          7.12.2          SuiteCRM is a completely open source enterprise...
bitnami/tensorflow-inception                    3.3.2           1.13.0          DEPRECATED Open-source software library for ser...
bitnami/tensorflow-resnet                       3.4.2           2.7.0           Open-source software library serving the ResNet...
bitnami/testlink                                10.0.4          1.9.20          Web-based test management system that facilitat...
bitnami/thanos                                  9.0.2           0.24.0          Thanos is a highly available metrics system tha...
bitnami/tomcat                                  10.1.5          10.0.16         Apache Tomcat is an open-source web server desi...
bitnami/wavefront                               3.1.25          1.8.0           Chart for Wavefront Collector for Kubernetes
bitnami/wavefront-adapter-for-istio             1.0.18          0.1.5           Wavefront Adapter for Istio is a lightweight Is...
bitnami/wavefront-hpa-adapter                   1.0.8           0.9.8           Wavefront HPA Adapter for Kubernetes is a Kuber...
bitnami/wavefront-prometheus-storage-adapter    1.0.21          1.0.5           Wavefront Storage Adapter is a Prometheus integ...
bitnami/wildfly                                 13.1.3          26.0.1          Wildfly is a lightweight, open source applicati...
bitnami/wordpress                               13.0.6          5.8.3           WordPress is the world's most popular blogging ...
bitnami/zookeeper                               8.0.1           3.7.0           A centralized service for maintaining configura...

helm3常用命令

helm -h
The Kubernetes package manager

Common actions for Helm:

- helm search:    search for charts
- helm pull:      download a chart to your local directory to view
- helm install:   upload the chart to Kubernetes
- helm list:      list releases of charts

Environment variables:

| Name                               | Description                                                                       |
|------------------------------------|-----------------------------------------------------------------------------------|
| $HELM_CACHE_HOME                   | set an alternative location for storing cached files.                             |
| $HELM_CONFIG_HOME                  | set an alternative location for storing Helm configuration.                       |
| $HELM_DATA_HOME                    | set an alternative location for storing Helm data.                                |
| $HELM_DEBUG                        | indicate whether or not Helm is running in Debug mode                             |
| $HELM_DRIVER                       | set the backend storage driver. Values are: configmap, secret, memory, sql.       |
| $HELM_DRIVER_SQL_CONNECTION_STRING | set the connection string the SQL storage driver should use.                      |
| $HELM_MAX_HISTORY                  | set the maximum number of helm release history.                                   |
| $HELM_NAMESPACE                    | set the namespace used for the helm operations.                                   |
| $HELM_NO_PLUGINS                   | disable plugins. Set HELM_NO_PLUGINS=1 to disable plugins.                        |
| $HELM_PLUGINS                      | set the path to the plugins directory                                             |
| $HELM_REGISTRY_CONFIG              | set the path to the registry config file.                                         |
| $HELM_REPOSITORY_CACHE             | set the path to the repository cache directory                                    |
| $HELM_REPOSITORY_CONFIG            | set the path to the repositories file.                                            |
| $KUBECONFIG                        | set an alternative Kubernetes configuration file (default "~/.kube/config")       |
| $HELM_KUBEAPISERVER                | set the Kubernetes API Server Endpoint for authentication                         |
| $HELM_KUBECAFILE                   | set the Kubernetes certificate authority file.                                    |
| $HELM_KUBEASGROUPS                 | set the Groups to use for impersonation using a comma-separated list.             |
| $HELM_KUBEASUSER                   | set the Username to impersonate for the operation.                                |
| $HELM_KUBECONTEXT                  | set the name of the kubeconfig context.                                           |
| $HELM_KUBETOKEN                    | set the Bearer KubeToken used for authentication.                                 |

Helm stores cache, configuration, and data based on the following configuration order:

- If a HELM_*_HOME environment variable is set, it will be used
- Otherwise, on systems supporting the XDG base directory specification, the XDG variables will be used
- When no other location is set a default location will be used based on the operating system

By default, the default directories depend on the Operating System. The defaults are listed below:

| Operating System | Cache Path                | Configuration Path             | Data Path               |
|------------------|---------------------------|--------------------------------|-------------------------|
| Linux            | $HOME/.cache/helm         | $HOME/.config/helm             | $HOME/.local/share/helm |
| macOS            | $HOME/Library/Caches/helm | $HOME/Library/Preferences/helm | $HOME/Library/helm      |
| Windows          | %TEMP%\helm               | %APPDATA%\helm                 | %APPDATA%\helm          |

Usage:
  helm [command]

Available Commands:
  completion  generate autocompletion scripts for the specified shell
  create      create a new chart with the given name
  dependency  manage a chart's dependencies
  env         helm client environment information
  get         download extended information of a named release
  help        Help about any command
  history     fetch release history
  install     install a chart
  lint        examine a chart for possible issues
  list        list releases
  package     package a chart directory into a chart archive
  plugin      install, list, or uninstall Helm plugins
  pull        download a chart from a repository and (optionally) unpack it in local directory
  push        push a chart to remote
  registry    login to or logout from a registry
  repo        add, list, remove, update, and index chart repositories
  rollback    roll back a release to a previous revision
  search      search for a keyword in charts
  show        show information of a chart
  status      display the status of the named release
  template    locally render templates
  test        run tests for a release
  uninstall   uninstall a release
  upgrade     upgrade a release
  verify      verify that a chart at the given path has been signed and is valid
  version     print the client version information

Flags:
      --debug                       enable verbose output
  -h, --help                        help for helm
      --kube-apiserver string       the address and the port for the Kubernetes API server
      --kube-as-group stringArray   group to impersonate for the operation, this flag can be repeated to specify multiple groups.
      --kube-as-user string         username to impersonate for the operation
      --kube-ca-file string         the certificate authority file for the Kubernetes API server connection
      --kube-context string         name of the kubeconfig context to use
      --kube-token string           bearer token used for authentication
      --kubeconfig string           path to the kubeconfig file
  -n, --namespace string            namespace scope for this request
      --registry-config string      path to the registry config file (default "/home/jerry/.config/helm/registry/config.json")
      --repository-cache string     path to the file containing cached repository indexes (default "/home/jerry/.cache/helm/repository")
      --repository-config string    path to the file containing repository names and URLs (default "/home/jerry/.config/helm/repositories.yaml")

Use "helm [command] --help" for more information about a command.
Copyright © huangzhongde.cn 2021 all right reserved,powered by Gitbook该文件修订时间: 2022-01-30 17:51:13

results matching ""

    No results matching ""