How to use CRDs when going pure Jsonnet #1562
-
I apologize in advance for a potentially dumb question, but you know what they say. I'm looking (mostly for learning) to go "pure jsonnet", and I don't quite understand how to handle CRDs. Today, using Helm charts, we do this: {
crds: {
alertmanagerconfigs: parseYaml(importstr '../charts/kube-prometheus-stack/crds/crd-alertmanagerconfigs.yaml'),
alertmanagers: parseYaml(importstr '../charts/kube-prometheus-stack/crds/crd-alertmanagers.yaml'),
podmonitors: parseYaml(importstr '../charts/kube-prometheus-stack/crds/crd-podmonitors.yaml'),
probes: parseYaml(importstr '../charts/kube-prometheus-stack/crds/crd-probes.yaml'),
prometheuses: parseYaml(importstr '../charts/kube-prometheus-stack/crds/crd-prometheuses.yaml'),
prometheusrules: parseYaml(importstr '../charts/kube-prometheus-stack/crds/crd-prometheusrules.yaml'),
servicemonitors: parseYaml(importstr '../charts/kube-prometheus-stack/crds/crd-servicemonitors.yaml'),
thanosrulers: parseYaml(importstr '../charts/kube-prometheus-stack/crds/crd-thanosrulers.yaml'),
},
} And then apply using Tanka. But how would a pure jsonnet solution handle the CRDs? Thanks! 🙏 Edit1: Am I right in thinking that the CRDs are imported here: https://github.com/prometheus-operator/kube-prometheus/blob/main/jsonnet/kube-prometheus/jsonnetfile.json#L23-L29 ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
CRDs are imported by including prometheus-operator library in here and later they are "printed out" as part of manifestation. Library itself imports them from plain json files in here CRDs can be referenced directly in kube-prometheus as objects in |
Beta Was this translation helpful? Give feedback.
CRDs are imported by including prometheus-operator library in here and later they are "printed out" as part of manifestation. Library itself imports them from plain json files in here
CRDs can be referenced directly in kube-prometheus as objects in
$.prometheusOperator.0*
. This allows us to do tricks like putting CRDs into a separate directory to have dedicatedsetup
manifests