1
0
Fork 0

upgrade prometheus-operator and replace additional_scrape_config with ScrapeConfig

This commit is contained in:
Massaki Archambault 2024-09-19 00:14:40 -04:00
parent e240fb3e25
commit 9cdafa8ae5
17 changed files with 56 additions and 78 deletions

View File

@ -37,8 +37,12 @@ spec:
configMapKeyRef:
name: kustomize-generated-config
key: GRAFANA_EXTERNAL_URL
# - name: GF_AUTH_ANONYMOUS_ENABLED
# value: "true"
- name: GF_AUTH_ANONYMOUS_ENABLED
value: "true"
- name: GF_AUTH_ANONYMOUS_ORG_NAME
value: public
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
value: Viewer
- name: GF_INSTALL_PLUGINS
value: marcusolsson-json-datasource,marcusolsson-treemap-panel
- name: GF_FEATURE_TOGGLES_ENABLE

View File

@ -1,12 +0,0 @@
resources:
- https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.63.0/bundle.yaml
patches:
- path: patches/alertmanagerconfigs.yaml
- path: patches/alertmanagers.yaml
- path: patches/podmonitors.yaml
- path: patches/probes.yaml
- path: patches/prometheuses.yaml
- path: patches/prometheusrules.yaml
- path: patches/servicemonitors.yaml
- path: patches/thanosrulers.yaml

View File

@ -1,5 +0,0 @@
$patch: delete
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: alertmanagerconfigs.monitoring.coreos.com

View File

@ -1,5 +0,0 @@
$patch: delete
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: alertmanagers.monitoring.coreos.com

View File

@ -1,5 +0,0 @@
$patch: delete
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: podmonitors.monitoring.coreos.com

View File

@ -1,5 +0,0 @@
$patch: delete
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: probes.monitoring.coreos.com

View File

@ -1,5 +0,0 @@
$patch: delete
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: prometheuses.monitoring.coreos.com

View File

@ -1,5 +0,0 @@
$patch: delete
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: prometheusrules.monitoring.coreos.com

View File

@ -1,5 +0,0 @@
$patch: delete
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: servicemonitors.monitoring.coreos.com

View File

@ -1,5 +0,0 @@
$patch: delete
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: thanosrulers.monitoring.coreos.com

View File

@ -1,8 +1,5 @@
resources:
- bundle/
- https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.63.0/stripped-down-crds.yaml
namespace: kube-system
- https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.76.2/bundle.yaml
commonLabels:
app.kubernetes.io/part-of: monitoring

View File

@ -16,10 +16,10 @@ secretGenerator:
literals:
- username=changeme
- password=changeme
- name: additional-scrape-configs
behavior: create
literals:
- prometheus-additional.yaml=
# - name: additional-scrape-configs
# behavior: create
# literals:
# - prometheus-additional.yaml=
configMapGenerator:
- name: kustomize-generated-config

View File

@ -5,5 +5,5 @@ nameReference:
path: spec/remoteWrite/basicAuth/username/name
- kind: Prometheus
path: spec/remoteWrite/basicAuth/password/name
- kind: Prometheus
path: spec/additionalScrapeConfigs/name
# - kind: Prometheus
# path: spec/additionalScrapeConfigs/name

View File

@ -18,9 +18,12 @@ spec:
probeSelector:
matchLabels:
monitor: prometheus
additionalScrapeConfigs:
name: additional-scrape-configs
key: prometheus-additional.yaml
scrapeConfigSelector:
matchLabels:
monitor: prometheus
# additionalScrapeConfigs:
# name: additional-scrape-configs
# key: prometheus-additional.yaml
# remoteWrite:
# - url: changeme
# basicAuth:

View File

@ -1,4 +0,0 @@
- job_name: additional/bastion-haproxy
static_configs:
- targets: ["192.168.20.10:8080"]

View File

@ -9,6 +9,8 @@ resources:
- ../../overlays/actual
- ../../overlays/llm
- resources/prometheus/scrapeconfig.yaml
buildMetadata:
- originAnnotations
@ -45,13 +47,13 @@ images:
- name: ghcr.io/sillytavern/sillytavern
newTag: 1.12.4
secretGenerator:
- name: prometheus-additional-scrape-configs
type: Opaque
namespace: monitoring
behavior: replace
files:
- prometheus-additional.yaml=configurations/prometheus/prometheus-additional.yaml
# secretGenerator:
# - name: prometheus-additional-scrape-configs
# type: Opaque
# namespace: monitoring
# behavior: replace
# files:
# - prometheus-additional.yaml=configurations/prometheus/prometheus-additional.yaml
# allow "kubectl apply -l app.kubernetes.io/managed-by=kustomize --prune ..."
commonLabels:

View File

@ -0,0 +1,28 @@
apiVersion: monitoring.coreos.com/v1alpha1
kind: ScrapeConfig
metadata:
name: static-config
namespace: monitoring
labels:
monitor: prometheus
spec:
staticConfigs:
- labels:
job: external/bastion-haproxy
targets:
- 192.168.20.10:8080
- labels:
job: external/node_exporter
targets:
- 192.168.10.10:9100
- 192.168.10.11:9100
- 192.168.10.12:9100
- 192.168.20.21:9100
- 192.168.20.22:9100
- 192.168.20.23:9100
- 192.168.20.24:9100
- labels:
job: external/satisfactory-server
targets:
- 192.168.20.31:9777
- 192.168.20.31:9100