K8s之helm部署应用

Helm可以用源码或构建的二进制版本安装

#下载 helm二进制文件
wget https://get.helm.sh/helm-v3.5.3-linux-amd64.tar.gz
#解压
tar -zxvf helm-v3.5.3-linux-amd64.tar.gz
# copy /usr/bin
cp helm /usr/bin/
[root@master linux-amd64]# helm
The Kubernetes package manager

Common actions for Helm:

- helm search:    search for charts
- helm pull:      download a chart to your local directory to view
- helm install:   upload the chart to Kubernetes
- helm list:      list releases of charts
- ...
#此时helm安装好了

创建charts

[root@master linux-amd64]# helm create mychart
Creating mychart
[root@master linux-amd64]# ls
LICENSE  mychart  README.md
[root@master linux-amd64]# cd mychart/
[root@master mychart]# ls
charts  Chart.yaml  templates  values.yaml
#修改 templates 里面的内容
[root@master linux-amd64]# helm install web123 mychart/
NAME: web123
LAST DEPLOYED: Fri Mar 12 11:43:42 2021
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
[root@master linux-amd64]# kubectl get pod,svc
NAME                      READY   STATUS    RESTARTS   AGE
pod/web-d86c95cc9-dlnvn   1/1     Running   0          9s

NAME                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
service/kubernetes   ClusterIP   10.20.0.1       <none>        443/TCP        43s
service/web          NodePort    10.20.170.134   <none>        80:30358/TCP   9s

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值