Skip to content

Commit

Permalink
fix(support): Add passthrough for ca bundle secret into metrics server
Browse files Browse the repository at this point in the history
  • Loading branch information
ividito committed Nov 22, 2024
1 parent 9604353 commit 4011ceb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
15 changes: 15 additions & 0 deletions helm-chart/eoapi-support/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{/*
Fetch the CA Bundle from a specified secret if enabled
*/}}
{{- define "eoapi-support.fetchCaBundle" -}}
{{- if .Values.enableCaBundleFetch -}}
{{- $secretName := .Values.caBundleSecretName | default "eoepca-ca-secret" -}}
{{- $caBundle := "" -}}
{{- with (lookup "v1" "Secret" "default" $secretName) -}}
{{- $caBundle = index .data "ca.crt" | b64dec -}}
{{- end -}}
{{- $caBundle -}}
{{- else -}}
"" # Return an empty string if not enabled
{{- end -}}
{{- end -}}
6 changes: 5 additions & 1 deletion helm-chart/eoapi-support/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# when enabled, metrics-server will use the caBundle from the provided secret
# ref: https://github.com/developmentseed/eoapi-k8s/issues/154
enableCaBundleFetch: false
caBundleSecretName: ""

# most of this was cribbed from https://github.com/2i2c-org/infrastructure/blob/master/helm-charts/support/
# so giving props where props are due to Yuvi Panda :sparkles:
prometheus-adapter:
Expand Down Expand Up @@ -163,7 +168,6 @@ grafana:
dashboardsConfigMaps:
default: "eoapi-dashboards"


metrics-server:
apiService:
create: true

0 comments on commit 4011ceb

Please sign in to comment.