diff --git a/kustomize/bases/prometheus/kustomization.yaml b/kustomize/bases/prometheus/kustomization.yaml index 3aa0a91..3d834b4 100644 --- a/kustomize/bases/prometheus/kustomization.yaml +++ b/kustomize/bases/prometheus/kustomization.yaml @@ -11,6 +11,10 @@ secretGenerator: literals: - username=changeme - password=changeme + - name: additional-scrape-configs + behavior: create + literals: + - prometheus-additional.yaml= configurations: - kustomizeconfig/namereference.yaml \ No newline at end of file diff --git a/kustomize/bases/prometheus/kustomizeconfig/namereference.yaml b/kustomize/bases/prometheus/kustomizeconfig/namereference.yaml index 1c29217..4d7a8f5 100644 --- a/kustomize/bases/prometheus/kustomizeconfig/namereference.yaml +++ b/kustomize/bases/prometheus/kustomizeconfig/namereference.yaml @@ -5,3 +5,5 @@ nameReference: path: spec/remoteWrite/basicAuth/username/name - kind: Prometheus path: spec/remoteWrite/basicAuth/password/name + - kind: Prometheus + path: spec/additionalScrapeConfigs/name diff --git a/kustomize/bases/prometheus/prometheus.yaml b/kustomize/bases/prometheus/prometheus.yaml index 4a8c6b6..2627da0 100644 --- a/kustomize/bases/prometheus/prometheus.yaml +++ b/kustomize/bases/prometheus/prometheus.yaml @@ -18,6 +18,9 @@ spec: probeSelector: matchLabels: monitor: prometheus + additionalScrapeConfigs: + name: additional-scrape-configs + key: prometheus-additional.yaml # remoteWrite: # - url: changeme # basicAuth: diff --git a/kustomize/overlays/prod/configurations/prometheus/prometheus-additional.yaml b/kustomize/overlays/prod/configurations/prometheus/prometheus-additional.yaml new file mode 100644 index 0000000..ad0941e --- /dev/null +++ b/kustomize/overlays/prod/configurations/prometheus/prometheus-additional.yaml @@ -0,0 +1,3 @@ +- job_name: additional/bastion-haproxy + static_configs: + - targets: ["192.168.20.10:8080"] \ No newline at end of file diff --git a/kustomize/overlays/prod/kustomization.yaml b/kustomize/overlays/prod/kustomization.yaml index 352d6b6..a572988 100644 --- a/kustomize/overlays/prod/kustomization.yaml +++ b/kustomize/overlays/prod/kustomization.yaml @@ -1,4 +1,4 @@ -bases: +resources: # - ../../namespaces/kubernetes-dashboard - ../../namespaces/gitea - ../../namespaces/grafana @@ -78,6 +78,12 @@ secretGenerator: # literals: # - username=${ssm:/k3s/prod/monitoring/grafana-cloud/username} # - password=${ssm:/k3s/prod/monitoring/grafana-cloud/password} + - name: additional-scrape-configs + type: Opaque + namespace: monitoring + behavior: replace + files: + - prometheus-additional.yaml=configurations/prometheus/prometheus-additional.yaml # allow "kubectl apply -l managed-by=kustomize --prune ..." commonLabels: