helm 部署 使用 记录
0.概念:Helm作为一个包管理工具, 它把Kubernetes资源(比如deployments、services或 ingress等) 打包到一个chart中,方便我们将其chart保存到chart仓库用来存储和分享
1.服务端安装:
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
chmod 700 get_helm.sh
./get_helm.sh
2.客户端安装
wget https://storage.googleapis.com/kubernetes-helm/helm-v2.10.0-linux-amd64.tar.gz
tar -zxf helm-v2.10.0-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/
3.使用记录
[root@pserver78 site2powerone]# helm list #列出所有kubernetes部署
interested-chipmunk 1 Wed Dec 12 19:27:31 2018 DEPLOYED site2powerone-0.1.0 default
helm delete interested-chipmunk --purge # 删除部署
3.3 创建新的chart
helm create site3powerone
3.4 cat values.yaml
[root@pserver78 site2powerone]# cat values.yaml |egrep -v '#|^$'
replicaCount: 1
image:
repository: harbor.abc.com/pub/poweronesite
tag: end
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
ingress:
enabled: false
annotations: {}
path: /
hosts:
- site2powerone.mz.abc.com
tls: []
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
3.部署公司OA:架构 -- client -- front(tomcat) -- backend(mysql)
[root@pserver78 oa]# tree -c
.
├── charts
│ └── oa-db
│ ├── Chart.yaml
│ ├── README.md
│ ├── templates
│ │ ├── deployment.yaml
│ │ ├── _helpers.tpl
│ │ ├── NOTES.txt
│ │ ├── pvc.yaml
│ │ └── svc.yaml
│ └── values.yaml
├── Chart.yaml
├── README.md
├── requirements.yaml
├── templates
│ ├── appsrv-ingress.yaml
│ ├── appsrv-svc.yaml
│ ├── appsrv.yaml
│ ├── _helpers.tpl
│ └── NOTES.txt
└── values.yaml
关键文件:
3.1
[root@pserver78 oa]# cat /root/.helm/cache/archive/oa/Chart.yaml
apiVersion: v1
appVersion: "7"
description: Deploy a basic tomcat application server with sidecar as web archive
container
icon: http://tomcat.apache.org/res/images/tomcat.png
maintainers:
- email: chenxuan@onecloud.cn
name: chenxuan
name: oa
version: 0.1.3
[root@pserver78 oa]# cat requirements.yaml
dependencies:
- name: oa-db
version: 0.1.0
repository: https://charts.abc.com
condition: oa-db.enabled
tags:
- oa
[root@pserver78 charts]# cat /root/.helm/cache/archive/oa/charts/oa-db/Chart.yaml
appVersion: latest
description: Fast, reliable, scalable, and easy to use open-source relational database
system.
engine: gotpl
home: https://www.mysql.com/
icon: https://www.mysql.com/common/logos/logo-mysql-170x115.png
keywords:
- database
- oa
maintainers:
- email: o.with@sportradar.com
name: olemarkus
name: oa-db
version: 0.1.0
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App