Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart: Enable templating in extraContainers and extraInitContainers #38507

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

mewa
Copy link
Contributor

@mewa mewa commented Mar 26, 2024

Currently, the extraContainers and extraInitContainers are passed on an "as-is" basis. What this means in practice is that if you depend on a release-specific resource you have to manually provide the names rather than use templating.


Example: mounting a release-specific ConfigMap into an extraContainer

The following config will not work, since it produces an init container which references {{ .Release.Name }}-stuff-config copied verbatim, rather than the templated value including the actual release name as you would expect.

workers:
  extraInitContainers:
    - name: init-stuff
      image: does/stuff:1.0.0
      envFrom:
        - configMapRef:
            name: "{{ .Release.Name }}-stuff-config"

extraConfigMaps:
  '{{ .Release.Name }}-stuff-config':
    data: |-
      STUFF_ENV_VAR1: one
      STUFF_ENV_VAR2: two

This PR enables templating for extraContainers and extraInitContainers fields to fix this issue and improve the reusability of the chart.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label May 11, 2024
@mewa
Copy link
Contributor Author

mewa commented May 13, 2024

Rebased on main

@JuniorJPDJ
Copy link

IMO would also be nice to add informations about templating to the comments in values file itself (as in done volumes)

I'm personally waiting for this to be merged as I depend on this feature in umbrella chart I'm writing.

@eladkal eladkal removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Jun 3, 2024
@eladkal eladkal added this to the Airflow Helm Chart 1.14.0 milestone Jun 3, 2024
@eladkal eladkal merged commit 1bf8479 into apache:main Jun 3, 2024
61 checks passed
@utkarsharma2 utkarsharma2 added the type:improvement Changelog: Improvements label Jun 3, 2024
fdemiane pushed a commit to fdemiane/airflow that referenced this pull request Jun 6, 2024
…38507)

* Add test cases for templating extraContainers and extraInitContainers

* Use templating for extra airflow containers
syedahsn pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jun 7, 2024
…38507)

* Add test cases for templating extraContainers and extraInitContainers

* Use templating for extra airflow containers
jannisko pushed a commit to jannisko/airflow that referenced this pull request Jun 15, 2024
…38507)

* Add test cases for templating extraContainers and extraInitContainers

* Use templating for extra airflow containers
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Jul 26, 2024
…38507)

* Add test cases for templating extraContainers and extraInitContainers

* Use templating for extra airflow containers
@utkarsharma2 utkarsharma2 added changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) and removed type:improvement Changelog: Improvements labels Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:helm-chart Airflow Helm Chart changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants