mirror of
https://github.com/prometheus-operator/kube-prometheus.git
synced 2025-08-20 22:11:05 +02:00
For `--dry-run` to work with kubectl a Kubernetes cluster's apiserver is actually used, which is unnecessary for generating these manifests. This approach also allows further customization, such as adding labels to the generated manifests.
19 lines
273 B
Bash
Executable File
19 lines
273 B
Bash
Executable File
#!/bin/bash
|
|
|
|
cat <<-EOF
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: prometheus-k8s-rules
|
|
labels:
|
|
role: prometheus-rulefiles
|
|
prometheus: k8s
|
|
data:
|
|
EOF
|
|
|
|
for f in assets/prometheus/rules/*.rules
|
|
do
|
|
echo " $(basename $f): |+"
|
|
cat $f | sed "s/^/ /g"
|
|
done
|