Files
k8s-docs/k8s/xiongxiao.me/config/helm.md
2025-11-27 08:51:37 +08:00

69 lines
1.2 KiB
Markdown

# Helm 安装和使用指南
## 安装 Helm
### 最新版地址
请访问 [Helm 官方下载页面](https://helm.sh/docs/intro/install/) 获取最新版本的下载链接。
### Linux/macOS
```bash
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-4
chmod 700 get_helm.sh
./get_helm.sh
```
### 直接下载二进制文件
```bash
curl https://get.helm.sh/helm-v4.0.1-linux-amd64.tar.gz | tar xz
sudo mv linux-amd64/helm /usr/local/bin/
```
### Windows (使用 Chocolatey)
```bash
choco install kubernetes-helm
```
## 基本使用
### 添加 Chart 仓库
```bash
helm repo add stable https://charts.helm.sh/stable
helm repo add bitnami https://charts.bitnami.com/
helm repo update
```
### 搜索 Chart
```bash
helm search repo nginx
```
### 安装应用
```bash
helm install my-nginx bitnami/nginx
```
### 查看安装的 Release
```bash
helm list
```
### 卸载应用
```bash
helm uninstall my-nginx
```
## 自定义配置
创建 `values.yaml` 文件:
```yaml
replicaCount: 3
image:
tag: "1.21"
service:
type: NodePort
port: 80
```
安装时使用自定义配置:
```bash
helm install my-app ./my-chart -f values.yaml
```