【发布时间】:2021-03-01 15:30:04
【问题描述】:
我有以下ConfigMap。我正在尝试将两个数据源拆分为两个单独的文件,并在“构建时”使用 Kustomize 合并它们。
但我就是不知道该怎么做?
这就是我所拥有的:
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-datasources
namespace: grafana
data:
datasources.yaml: |-
apiVersion: 1
datasources:
- name: prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
version: 1
- name: Azure Monitor
type: grafana-azure-monitor-datasource
access: proxy
version: 1
我想拆分成单独文件(然后合并到 ConfigMap)的部分是:
- name: prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
version: 1
还有:
- name: Azure Monitor
type: grafana-azure-monitor-datasource
access: proxy
version: 1
【问题讨论】:
标签: kubernetes configmap kustomize