-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support creation of configmaps & secrets and extra env & envFrom conf…
…iguration in Helm Chart (#12164) * Enable provisionning of extra secrets and configmaps in helm chart Added 2 new values: * extraSecrets * extraConfigMaps Those values enable the provisionning of ConfigMaps and secrets directly from the airflow chart. Those objects could be used for storing airflow variables or (secret) connections info for instance (the plan is to add support for extraEnv and extraEnvFrom later). Docs and tests updated accordingly. * Add support for extra env and envFrom items in helm chart Added 2 new values: * extraEnv * extraEnvFrom Those values will be added to the defintion of airflow containers. They are expected to be string (they can be templated). Those new values won't be supported by "legacy" kubernetes executor configuration (you must use the pod template). Therefore, the value 'env' is also deprecated as it's kind of a duplicate for extraEnv. Docs and tests updated accordingly. (cherry picked from commit 56ee2bb)
- Loading branch information
Showing
17 changed files
with
485 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
#################################################### | ||
## Extra ConfigMaps provisioned via the chart values | ||
#################################################### | ||
{{- $Global := . }} | ||
{{- range $configMapName, $configMapContent := .Values.extraConfigMaps }} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ tpl $configMapName $Global | quote }} | ||
labels: | ||
release: {{ $Global.Release.Name }} | ||
chart: "{{ $Global.Chart.Name }}-{{ $Global.Chart.Version }}" | ||
heritage: {{ $Global.Release.Service }} | ||
annotations: | ||
"helm.sh/hook": "pre-install,pre-upgrade" | ||
"helm.sh/hook-delete-policy": "before-hook-creation" | ||
"helm.sh/hook-weight": "0" | ||
{{- with $Global.Values.labels }} | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
{{- if $configMapContent.data }} | ||
data: | ||
{{- with $configMapContent.data }} | ||
{{- tpl . $Global | nindent 2 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
################################################# | ||
## Extra Secrets provisioned via the chart values | ||
################################################# | ||
{{- $Global := . }} | ||
{{- range $secretName, $secretContent := .Values.extraSecrets }} | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ tpl $secretName $Global | quote }} | ||
labels: | ||
release: {{ $Global.Release.Name }} | ||
chart: "{{ $Global.Chart.Name }}-{{ $Global.Chart.Version }}" | ||
heritage: {{ $Global.Release.Service }} | ||
annotations: | ||
"helm.sh/hook": "pre-install,pre-upgrade" | ||
"helm.sh/hook-delete-policy": "before-hook-creation" | ||
"helm.sh/hook-weight": "0" | ||
{{- with $Global.Values.labels }} | ||
{{ toYaml . | indent 4 }} | ||
{{- end }} | ||
{{- if $secretContent.data }} | ||
data: | ||
{{- with $secretContent.data }} | ||
{{- tpl . $Global | nindent 2 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if $secretContent.stringData }} | ||
stringData: | ||
{{- with $secretContent.stringData }} | ||
{{- tpl . $Global | nindent 2 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.