Skip to content

Commit

Permalink
fix: disable monitoring.coreos.com/v1 api check (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
fleblay authored Nov 28, 2023
1 parent 831cdf2 commit ac2b530
Show file tree
Hide file tree
Showing 8 changed files with 727 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hacks/helm-validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ cd "$( dirname "${BASH_SOURCE[0]}" )/.."
schema_url="https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/"
k8s_version="1.27.2"

helm kubeconform "./helm/charts/${1}" --strict --schema-location "${schema_url}" -f "hacks/values/${1}.yaml" --kubernetes-version "${k8s_version}" --summary --verbose
helm kubeconform "./helm/charts/${1}" --strict --schema-location "${schema_url}" --schema-location ./hacks/servicemonitor_v1.json -f "hacks/values/${1}.yaml" --kubernetes-version "${k8s_version}" --summary --verbose
718 changes: 718 additions & 0 deletions hacks/servicemonitor_v1.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions hacks/values/hydra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ watcher:
runAsNonRoot: true

serviceMonitor:
enabled: true
labels:
release: "prometheus"
tlsConfig:
Expand Down
1 change: 1 addition & 0 deletions hacks/values/kratos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ cronjob:
runAsNonRoot: true

serviceMonitor:
enabled: true
labels:
release: "prometheus"
tlsConfig:
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/hydra/templates/service-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
selector:
app.kubernetes.io/name: {{ include "hydra.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") (.Values.serviceMonitor.enabled) }}
{{- if .Values.serviceMonitor.enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand Down
4 changes: 2 additions & 2 deletions helm/charts/hydra/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ pdb:
# -- Parameters for the Prometheus ServiceMonitor objects.
# Reference: https://docs.openshift.com/container-platform/4.6/rest_api/monitoring_apis/servicemonitor-monitoring-coreos-com-v1.html
serviceMonitor:
# -- switch to false to prevent creating the ServiceMonitor
enabled: true
# -- switch to true to enable creating the ServiceMonitor
enabled: false
# -- HTTP scheme to use for scraping.
scheme: http
# -- Interval at which metrics should be scraped
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/kratos/templates/service-admin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
selector:
app.kubernetes.io/name: {{ include "kratos.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") (.Values.serviceMonitor.enabled) }}
{{- if .Values.serviceMonitor.enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
Expand Down
4 changes: 2 additions & 2 deletions helm/charts/kratos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,8 @@ pdb:
# -- Parameters for the Prometheus ServiceMonitor objects.
# Reference: https://docs.openshift.com/container-platform/4.6/rest_api/monitoring_apis/servicemonitor-monitoring-coreos-com-v1.html
serviceMonitor:
# -- switch to false to prevent creating the ServiceMonitor
enabled: true
# -- switch to true to enable creating the ServiceMonitor
enabled: false
# -- HTTP scheme to use for scraping.
scheme: http
# -- Interval at which metrics should be scraped
Expand Down

0 comments on commit ac2b530

Please sign in to comment.