lokomotive
lokomotive copied to clipboard
[RFE] Allow user to specify custom scrape config
Prometheus Operator allows use to specify additional scrape config but it is not exposed at lokoctl level. So expose it using appropriate variables.
Right now the user can do the following:
kubectl -n monitoring patch prometheus prometheus-operator-kube-p-prometheus --type merge --patch '{"spec":{"additionalScrapeConfigs":{"name":"scrape-config","key":"scrape.yaml"}}}'
cat > /tmp/scrape.yaml <<EOF
- job_name: "kubernetes-nodes"
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
authorization:
credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: node
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
EOF
kubectl -n monitoring create secret generic scrape-config --from-file=/tmp/scrape.yaml