添加toml配置文件到舵图



新手掌舵。我试图将静态的。toml配置文件添加到一个helm图表中,但是部署的manifest的内容困扰着我,这是我的图表的树。

.
├── Chart.yaml
├── telegraf.conf
└── templates
└── configmap.yaml

configmap.yaml

---
apiVersion: v1
kind: ConfigMap
metadata:
name: telegraf-api
data:
{{ (.Files.Glob "telegraf.conf").AsConfig | indent 4 }}

telegraf.conf

[global_tags]
[agent]
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = "0s"
hostname = ""
omit_hostname = false
[[inputs.cpu]]
percpu = true
totalcpu = true
collect_cpu_time = false
report_active = false
core_tags = false
[[inputs.disk]]
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
[[inputs.diskio]]
[[inputs.kernel]]
[[inputs.mem]]
[[inputs.processes]]
[[inputs.swap]]
[[inputs.system]]

我可以安装图表没有任何问题,但问题发生时,我检查部署清单(它有很多像这样的反斜杠):

$ helm get manifest telegraf
---
# Source: telegraf/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: telegraf-api
data:
telegraf.conf: "[global_tags]n[agent]n  interval = "10s"n  round_interval = truen
 metric_batch_size = 1000n  metric_buffer_limit = 10000n  collection_jitter =
"0s"n  flush_interval = "10s"n  flush_jitter = "0s"n  precision = "0s"n
 hostname = ""n  omit_hostname = falsen[[inputs.cpu]]n  percpu = truen  totalcpu
= truen  collect_cpu_time = falsen  report_active = falsen  core_tags = falsen[[inputs.disk]]n
 ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs",
"squashfs"]n[[inputs.diskio]]n[[inputs.kernel]]n[[inputs.mem]]n[[inputs.processes]]n[[inputs.swap]]n[[inputs.system]]n
 "

有没有人对如何部署它有任何想法,这样配置不会弄乱?

这应该不会导致配置出现任何问题。配置文件中的反斜杠用于指示该行应该在下一行继续。当configmap加载到pod时,实际的键值对将被正确加载。

相关内容

  • 没有找到相关文章

最新更新