首页 > 其他分享 >69、K8S-Helm-template导出独立的yaml文件

69、K8S-Helm-template导出独立的yaml文件

时间:2023-04-18 19:57:41浏览次数:55  
标签:templates tpl charts yaml prometheus template Helm wrote

1、将helm项目导出为独立yaml文件-实践

1.1、需求

有时候,我们需要导出yaml分析yaml编写情况,而不是直接部署到k8s,这个时候,就需要使用template来实现了

1.2、开始操作

1.2.1、创建存放yaml文件的目录

helm_prometheus]# cd /opt/helm_prometheus/ && mkdir prometheus-tpl
helm_prometheus]# ll

drwxr-xr-x 5 root root 202 Apr 16 00:04 prometheus # 这个是项目目录
drwxr-xr-x 2 root root   6 Apr 16 00:24 prometheus-tpl # 这个是渲染出来的,存放yaml的目录

1.2.2、开始渲染

# 注意:一定要在项目目录的上一级目录执行。
helm_prometheus]# helm template prometheus --output-dir prometheus-tpl/ wrote prometheus-tpl//prometheus/charts/alertmanager/templates/serviceaccount.yaml wrote prometheus-tpl//prometheus/charts/kube-state-metrics/templates/serviceaccount.yaml wrote prometheus-tpl//prometheus/charts/prometheus-node-exporter/templates/serviceaccount.yaml wrote prometheus-tpl//prometheus/charts/prometheus-pushgateway/templates/serviceaccount.yaml wrote prometheus-tpl//prometheus/templates/serviceaccount.yaml wrote prometheus-tpl//prometheus/charts/alertmanager/templates/configmap.yaml wrote prometheus-tpl//prometheus/templates/cm.yaml wrote prometheus-tpl//prometheus/templates/pvc.yaml wrote prometheus-tpl//prometheus/charts/kube-state-metrics/templates/role.yaml wrote prometheus-tpl//prometheus/templates/clusterrole.yaml wrote prometheus-tpl//prometheus/charts/kube-state-metrics/templates/clusterrolebinding.yaml wrote prometheus-tpl//prometheus/templates/clusterrolebinding.yaml wrote prometheus-tpl//prometheus/charts/alertmanager/templates/services.yaml wrote prometheus-tpl//prometheus/charts/alertmanager/templates/services.yaml wrote prometheus-tpl//prometheus/charts/kube-state-metrics/templates/service.yaml wrote prometheus-tpl//prometheus/charts/prometheus-node-exporter/templates/service.yaml wrote prometheus-tpl//prometheus/charts/prometheus-pushgateway/templates/service.yaml wrote prometheus-tpl//prometheus/templates/service.yaml wrote prometheus-tpl//prometheus/charts/prometheus-node-exporter/templates/daemonset.yaml wrote prometheus-tpl//prometheus/charts/kube-state-metrics/templates/deployment.yaml wrote prometheus-tpl//prometheus/charts/prometheus-pushgateway/templates/deployment.yaml wrote prometheus-tpl//prometheus/templates/deploy.yaml wrote prometheus-tpl//prometheus/charts/alertmanager/templates/statefulset.yaml wrote prometheus-tpl//prometheus/charts/alertmanager/templates/ingress.yaml wrote prometheus-tpl//prometheus/templates/ingress.yaml wrote prometheus-tpl//prometheus/charts/alertmanager/templates/tests/test-connection.yaml

1.2.3、查询渲染后的目录

helm_prometheus]# tree prometheus-tpl/
prometheus-tpl/
└── prometheus
    ├── charts
    │   ├── alertmanager
    │   │   └── templates
    │   │       ├── configmap.yaml
    │   │       ├── ingress.yaml
    │   │       ├── serviceaccount.yaml
    │   │       ├── services.yaml
    │   │       ├── statefulset.yaml
    │   │       └── tests
    │   │           └── test-connection.yaml
    │   ├── kube-state-metrics
    │   │   └── templates
    │   │       ├── clusterrolebinding.yaml
    │   │       ├── deployment.yaml
    │   │       ├── role.yaml
    │   │       ├── serviceaccount.yaml
    │   │       └── service.yaml
    │   ├── prometheus-node-exporter
    │   │   └── templates
    │   │       ├── daemonset.yaml
    │   │       ├── serviceaccount.yaml
    │   │       └── service.yaml
    │   └── prometheus-pushgateway
    │       └── templates
    │           ├── deployment.yaml
    │           ├── serviceaccount.yaml
    │           └── service.yaml
    └── templates
        ├── clusterrolebinding.yaml
        ├── clusterrole.yaml
        ├── cm.yaml
        ├── deploy.yaml
        ├── ingress.yaml
        ├── pvc.yaml
        ├── serviceaccount.yaml
        └── service.yaml

12 directories, 25 files

 

标签:templates,tpl,charts,yaml,prometheus,template,Helm,wrote
From: https://www.cnblogs.com/ygbh/p/17322376.html

相关文章

  • 记录 RedisTemplate.executePipelined 使用问题
    需求,向redis写入2000万个key@Slf4j@Component("job2")publicclassToRedis2implementsIJob{privateAtomicLongcount=newAtomicLong(0);privateLongoldCount=0L;privateList<String>userIdList=newArrayList<>();pri......
  • Jedis与RedisTemplate的区别
    Jedis与RedisTemplate的区别:Jedis是Redis官方推荐的、面向Java的操作Redis的客户端,可以用JedisPool来获得连接进行get、set、del等操作相对简单,而RedisTemplate是SpringDataRedis中对JedisApi的高度封装。SpringDataRedis相对于Jedis来说,可以方便地更换Redis的Java客户端,还......
  • jQuery Templates模板插件
    jQuery团队提供了一个模板插件,但非常可惜的是jquery团队放弃对其维护,我们对其方法和语法进行简单简绍源码官方的网址:http://api.jquery.com/category/plugins/templates文档的网址:http://api.jquery.com/category/plugins/templates使用该插件必须先引入对应js //依赖jquery<sc......
  • angular项目国际化yaml自定义配置(ngx-translate)
    angular国际化配置很简单,但是想不用json文件用yaml文件,并且同一语言分label.jp.yaml和message.jp.yaml两个文件分开管理。1、下载ngx-translate的依赖库npminstall@ngx-translate/core--savenpminstall@ngx-translate/http-loader--save2、app.module.ts 中引入TranslateMo......
  • Helm模板.Files.Get函数
     常规用法apiVersion:v1kind:ConfigMapmetadata:name:templatesbinaryData:file1:{{.Files.Get"files/file1"|b64enc}}file2:{{.Files.Get"files/file2"|b64enc}}#错误示例apiVersion:v1kind:ConfigMapmetadata:name:temp......
  • Springboot使用RestTemplate发送Post请求postForEntity (application/json)的坑
    当使用RestTemplate进行http请求时,的确很方便,但是当需要进行post请求时遇到了坑1POST传递参数:采用LinkedMultiValueMap,不能使用HashMapStringurl='http://posturl';MultiValueMap<String,String>map=newLinkedMultiValueMap<String,String>();map.add(......
  • vue table 里面 slot 的模板复用 slot-scope template v-for
    vuetable里面slot的模板复用slot-scopetemplatev-for需求经常在table里面要有自定义列,但是会有相同的自定义列,这个时候又不想写很多一样的template,就可以用这种方式代码<template:slot="slotName"v-for="slotNamein['slotName1','slotName2','slot......
  • C++-template class-模板类
    C++-templateclass-模板类【C++高级教程,C++类模板一次讲透,必须收藏!】https://www.bilibili.com/video/BV1v84y1x7Qp/?share_source=copy_web&vd_source=3809390a14c335e7731c9e076c03eeba类模板概念类模板是用于生成类的模板。在编译阶段,编译器会根据类模板的使用情况创建......
  • template标签的学习
    template标签我在引用这个标签的时候,本来还在纳闷,咋就他那么特殊,就他不显示,然后突然意识到,这个标签天生不可见,即display:none属性可以在template标签里面放content模块,然后使用button点击事件实现内容的展现;具体实现如下:<template><ul><li>模块1</li><......
  • YAML文件
    yaml是一种数据格格式,后缀是.yml或.yaml用于配置文件以及编写测试用例语法规则使用规则区分大小写通过缩进表示层级,缩进使用空格非Tab#注释字符串一般不用双引号,默认就是字符串数据类型1.标量:最基本的数据类型整数浮点数字符串默认字符串不用引号单引号可......