helm 安装及使用

环境信息

  • centos7 5.4.212-1.el7
  • kubernetes Server Version: v1.25.0
  • Helm 3.10.0

安装

  1. 下载 需要的版本

    wget https://get.helm.sh/helm-v3.10.0-linux-amd64.tar.gz
  2. 解压

    tar -xf helm-v3.10.0-linux-amd64.tar.gz
  3. 在解压目中找到 helm 程序,移动到需要的目录中

    cp linux-amd64/helm /usr/local/bin/
  4. 验证

    $ helm version
    version.BuildInfo{Version:"v3.10.0", GitCommit:"ce66412a723e4d89555dc67217607c6579ffcb21", GitTreeState:"clean", GoVersion:"go1.18.6"}

常见用法

查看已安装的 release

helm ls

helm ls -A

卸载

$ helm ls -A
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
cert-manager cert-manager 1 2022-11-01 09:57:11.373366484 +0800 CST failed cert-manager-v1.7.1 v1.7.1
rancher cattle-system 1 2022-11-01 10:05:07.370131566 +0800 CST failed rancher-2.6.9 v2.6.9

$ helm uninstall rancher -n cattle-system
W1101 10:21:32.764269 11113 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
W1101 10:21:34.043445 11113 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
W1101 10:21:39.809766 11113 warnings.go:70] policy/v1beta1 PodSecurityPolicy is deprecated in v1.21+, unavailable in v1.25+
release "rancher" uninstalled

查看导入的 repo

$ helm repo ls
NAME URL
rancher-stable https://releases.rancher.com/server-charts/stable
jetstack https://charts.jetstack.io
hashicorp https://helm.releases.hashicorp.com

搜索/查看可用的 repo

$ helm search repo hashicorp/vault
NAME CHART VERSION APP VERSION DESCRIPTION
hashicorp/vault 0.25.0 1.14.0 Official HashiCorp Vault Chart
hashicorp/vault-secrets-operator 0.1.0 0.1.0 Official Vault Secrets Operator Chart

查看可用的 releases

$ helm search repo hashicorp/vault -l
NAME CHART VERSION APP VERSION DESCRIPTION
hashicorp/vault 0.25.0 1.14.0 Official HashiCorp Vault Chart
hashicorp/vault 0.24.1 1.13.1 Official HashiCorp Vault Chart
hashicorp/vault 0.24.0 1.13.1 Official HashiCorp Vault Chart
hashicorp/vault 0.23.0 1.12.1 Official HashiCorp Vault Chart
hashicorp/vault 0.22.1 1.12.0 Official HashiCorp Vault Chart
hashicorp/vault 0.22.0 1.11.3 Official HashiCorp Vault Chart

安装

$ helm install vault hashicorp/vault --version 0.25.0
NAME: vault
LAST DEPLOYED: Mon Jul 10 14:59:13 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
Thank you for installing HashiCorp Vault!

Now that you have deployed Vault, you should look over the docs on using
Vault with Kubernetes available here:

https://www.vaultproject.io/docs/


Your release is named vault. To learn more about the release, try:

$ helm status vault
$ helm get manifest vault