Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable monitoring.coreos.com/v1 api check #653

Merged
merged 6 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be improved, but this is something to be done in a separate issue :)

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 @@ -688,8 +688,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
Loading