sigs.k8s.io/cluster-api@v1.7.1/hack/observability/kube-state-metrics/crd-sidecar-patch.yaml (about) 1 apiVersion: apps/v1 2 kind: Deployment 3 metadata: 4 name: kube-state-metrics 5 spec: 6 template: 7 spec: 8 containers: 9 - env: 10 - name: LABEL 11 value: kube-state-metrics/custom-resource 12 - name: FOLDER 13 value: /tmp 14 - name: RESOURCE 15 value: configmap 16 - name: NAMESPACE 17 value: observability 18 - name: SCRIPT 19 value: /script/compile.sh 20 # This image continuously collects config maps with the specified label and 21 # updates the configuration for kube-state-metrics using a script. 22 image: kiwigrid/k8s-sidecar:latest 23 name: crd-sidecar 24 volumeMounts: 25 - mountPath: /etc/config 26 name: config-volume 27 - mountPath: /script 28 name: compile-script 29 initContainers: 30 - command: 31 - /bin/sh 32 - -c 33 - | 34 cat << EOF > "/etc/config/crd-metrics-config.yaml" 35 kind: CustomResourceStateMetrics 36 spec: 37 resources: [] 38 EOF 39 # This container initializes an empty configuration for kube-state-metrics 40 # to have a smooth start. 41 image: kiwigrid/k8s-sidecar:latest 42 name: init-crd-config 43 volumeMounts: 44 - mountPath: /etc/config 45 name: config-volume 46 volumes: 47 - configMap: 48 defaultMode: 511 49 name: kube-state-metrics-crd-sidecar-script 50 name: compile-script