allow for additional container environment variables #16

Merged
lafriks merged 5 commits from Jasper-Ben/helm-chart:master into master 2020-09-10 10:15:37 +00:00
Contributor

e.g. useful for setting the timezone "TZ=Europe/Berlin"

e.g. useful for setting the timezone "TZ=Europe/Berlin"
luhahn requested changes 2020-09-01 07:05:24 +00:00
Dismissed
@@ -70,6 +70,7 @@ spec:
) \
{{- end }}
'
{{- toYaml .Values.env | trim | nindent 12 }}
Member

Why is this at the end of the init container?

Why is this at the end of the init container?
Author
Contributor

Whoops, my bad. Got distracted ?

Whoops, my bad. Got distracted ?
@@ -87,6 +88,7 @@ spec:
value: {{ .Values.gitea.config.server.SSH_LISTEN_PORT | quote }}
- name: SSH_PORT
value: {{ .Values.gitea.config.server.SSH_PORT | quote }}
{{- toYaml .Values.env | trim | nindent 12 }}
Member

Why using trim?

We could think about using something like that:

{{- range .Values.env }} - name: {{ .name | quote }} value: {{ .value | quote }} {{- end }} 

To ensure that only strings are created, since kubernetes will fail on ints and other types

Why using trim? We could think about using something like that: ``` {{- range .Values.env }} - name: {{ .name | quote }} value: {{ .value | quote }} {{- end }} ``` To ensure that only strings are created, since kubernetes will fail on ints and other types
Author
Contributor

Why using trim?

I am not sure, how Kubernetes would handle name: "foo " during variable assignment. The quote part is definitely a good idea though.

> Why using trim? I am not sure, how Kubernetes would handle `name: "foo "` during variable assignment. The `quote` part is definitely a good idea though.
Member

Good point, maybe we should use this ?

{{ .name | quote | trim }} 
Good point, maybe we should use this ? ``` {{ .name | quote | trim }} ```
Author
Contributor

Done ?

Done ?
values.yaml Outdated
@@ -52,6 +52,10 @@ tolerations: []
affinity: {}
env: []
Member

You're adding this to statefulset, so it should be there in the values.

 statefulset:  env: [] 
You're adding this to statefulset, so it should be there in the values. ```yaml statefulset: env: [] ```
Jasper-Ben marked this conversation as resolved
luhahn requested changes 2020-09-01 09:19:40 +00:00
Dismissed
@@ -89,1 +89,4 @@
value: {{ .Values.gitea.config.server.SSH_PORT | quote }}
{{- range .Values.statefulset.env }}
- name: {{ .name | quote | trim }}
value: {{ .value | quote }}
Member

Sorry, just did some testing. Trim does not really work with quote.
And you're right, kubernetes does not accept whitespaces at the end. However it does not throw an error but completely refuses to fire up the pod without any message.

This solves this issue:

{{- range .Values.statefulset.env }} - name: {{ .name | quote | nospace }} value: {{ .value | quote | nospace }} {{- end }} 
Sorry, just did some testing. Trim does not really work with quote. And you're right, kubernetes does not accept whitespaces at the end. However it does not throw an error but completely refuses to fire up the pod without any message. This solves this issue: ``` {{- range .Values.statefulset.env }} - name: {{ .name | quote | nospace }} value: {{ .value | quote | nospace }} {{- end }} ```
Member

And you're right again, we only need to trim the name. The value can have spaces :)

And you're right again, we only need to trim the name. The value can have spaces :)
Author
Contributor

so value should be value: {{ .value | quote }} right?

so value should be `value: {{ .value | quote }}` right?
Member

yes :)

yes :)
Owner

Please resolve the conflicts.

Please resolve the conflicts.
Jasper-Ben force-pushed master from cfb7621e91 to b14afba640 2020-09-08 13:13:04 +00:00 Compare
Jasper-Ben force-pushed master from b14afba640 to c66ac9cee5 2020-09-08 13:14:14 +00:00 Compare
Jasper-Ben requested review from luhahn 2020-09-08 13:14:34 +00:00
luhahn approved these changes 2020-09-09 08:41:06 +00:00
Dismissed
luhahn left a comment
Member

Looks good to me

Looks good to me
lunny approved these changes 2020-09-09 11:36:06 +00:00
Dismissed
lafriks merged commit 8060d080db into master 2020-09-10 10:15:37 +00:00
Sign in to join this conversation.
No description provided.