Created
December 29, 2023 16:22
-
-
Save crdant/84a1d5a3b722537e76ab5f65b9069547 to your computer and use it in GitHub Desktop.
Updating the KOTS prometheus address with a Kubernetes job. You could do something similar in an init container.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: set-prometheus-address | |
spec: | |
template: | |
spec: | |
containers: | |
- image: nicolaka/netshoot | |
name: set-prometheus-address | |
command: | |
- bash | |
- "-c" | |
- | | |
curl http://kotsadm:3000/api/v1/prometheus -X POST -d '{ "value": "http://prometheus-kube-prometheus-prometheus.monitoring.svc:9090" }' -H "Authorization: ${AUTH_STRING}" | |
env: | |
- name: AUTH_STRING | |
valueFrom: | |
secretKeyRef: | |
name: kotsadm-authstring | |
key: kotsadm-authstring | |
restartPolicy: Never |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment