helm安装及配置
1. 安装helm
helm下载地址:https://github.com/kubernetes/helm/releases
根据helm和k8s配套关系,下载安装合适的helm版本。下面为版本配套关系:
Helm 版本 | 支持的 Kubernetes 版本 |
---|---|
3.12.x | 1.27.x - 1.24.x |
3.11.x | 1.26.x - 1.23.x |
3.10.x | 1.25.x - 1.22.x |
3.9.x | 1.24.x - 1.21.x |
3.8.x | 1.23.x - 1.20.x |
3.7.x | 1.22.x - 1.19.x |
3.6.x | 1.21.x - 1.18.x |
3.5.x | 1.20.x - 1.17.x |
3.4.x | 1.19.x - 1.16.x |
3.3.x | 1.18.x - 1.15.x |
... |
二进制安装
我这里的k8s版本为1.18,下载helm3.6.1:
wget https://get.helm.sh/helm-v3.6.1-linux-amd64.tar.gz
# 解压压缩包
tar -xf helm-v3.6.1-linux-amd64.tar.gz
# 将helm文件拷贝到系统path路径下
cp linux-amd64/helm /usr/local/bin/helm
# 验证
helm version
# 帮助文档
helm help
脚本安装
Helm现在有个安装脚本可以自动拉取最新的Helm版本并在本地安装
$ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
$ chmod 700 get_helm.sh
$ ./get_helm.sh
或者直接运行:
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
通过包管理器安装
-
使用Homebrew (macOS):
brew install helm
-
使用Chocolatey (Windows):
choco install kubernetes-helm
-
使用Scoop (Windows):
scoop install helm
-
使用Winget (Windows):
winget install Helm.Helm
-
使用Apt (Debian/Ubuntu):
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt-get install apt-transport-https --yes
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm
- 使用 dnf/yum (fedora):
sudo dnf install helm
- 使用snap:
sudo snap install helm --classic
除此之外,还有更多的安装方式,详细请参考官方文档:https://helm.sh/zh/docs/intro/install/
2. 配置helm仓库
添加仓库
helm repo add bitnami "https://helm-charts.itboon.top/bitnami" --force-update
helm repo add grafana "https://helm-charts.itboon.top/grafana" --force-update
helm repo add prometheus-community "https://helm-charts.itboon.top/prometheus-community" --force-update
helm repo add ingress-nginx "https://helm-charts.itboon.top/ingress-nginx" --force-update
helm repo update
测试
helm repo add bitnami "https://helm-charts.itboon.top/bitnami" --force-update
helm repo update bitnami
helm template nginx bitnami/nginx
部署应用
## 部署 nginx
helm upgrade --install nginx \
--namespace chart-demo \
--create-namespace \
bitnami/nginx
## 部署 redis
helm upgrade --install redis \
--namespace chart-demo \
--create-namespace \
--set master.persistence.enabled="false" \
--set replica.replicaCount="1" \
--set replica.persistence.enabled="false" \
bitnami/redis
标签:https,get,--,配置,install,helm,bitnami,安装
From: https://www.cnblogs.com/lldhsds/p/18279776