Skip to content

Commit

Permalink
Fix kube-prometheus-stack private registry support
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Nov 1, 2023
1 parent f206486 commit 295b607
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ alertmanager:
{{ $prometheusOperator := printf `
prometheusOperator:
admissionWebhooks:
patch:
image:
registry: %s
image:
registry: %s
prometheusConfigReloader:
Expand All @@ -18,6 +22,7 @@ prometheusOperator:
thanosImage:
registry: %s
`
(include "registry.kubernetes" $)
(include "registry.quay" $)
(include "registry.quay" $)
(include "registry.quay" $)
Expand All @@ -30,6 +35,13 @@ prometheus:
registry: %s
` (include "registry.quay" $) | fromYaml }}
{{ $thanosRuler := printf `
thanosRuler:
thanosRulerSpec:
image:
registry: %s
` (include "registry.quay" $) | fromYaml }}
{{ $ksm := printf `
kube-state-metrics:
image:
Expand All @@ -45,35 +57,34 @@ prometheus-node-exporter:
# https://github.com/grafana/helm-charts/blob/main/charts/grafana/README.md
{{ $grafana := printf `
grafana:
# docker
# docker.io
image:
registry: %s
repository: %s
initChownData:
image:
registry: %s
repository: %s
testFramework:
image:
registry: %s
image: %s
downloadDashboardsImage:
registry: %s
repository: %s
imageRenderer:
image:
registry: %s
repository: %s
# quay.io
sidecar:
image:
repository: %s
`
(include "image.dockerHub" $)
(include "image.dockerHub" $)
(include "image.dockerHub" $)
(include "image.dockerHub" $)
(include "image.dockerHub" $)
(include "image.dockerHub" (merge (dict "_repo" "grafana/grafana") $))
(include "image.dockerLibrary" (merge (dict "_repo" "busybox") $))
(include "image.dockerHub" (merge (dict "_repo" "bats/bats") $))
(include "image.dockerHub" (merge (dict "_repo" "curlimages/curl") $))
(include "image.dockerHub" (merge (dict "_repo" "grafana/grafana-image-renderer") $))
(include "image.quay" (merge (dict "_repo" "kiwigrid/k8s-sidecar") $))
| fromYaml }}
{{ $vals := dig "values" dict . }}
{{ $vals = mergeOverwrite $vals $alertmanager $prometheusOperator $prometheus $ksm $node $grafana }}
{{ $vals = mergeOverwrite $vals $alertmanager $prometheusOperator $prometheus $thanosRuler $ksm $node $grafana }}
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ alertmanager:
{{ $prometheusOperator := printf `
prometheusOperator:
admissionWebhooks:
patch:
image:
registry: %s
image:
registry: %s
prometheusConfigReloader:
Expand All @@ -17,6 +21,7 @@ prometheusOperator:
thanosImage:
registry: %s
`
(include "registry.kubernetes" $)
(include "registry.quay" $)
(include "registry.quay" $)
(include "registry.quay" $)
Expand All @@ -29,6 +34,13 @@ prometheus:
registry: %s
` (include "registry.quay" $) | fromYaml }}
{{ $thanosRuler := printf `
thanosRuler:
thanosRulerSpec:
image:
registry: %s
` (include "registry.quay" $) | fromYaml }}
{{ $ksm := printf `
kube-state-metrics:
image:
Expand All @@ -44,35 +56,34 @@ prometheus-node-exporter:
# https://github.com/grafana/helm-charts/blob/main/charts/grafana/README.md
{{ $grafana := printf `
grafana:
# docker
# docker.io
image:
registry: %s
repository: %s
initChownData:
image:
registry: %s
repository: %s
testFramework:
image:
registry: %s
image: %s
downloadDashboardsImage:
registry: %s
repository: %s
imageRenderer:
image:
registry: %s
repository: %s
# quay.io
sidecar:
image:
repository: %s
`
(include "image.dockerHub" $)
(include "image.dockerHub" $)
(include "image.dockerHub" $)
(include "image.dockerHub" $)
(include "image.dockerHub" $)
(include "image.dockerHub" (merge (dict "_repo" "grafana/grafana") $))
(include "image.dockerLibrary" (merge (dict "_repo" "busybox") $))
(include "image.dockerHub" (merge (dict "_repo" "bats/bats") $))
(include "image.dockerHub" (merge (dict "_repo" "curlimages/curl") $))
(include "image.dockerHub" (merge (dict "_repo" "grafana/grafana-image-renderer") $))
(include "image.quay" (merge (dict "_repo" "kiwigrid/k8s-sidecar") $))
| fromYaml }}
{{ $vals := dict }}
{{ $vals = mergeOverwrite $vals $alertmanager $prometheusOperator $prometheus $ksm $node $grafana }}
{{ $vals = mergeOverwrite $vals $alertmanager $prometheusOperator $prometheus $thanosRuler $ksm $node $grafana }}
apiVersion: ui.k8s.appscode.com/v1alpha1
kind: Feature
Expand Down

0 comments on commit 295b607

Please sign in to comment.