-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Add securityContext config for Redis to helm chart #22182
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
Add securityContext config for Redis to helm chart #22182
Conversation
dan-vaughan
commented
Mar 11, 2022
- Add securityContext templating to statefulSet manifest
- Add securityContext commented-out to values.yaml
- Add securityContext section to values.schema.json
- Add securityContext templating to statefulSet manifest - Add securityContext commented-out to values.yaml - Add securityContext section to values.schema.json
|
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)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @flipstone42!
Can you add the redis statefulset to the test suite for this feature?
| "templates/jobs/migrate-database-job.yaml", |
|
@jedcunningham should we also add in redis sts in test_check_local_setting |
| {{- $nodeSelector := or .Values.redis.nodeSelector .Values.nodeSelector }} | ||
| {{- $affinity := or .Values.redis.affinity .Values.affinity }} | ||
| {{- $tolerations := or .Values.redis.tolerations .Values.tolerations }} | ||
| {{- $securityContext := include "airflowSecurityContext" (list . .Values.redis) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| {{- $securityContext := include "airflowSecurityContext" (list . .Values.redis) }} | |
| {{- $securityContext := include "localSecurityContext" .Values.redis }} |
This should use localSecurityContext instead. We don't want the global Airflow security context to apply to Redis.
|
Apologies for not following up sooner @jedcunningham - would you like me to implement the changes you suggest here, or close this PR in favour of #22663? |
|
@flipstone42, no worries! Yeah go ahead and make them here. I don't want to swipe your first commit, but I do want to get this done for the next chart release 👍. There was one other test change I had added, so you can use my PR as an example. |
- Set uid (default 0) in values - Use localSecurityContext in redis statefulset - Refactor test for localSecurityContext
- Set uid (default 0) in values - Use localSecurityContext in redis statefulset - Refactor test for localSecurityContext
…42/airflow into helm-add-redis-securitycontext
|
@jedcunningham I've implemented your suggested changes, and defaulted the uid of the redis statefulset to 0 for backwards-compatibility 😄 |
…42/airflow into helm-add-redis-securitycontext
|
Sounds good. Can you also add redis to the |
|
@jedcunningham is there anything else we need to merge this in? |
|
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
…42/airflow into helm-add-redis-securitycontext
|
@jedcunningham I fixed a test error & have tested locally, I think I need you to trigger the full set of unit-tests before we merge this in? |
|
Awesome work, congrats on your first merged pull request! |
|
@dan-vaughan, congrats on your first commit! 🎉🚀 |
Thank you for your help @jedcunningham 🙏 |
|
@dan-vaughan what was the backward compatibility concern that led to using 0 as the default uid rather than 999? |