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: Allow overriding redis's runAsUser option (#19681) #19689

Closed
wants to merge 5 commits into from

Conversation

tomasgatial
Copy link

closes: #19681


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.

@boring-cyborg boring-cyborg bot added the area:helm-chart Airflow Helm Chart label Nov 18, 2021
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 18, 2021

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@@ -2856,6 +2856,11 @@
"type": "array",
"default": []
},
"uid": {
Copy link
Member

@potiuk potiuk Nov 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should come as .Values.redis.uid parameter ?

For compatibiity with previous version also I tihnk this should have None default and the whole security-context section should be conditional based on the uid set, I think because someone upgrading the chart will already have a root-owned db in /data abwhen persistence is enabled and it might get non-accessible if "runAsUser" is used.

Copy link
Author

@tomasgatial tomasgatial Nov 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course .Values.redis.uid , that was an oversight.

I see the issue with upgrading with existing redis data. What do you think of the solution below?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One more thing - we also have unit tests for the chart (chart/tests) - they are rather simple - you pass parameters and check if the rendered templates are as expected. It would be great to add tests for this change there.

Copy link
Member

@potiuk potiuk Nov 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I also recommend installing pre-commit - I think it will then generate documentation automatically from the schema (see https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#pre-commit-hooks)
This will avoid unnecessary CI iterations.

@jedcunningham
Copy link
Member

This should probably be added after #18249 is merged so we have one less deprecation to deal with.

@potiuk
Copy link
Member

potiuk commented Dec 5, 2021

Sorry - needs rebase again (but we had some intermittent problems that should nearly be gone - so please - rebase).

@kaxil kaxil changed the title add redis runAsUser option (#19681) Chart: Allow overriding redis's runAsUser option (#19681) Dec 10, 2021
@kaxil kaxil added this to the Airflow Helm Chart 1.4.0 milestone Dec 10, 2021
@github-actions github-actions bot added the okay to merge It's ok to merge this PR as it does not require more tests label Dec 10, 2021
@github-actions
Copy link

The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest main or amend the last commit of the PR, and push it with --force-with-lease.

@jedcunningham
Copy link
Member

@tomasgatial, #18249 has been merged. Can you refactor this to support both uid and a complete securityContext?

Copy link
Member

@jedcunningham jedcunningham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that #18249 has been merged, we need to refactor this to support a securityContext instead, and optionally an explicit uid.

@github-actions
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 Feb 28, 2022
@github-actions github-actions bot closed this Mar 6, 2022
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 okay to merge It's ok to merge this PR as it does not require more tests stale Stale PRs per the .github/workflows/stale.yml policy file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't launch Redis container on a cluster enforcing MustRunAsNonRoot policy
4 participants