Skip to content

Commit 4011ceb

Browse files
committed
fix(support): Add passthrough for ca bundle secret into metrics server
1 parent 9604353 commit 4011ceb

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{/*
2+
Fetch the CA Bundle from a specified secret if enabled
3+
*/}}
4+
{{- define "eoapi-support.fetchCaBundle" -}}
5+
{{- if .Values.enableCaBundleFetch -}}
6+
{{- $secretName := .Values.caBundleSecretName | default "eoepca-ca-secret" -}}
7+
{{- $caBundle := "" -}}
8+
{{- with (lookup "v1" "Secret" "default" $secretName) -}}
9+
{{- $caBundle = index .data "ca.crt" | b64dec -}}
10+
{{- end -}}
11+
{{- $caBundle -}}
12+
{{- else -}}
13+
"" # Return an empty string if not enabled
14+
{{- end -}}
15+
{{- end -}}

helm-chart/eoapi-support/values.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# when enabled, metrics-server will use the caBundle from the provided secret
2+
# ref: https://github.com/developmentseed/eoapi-k8s/issues/154
3+
enableCaBundleFetch: false
4+
caBundleSecretName: ""
5+
16
# most of this was cribbed from https://github.com/2i2c-org/infrastructure/blob/master/helm-charts/support/
27
# so giving props where props are due to Yuvi Panda :sparkles:
38
prometheus-adapter:
@@ -163,7 +168,6 @@ grafana:
163168
dashboardsConfigMaps:
164169
default: "eoapi-dashboards"
165170

166-
167171
metrics-server:
168172
apiService:
169173
create: true

0 commit comments

Comments
 (0)