mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 18:59:09 +00:00
use env entries instead of envFrom (#36)
The reason for this PR is that currently if the secret doesn’t have the key NB_API_KEY yet at deployment time, the deployment will still run and pull in an env list that doesn’t include NB_API_KEY since the envFrom will just pull any and all keys it finds in the secret and makes env vars out of them. then at a later point, once the NB_API_KEY key is populated in the secret, one has to bounce the pod to get the key to be picked up. if you use the env: valueFrom syntax using a named key, if that named key doesn’t exist, the deployment should give an error and retry until the secret key is available
This commit is contained in:
@@ -78,12 +78,15 @@ spec:
|
|||||||
successThreshold: {{ .Values.operator.livenessProbe.successThreshold }}
|
successThreshold: {{ .Values.operator.livenessProbe.successThreshold }}
|
||||||
timeoutSeconds: {{ .Values.operator.livenessProbe.timeoutSeconds }}
|
timeoutSeconds: {{ .Values.operator.livenessProbe.timeoutSeconds }}
|
||||||
{{- if or .Values.netbirdAPI.key .Values.netbirdAPI.keyFromSecret }}
|
{{- if or .Values.netbirdAPI.key .Values.netbirdAPI.keyFromSecret }}
|
||||||
envFrom:
|
env:
|
||||||
- secretRef:
|
- name: NB_API_KEY
|
||||||
|
valueFrom:
|
||||||
{{- if .Values.netbirdAPI.keyFromSecret }}
|
{{- if .Values.netbirdAPI.keyFromSecret }}
|
||||||
name: {{.Values.netbirdAPI.keyFromSecret}}
|
name: {{.Values.netbirdAPI.keyFromSecretName}}
|
||||||
|
key: {{.Values.netbirdAPI.keyFromSecretKey}}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
name: {{ include "kubernetes-operator.fullname" . }}
|
name: {{ include "kubernetes-operator.fullname" . }}
|
||||||
|
key: NB_API_KEY
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
|
|||||||
@@ -190,4 +190,5 @@ cluster:
|
|||||||
netbirdAPI: {}
|
netbirdAPI: {}
|
||||||
# NetBird Service Account Token
|
# NetBird Service Account Token
|
||||||
# key: "nbp_m0LM9ZZvDUzFO0pY50iChDOTxJgKFM3DIqmZ"
|
# key: "nbp_m0LM9ZZvDUzFO0pY50iChDOTxJgKFM3DIqmZ"
|
||||||
# keyFromSecret: "Secret name with NB_API_KEY=Service Account Token"
|
# keyFromSecretName: "Secret name"
|
||||||
|
# keyFromSecretKey: "NB_API_KEY"
|
||||||
Reference in New Issue
Block a user