chart语法总体介绍

发布一个k8s部署视频:https://edu.csdn.net/course/detail/26967

课程内容:各种k8s部署方式。包括minikube部署,kubeadm部署,kubeasz部署,rancher部署,k3s部署。包括开发测试环境部署k8s,和生产环境部署k8s。

腾讯课堂连接地址https://ke.qq.com/course/478827?taid=4373109931462251&tuin=ba64518

第二个视频发布  https://edu.csdn.net/course/detail/27109

腾讯课堂连接地址https://ke.qq.com/course/484107?tuin=ba64518

介绍主要的k8s资源的使用配置和命令。包括configmap,pod,service,replicaset,namespace,deployment,daemonset,ingress,pv,pvc,sc,role,rolebinding,clusterrole,clusterrolebinding,secret,serviceaccount,statefulset,job,cronjob,podDisruptionbudget,podSecurityPolicy,networkPolicy,resourceQuota,limitrange,endpoint,event,conponentstatus,node,apiservice,controllerRevision等。

第三个视频发布:https://edu.csdn.net/course/detail/27574

详细介绍helm命令,学习helm chart语法,编写helm chart。深入分析各项目源码,学习编写helm插件

第四个课程发布:https://edu.csdn.net/course/detail/28488

本课程将详细介绍k8s所有命令,以及命令的go源码分析,学习知其然,知其所以然


————————————————
chart目录结构

Chart.yaml: chart的描述文件,包括ico地址,版本信息

Chart.lock v2 api 具体依赖版本

values.yaml: 给模板文件使用的变量

values.schema.json  验证values.yaml

charts: 依赖其他包的charts文件

requirements.yaml: 依赖的charts(v1 api)

requirements.lock v1 api具体依赖的版本

README.md: 开发人员自己阅读的文件

LICENSE:版权文件

crd目录,存放crd资源文件

templates: 存放k8s模板文件目录

NOTES.txt 说明文件,helm install之后展示给用户看的内容

deployment.yaml 创建k8s资源的yaml文件

_helpers.tpl: 下划线开头的文件,可以被其他模板引用.

V1 Chart.yaml 文件

V2 chart.yaml文件

https://helm.sh/docs/topics/charts

Chart Types

The type field defines the type of chart. There are two types: application and library. Application is the default type and it is the standard chart which can be operated on fully. The library or helper chart provides utilities or functions for the chart builder. A library chart differs from an application chart because it has no resource object and is therefore not installable.

Dependency配置

helm内置对象、

# Release, release相关属性

# Chart, Chart.yaml文件中定义的内容

# Values, values.yaml文件中定义的内容

内置变量

Release.Name: 实例的名称(注意:不是应用的名称)

Release.Namespace: 应用实例的命名空间.

Release.Service: 进行发布的服务。通常这是Tiller .

Release.IsUpgrade: 如果当前对实例的操作是更新或者回滚,这个变量的值就会被置为true.

Release.IsInstall: 如果当前对实例的操作是安装,则这边变量被置为true.

Release.Revision: 版本序号,1开始,每次使用helm upgrade命令都会增加1.

Chart: Chart.yaml文件中的内容,所以我们可以使用Chart.Version表示应用版本,Chart.Maintainers函数应用的维护信息.

Files and capabilities

Files: A map-like object containing all non-special files in the chart. This will not give you access to templates, but will give you access to additional files that are present (unless they are excluded using .helmignore). Files can be accessed using {{ index .Files "file.name" }} or using the {{ .Files.Get name }} or {{ .Files.GetString name }} functions. You can also access the contents of the file as []byte using {{ .Files.GetBytes }}

Capabilities: A map-like object that contains information about the versions of Kubernetes ({{ .Capabilities.KubeVersion }} and the supported Kubernetes API versions

 ({{ .Capabilities.APIVersions.Has "batch/v1" }})

Values设置方式

原创文章 409 获赞 424 访问量 346万+

猜你喜欢

转载自blog.csdn.net/hxpjava1/article/details/105323934