加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

helm安装

发布时间:2020-12-14 01:52:40 所属栏目:Linux 来源:网络整理
导读:? ? ? 要安装对应k8s版本的helm https://github.com/ helm/ helm/releases #wget? https://storage.googleapis.com/kubernetes- helm/ helm-v2.10.0-linux-amd64.tar.gz wget? https://storage.googleapis.com/kubernetes- helm/ helm-v2.10.0-linux-amd64.t

?

?

?
要安装对应k8s版本的helm
https://github.com/helm/helm/releases
#wget? https://storage.googleapis.com/kubernetes-helm/helm-v2.10.0-linux-amd64.tar.gz
wget? https://storage.googleapis.com/kubernetes-helm/helm-v2.10.0-linux-amd64.tar.gz
tar -zxvf? helm-v2.10.0-linux-amd64.tgz
mv linux-amd64/ helm? /usr/local/bin/helm
?
安装Tiller服务端
? ? helm?init

?helm是为了配置分离,

operator则是针对复杂应用的自动化管理

Helm?Chart? :?应用包
安装:? helm?install <chart>
更新:? helm?upgrade <release>
删除:? helm?delete <release>
创建chart:? helm?create demoapp
chart结构:
? ? ??

? ? ??? ?values.yaml:templates里面的文件从values文件中读取出来的变量
? ? ? ? ?requirements:声明子chart,和charts同时使用
? ? ? ??

?
使用另外的配置 ,覆盖部分默认变量
? ? ?

Values.*的值可以来自以下?

+ Values.yaml文件?
? ? ?如果是子chart,值来自父chart的values.yaml?
+ 通过helm install -f标志的文件?
+ 来自–set中的配置

helm?yaml语法

{{ .Values.* }}?
? ? ? ? ? 从value.yaml文件中读取?
{{ .Release.* }}?
? ? ? ? ? 从运行Release的元数据读取?
{{ .Template.* }}? ?{{ .Chart.* }}?
? ? ? ? ? 从Chart.yaml文件中读取?
{{ .Files.* }}?
? ? ? ? 一、文件数量少情况下:
? ? ? ?? ? ??在chart的根目录下有三个文件
? ? ? ? ? ? ? ?

? ? ? ? ?? ? ?在模板文件中使用
? ? ? ? ? ? ? ?

? ? ? ? ?二、文件多情况下:
? ? ? ? ? ? ? ??

{{ .Capabilities.* }}
?
?
{{quote }}
? ? ? ? ?{{ quote? .Values.favorite.drink }}
? ? ? ? ?是最常用的模板函数,它能把ABC转化为“ABC”。它带一个参数?
{{?template }}? {{ include? }}
? ? ?1、 先在_helpers.tpl中定义命名模板
? ? ??

? ? ?2、使用命名模版?
? ? ? ? ? ? ??

? ? ?3、渲染后?
? ? ? ? ? ? ? ??

?
{{ |default }}?
? ? ? ? drink: {{ .Values.favorite.drink | default “tea” | quote }}?
? ? ? ? 如果在values中无法找到favorite.drink,则配置为“tea”。
{{? |indent }}
? ? ? ?{{ include "mychart_app" . | indent 2 }}
? ? ?? 对左空出空格

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读