--- title: Helm Chart 部署与 values 策略实战 keywords: - Helm - Chart - values.yaml - 覆盖策略 - 发布 description: 通过自定义 values 与分环境覆盖策略部署 Helm Chart,提供命令与 values 片段示例。 categories: - 文章资讯 - 技术教程 --- # Helm Chart 部署与 values 策略实战 ## values 片段 ```yaml replicaCount: 3 image: repository: example/app tag: v1.2.0 pullPolicy: IfNotPresent service: type: ClusterIP port: 80 resources: limits: cpu: 500m memory: 512Mi requests: cpu: 200m memory: 256Mi ``` ## 部署命令 ``` helm repo add example https://charts.example.com helm upgrade --install web example/web -f values.yaml -n default ``` ## 分环境覆盖 ``` helm upgrade --install web example/web -f values.yaml -f values.prod.yaml -n default ``` ## 验证 - `kubectl get deploy,svc` 查看副本与服务端口 - 通过事件与日志确认滚动更新与启动健康 ## 总结 借助分环境 values 组合,可在保持一致性的同时灵活调整资源与镜像版本。

发表评论 取消回复