You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/09/10 15:32:16 UTC

[GitHub] [airflow] nwalens opened a new pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

nwalens opened a new pull request #18147:
URL: https://github.com/apache/airflow/pull/18147


   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #18136
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   This pull request adds the parameter rbac.createSCCRoleBinding.
   When enabled, a new RoleBinding object will be created targeting the various serviceAccounts utilised by deployments and pods.
   The roleBinding will target the ``system:openshift:scc:anyuid`` cluster role which allows for pods to start with any arbitrary uid.
   The ideal solution would also add the possibility of removing the security contexts altogether, however this would not be possible due to a number of pod templates setting different uids.
   I will investigate the possibility to add the option of removing the security contexts so that openshift can then set its own uid as intended.
   ]As it is, the pods will start and word as expected, utilising the predefined uids set in values file or the default image uid as set during build.
   
   The change is not intrusive and should work in the current workflow as is. The option is also set to false by default in order to not impact any existing setups. 
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on a change in pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on a change in pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#discussion_r712201118



##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,93 @@
+# 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.
+
+################################
+## Airflow SCC Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- $workerLaunchExecutors := list "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}

Review comment:
       Yes, I agree, it does look much better like that.
   As for schedulers, I think we can remove the test altogether since we always have one in place.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on a change in pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#discussion_r706312705



##########
File path: chart/values.yaml
##########
@@ -1251,7 +1252,7 @@ dags:
     # Volume size for dags
     size: 1Gi
     # If using a custom storageClass, pass name here
-    storageClassName:
+    storageClassName: 

Review comment:
       extra space ;)

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}

Review comment:
       ```suggestion
   {{- $schedulerLaunchExecutors := list "LocalExecutor" "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
   ```
   
   I think ? Or else why "LocalExecutor" is here?

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding

Review comment:
       ```suggestion
   ## Airflow Security Context Constraint Role Binding
   ```

##########
File path: chart/values.schema.json
##########
@@ -253,6 +253,11 @@
                     "description": "Specifies whether RBAC resources should be created.",
                     "type": "boolean",
                     "default": true
+                },
+                "createSCCRoleBinding": {
+                    "description": "Specifies whether SCC RoleBinding resource should be created.",

Review comment:
       I think it would be great to add a little more explanation of what SCC is. Maybe a small chapter explaining in Production Guide (https://airflow.apache.org/docs/helm-chart/stable/production-guide.html) and link to it from here (and refer to the parameter from there)?  Also a comment that it is related to OpenShift wiould be great.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-926837599


   Approved - but the test mentioned by @jedcunningham should be added 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk merged pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #18147:
URL: https://github.com/apache/airflow/pull/18147


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-926837706


   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-929422454


   > πŸŽ‰ πŸŽ‰ πŸŽ‰ πŸŽ‰ πŸŽ‰ πŸŽ‰
   
   Thank you very much!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-922963076


   > @nwalens, I apologize, but looking again I think I was wrong with checking `<component>.serviceAccount.create`. I think we want them to be set regardless and the `<component>.serviceAccountName` templates handles the details. Sorry about that!
   
   No worries at all. I have removed the checks as requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on a change in pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on a change in pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#discussion_r712200272



##########
File path: docs/helm-chart/production-guide.rst
##########
@@ -200,3 +200,24 @@ By default, the chart will deploy Redis. However, you can use any supported Cele
 
 For more information about setting up a Celery broker, refer to the
 exhaustive `Celery documentation on the topic <http://docs.celeryproject.org/en/latest/getting-started/>`_.
+
+Security Context Constraints
+-----------------------------
+
+A ``Security Context Constraint`` (SCC) is a OpenShift construct that works as a RBAC rule however it targets PODs instead of users.
+When defining a SCC, one can control actions and resources a POD can perform or access during startup and runtime.
+
+The SCCs are split into different levels or categories with the ``restricted`` SCC being the default one assigned to PODs.
+When deploying airflow to OpenShift, one can leverage the SCCs and allow the PODs to start containers utilizing the ``anyuid`` SCC.

Review comment:
       Changes in place.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-927344158


   @jedcunningham and @potiuk, sorry for the late reply.
   
   I have just rebased and added the unit test.
   
   Thanks a lot.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-916994486


   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]( https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) 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](https://github.com/apache/airflow/blob/main/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/BREEZE.rst) 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](https://www.apache.org/foundation/policies/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]( https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better πŸš€.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
kaxil commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-923332917


   @nwalens Flower tests are at https://github.com/apache/airflow/blob/main/chart/tests/test_flower.py which you can use as an example


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-929394845


   Awesome work, congrats on your first merged pull request!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-929422454


   > πŸŽ‰ πŸŽ‰ πŸŽ‰ πŸŽ‰ πŸŽ‰ πŸŽ‰
   
   Thank you very much!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on a change in pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on a change in pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#discussion_r706321958



##########
File path: chart/values.schema.json
##########
@@ -253,6 +253,11 @@
                     "description": "Specifies whether RBAC resources should be created.",
                     "type": "boolean",
                     "default": true
+                },
+                "createSCCRoleBinding": {
+                    "description": "Specifies whether SCC RoleBinding resource should be created.",

Review comment:
       Fair enough, I'm not too good at documentation but I will do my best.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] jedcunningham commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-923140226


   @nwalens, looks good. Can you add at least a basic test to make sure it is created when enabled and has the right `kind`. Ideally we cover the conditional stuff too, like "flower".


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on a change in pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on a change in pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#discussion_r712200784



##########
File path: docs/helm-chart/production-guide.rst
##########
@@ -200,3 +200,24 @@ By default, the chart will deploy Redis. However, you can use any supported Cele
 
 For more information about setting up a Celery broker, refer to the
 exhaustive `Celery documentation on the topic <http://docs.celeryproject.org/en/latest/getting-started/>`_.
+
+Security Context Constraints
+-----------------------------
+
+A ``Security Context Constraint`` (SCC) is a OpenShift construct that works as a RBAC rule however it targets PODs instead of users.
+When defining a SCC, one can control actions and resources a POD can perform or access during startup and runtime.

Review comment:
       Changes in place.

##########
File path: docs/helm-chart/production-guide.rst
##########
@@ -200,3 +200,24 @@ By default, the chart will deploy Redis. However, you can use any supported Cele
 
 For more information about setting up a Celery broker, refer to the
 exhaustive `Celery documentation on the topic <http://docs.celeryproject.org/en/latest/getting-started/>`_.
+
+Security Context Constraints
+-----------------------------
+
+A ``Security Context Constraint`` (SCC) is a OpenShift construct that works as a RBAC rule however it targets PODs instead of users.
+When defining a SCC, one can control actions and resources a POD can perform or access during startup and runtime.
+
+The SCCs are split into different levels or categories with the ``restricted`` SCC being the default one assigned to PODs.
+When deploying airflow to OpenShift, one can leverage the SCCs and allow the PODs to start containers utilizing the ``anyuid`` SCC.
+
+In order to enable the usage of SCCs, one must set the parameter :ref:`rbac.createSCCRoleBinding <parameters:Kubernetes>` to ``true`` as shown below:
+
+.. code-block:: yaml
+
+  rbac:
+    create: true
+    createSCCRoleBinding: true
+
+In this chart, SCCs are bound to the PODs via RoleBindings meaning that the option ``rbac.create`` must also be set to ``true`` in order to fully enable the SCC usage.

Review comment:
       Changes in place.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] jedcunningham commented on a change in pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on a change in pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#discussion_r708819222



##########
File path: docs/helm-chart/production-guide.rst
##########
@@ -200,3 +200,24 @@ By default, the chart will deploy Redis. However, you can use any supported Cele
 
 For more information about setting up a Celery broker, refer to the
 exhaustive `Celery documentation on the topic <http://docs.celeryproject.org/en/latest/getting-started/>`_.
+
+Security Context Constraints
+-----------------------------
+
+A ``Security Context Constraint`` (SCC) is a OpenShift construct that works as a RBAC rule however it targets PODs instead of users.
+When defining a SCC, one can control actions and resources a POD can perform or access during startup and runtime.

Review comment:
       ```suggestion
   A ``Security Context Constraint`` (SCC) is a OpenShift construct that works as a RBAC rule however it targets Pods instead of users.
   When defining a SCC, one can control actions and resources a Pod can perform or access during startup and runtime.
   ```

##########
File path: docs/helm-chart/production-guide.rst
##########
@@ -200,3 +200,24 @@ By default, the chart will deploy Redis. However, you can use any supported Cele
 
 For more information about setting up a Celery broker, refer to the
 exhaustive `Celery documentation on the topic <http://docs.celeryproject.org/en/latest/getting-started/>`_.
+
+Security Context Constraints
+-----------------------------
+
+A ``Security Context Constraint`` (SCC) is a OpenShift construct that works as a RBAC rule however it targets PODs instead of users.
+When defining a SCC, one can control actions and resources a POD can perform or access during startup and runtime.
+
+The SCCs are split into different levels or categories with the ``restricted`` SCC being the default one assigned to PODs.
+When deploying airflow to OpenShift, one can leverage the SCCs and allow the PODs to start containers utilizing the ``anyuid`` SCC.

Review comment:
       ```suggestion
   The SCCs are split into different levels or categories with the ``restricted`` SCC being the default one assigned to Pods.
   When deploying Airflow to OpenShift, one can leverage the SCCs and allow the Pods to start containers utilizing the ``anyuid`` SCC.
   ```

##########
File path: docs/helm-chart/production-guide.rst
##########
@@ -200,3 +200,24 @@ By default, the chart will deploy Redis. However, you can use any supported Cele
 
 For more information about setting up a Celery broker, refer to the
 exhaustive `Celery documentation on the topic <http://docs.celeryproject.org/en/latest/getting-started/>`_.
+
+Security Context Constraints
+-----------------------------
+
+A ``Security Context Constraint`` (SCC) is a OpenShift construct that works as a RBAC rule however it targets PODs instead of users.
+When defining a SCC, one can control actions and resources a POD can perform or access during startup and runtime.
+
+The SCCs are split into different levels or categories with the ``restricted`` SCC being the default one assigned to PODs.
+When deploying airflow to OpenShift, one can leverage the SCCs and allow the PODs to start containers utilizing the ``anyuid`` SCC.
+
+In order to enable the usage of SCCs, one must set the parameter :ref:`rbac.createSCCRoleBinding <parameters:Kubernetes>` to ``true`` as shown below:
+
+.. code-block:: yaml
+
+  rbac:
+    create: true
+    createSCCRoleBinding: true
+
+In this chart, SCCs are bound to the PODs via RoleBindings meaning that the option ``rbac.create`` must also be set to ``true`` in order to fully enable the SCC usage.

Review comment:
       ```suggestion
   In this chart, SCCs are bound to the Pods via RoleBindings meaning that the option ``rbac.create`` must also be set to ``true`` in order to fully enable the SCC usage.
   ```

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,93 @@
+# 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.
+
+################################
+## Airflow SCC Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- $workerLaunchExecutors := list "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}

Review comment:
       In this context, I'm not sure we care if the scheduler or workers can launch pods, only if the component exists? Obviously we need a scheduler, so no conditional there. Maybe this is what we want instead for the workers:
   
   ```suggestion
   {{- $hasWorkers := has .Values.executor (list "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor") }}
   ```
   
   Then the worker serviceaccount section can be done conditionally based on `$hasWorkers`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-929394963


   :tada: :tada: :tada: :tada: :tada: :tada: 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-929394845


   Awesome work, congrats on your first merged pull request!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-928152614


   Some static/helm unit test failed 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk merged pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
potiuk merged pull request #18147:
URL: https://github.com/apache/airflow/pull/18147


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on a change in pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on a change in pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#discussion_r712197611



##########
File path: chart/values.schema.json
##########
@@ -253,6 +253,11 @@
                     "description": "Specifies whether RBAC resources should be created.",
                     "type": "boolean",
                     "default": true
+                },
+                "createSCCRoleBinding": {
+                    "description": "Specifies whether SCC RoleBinding resource should be created.",

Review comment:
       Documentation in place!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on a change in pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on a change in pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#discussion_r712197858



##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}

Review comment:
       Change applied.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-917202675


   @jedcunningham  I hope I managed to fix all issues you pointed out.
   
   Sorry for the trouble and thanks for the help!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] jedcunningham commented on a change in pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on a change in pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#discussion_r706291745



##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- $workerLaunchExecutors := list "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- if .Values.multiNamespaceMode }}
+kind: ClusterRoleBinding
+{{- else }}
+kind: RoleBinding
+{{- end }}
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+{{- if not .Values.multiNamespaceMode }}
+  namespace: {{ .Release.Namespace }}
+{{- end }}
+  name: {{ .Release.Name }}-scc-rolebinding
+  labels:
+    tier: airflow
+    release: {{ .Release.Name }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    heritage: {{ .Release.Service }}
+{{- with .Values.labels }}
+{{ toYaml . | indent 4 }}
+{{- end }}
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: system:openshift:scc:anyuid
+subjects:
+  - kind: ServiceAccount
+    name: {{ include "webserver.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- if has .Values.executor $workerLaunchExecutors }}

Review comment:
       ```suggestion
   {{- if and (has .Values.executor $workerLaunchExecutors) .Values.workers.serviceAccount.create }}
   ```

##########
File path: chart/CHANGELOG.txt
##########
@@ -3,6 +3,7 @@ Airflow Helm Chart 1.1.0, 2021-07-26
 
 New Features
 """"""""""""
+- Chart: Add support for running pods with anyuid ``securityContextConstraint`` (SCC) (#18136)

Review comment:
       ```suggestion
   ```
   
   1.1.0 is already released, this will land in 1.2.0 and we will build the changelog then. Thanks for trying to be proactive though!

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- $workerLaunchExecutors := list "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- if .Values.multiNamespaceMode }}
+kind: ClusterRoleBinding
+{{- else }}
+kind: RoleBinding
+{{- end }}
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+{{- if not .Values.multiNamespaceMode }}
+  namespace: {{ .Release.Namespace }}
+{{- end }}
+  name: {{ .Release.Name }}-scc-rolebinding
+  labels:
+    tier: airflow
+    release: {{ .Release.Name }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    heritage: {{ .Release.Service }}
+{{- with .Values.labels }}
+{{ toYaml . | indent 4 }}
+{{- end }}
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: system:openshift:scc:anyuid
+subjects:
+  - kind: ServiceAccount
+    name: {{ include "webserver.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}

Review comment:
       ```suggestion
   {{- if .Values.webserver.serviceAccount.create }}
     - kind: ServiceAccount
       name: {{ include "webserver.serviceAccountName" . }}
       namespace: {{ .Release.Namespace }}
   {{- end }}    
   ```

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- $workerLaunchExecutors := list "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- if .Values.multiNamespaceMode }}
+kind: ClusterRoleBinding
+{{- else }}
+kind: RoleBinding
+{{- end }}
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+{{- if not .Values.multiNamespaceMode }}
+  namespace: {{ .Release.Namespace }}
+{{- end }}
+  name: {{ .Release.Name }}-scc-rolebinding
+  labels:
+    tier: airflow
+    release: {{ .Release.Name }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    heritage: {{ .Release.Service }}
+{{- with .Values.labels }}
+{{ toYaml . | indent 4 }}
+{{- end }}
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: system:openshift:scc:anyuid
+subjects:
+  - kind: ServiceAccount
+    name: {{ include "webserver.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- if has .Values.executor $workerLaunchExecutors }}
+  - kind: ServiceAccount
+    name: {{ include "worker.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- if has .Values.executor $schedulerLaunchExecutors }}
+  - kind: ServiceAccount
+    name: {{ include "scheduler.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- if .Values.statsd.enabled }}

Review comment:
       ```suggestion
   {{- if and .Values.statsd.enabled .Values.statsd.serviceAccount.create }}
   ```

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- $workerLaunchExecutors := list "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- if .Values.multiNamespaceMode }}
+kind: ClusterRoleBinding
+{{- else }}
+kind: RoleBinding
+{{- end }}
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+{{- if not .Values.multiNamespaceMode }}
+  namespace: {{ .Release.Namespace }}
+{{- end }}
+  name: {{ .Release.Name }}-scc-rolebinding
+  labels:
+    tier: airflow
+    release: {{ .Release.Name }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    heritage: {{ .Release.Service }}
+{{- with .Values.labels }}
+{{ toYaml . | indent 4 }}
+{{- end }}
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: system:openshift:scc:anyuid
+subjects:
+  - kind: ServiceAccount
+    name: {{ include "webserver.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- if has .Values.executor $workerLaunchExecutors }}
+  - kind: ServiceAccount
+    name: {{ include "worker.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- if has .Values.executor $schedulerLaunchExecutors }}

Review comment:
       ```suggestion
   {{- if and (has .Values.executor $schedulerLaunchExecutors) .Values.scheduler.serviceAccount.create }}
   ```

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- $workerLaunchExecutors := list "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- if .Values.multiNamespaceMode }}
+kind: ClusterRoleBinding
+{{- else }}
+kind: RoleBinding
+{{- end }}
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+{{- if not .Values.multiNamespaceMode }}
+  namespace: {{ .Release.Namespace }}
+{{- end }}
+  name: {{ .Release.Name }}-scc-rolebinding
+  labels:
+    tier: airflow
+    release: {{ .Release.Name }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    heritage: {{ .Release.Service }}
+{{- with .Values.labels }}
+{{ toYaml . | indent 4 }}
+{{- end }}
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: system:openshift:scc:anyuid
+subjects:
+  - kind: ServiceAccount
+    name: {{ include "webserver.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- if has .Values.executor $workerLaunchExecutors }}
+  - kind: ServiceAccount
+    name: {{ include "worker.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- if has .Values.executor $schedulerLaunchExecutors }}
+  - kind: ServiceAccount
+    name: {{ include "scheduler.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- if .Values.statsd.enabled }}
+  - kind: ServiceAccount
+    name: {{ include "statsd.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+  - kind: ServiceAccount
+    name: {{ include "flower.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}

Review comment:
       ```suggestion
   {{- if and .Values.flower.enabled (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) .Values.flower.serviceAccount.create }}
     - kind: ServiceAccount
       name: {{ include "flower.serviceAccountName" . }}
       namespace: {{ .Release.Namespace }}
   {{- end }}
   ```

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding

Review comment:
       ```suggestion
   ## Airflow SCC Role Binding
   ```

##########
File path: chart/values.yaml
##########
@@ -1251,7 +1252,7 @@ dags:
     # Volume size for dags
     size: 1Gi
     # If using a custom storageClass, pass name here
-    storageClassName:
+    storageClassName: 

Review comment:
       ```suggestion
       storageClassName:
   ```
   
   Unintentional change?

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- $workerLaunchExecutors := list "CeleryExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}
+{{- if .Values.multiNamespaceMode }}
+kind: ClusterRoleBinding
+{{- else }}
+kind: RoleBinding
+{{- end }}
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+{{- if not .Values.multiNamespaceMode }}
+  namespace: {{ .Release.Namespace }}
+{{- end }}
+  name: {{ .Release.Name }}-scc-rolebinding
+  labels:
+    tier: airflow
+    release: {{ .Release.Name }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    heritage: {{ .Release.Service }}
+{{- with .Values.labels }}
+{{ toYaml . | indent 4 }}
+{{- end }}
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: system:openshift:scc:anyuid
+subjects:
+  - kind: ServiceAccount
+    name: {{ include "webserver.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- if has .Values.executor $workerLaunchExecutors }}
+  - kind: ServiceAccount
+    name: {{ include "worker.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- if has .Values.executor $schedulerLaunchExecutors }}
+  - kind: ServiceAccount
+    name: {{ include "scheduler.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- if .Values.statsd.enabled }}
+  - kind: ServiceAccount
+    name: {{ include "statsd.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+  - kind: ServiceAccount
+    name: {{ include "flower.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- if and (semverCompare ">=2.2.0" .Values.airflowVersion) (.Values.triggerer.serviceAccount.create ) }}
+  - kind: ServiceAccount
+    name: {{ include "triggerer.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- if .Values.migrateDatabaseJob.serviceAccount.create }}
+  - kind: ServiceAccount
+    name: {{ include "migrateDatabaseJob.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- if and .Values.createUserJob.serviceAccount.create .Values.webserver.defaultUser.enabled }}
+  - kind: ServiceAccount
+    name: {{ include "createUserJob.serviceAccountName" . }}
+    namespace: {{ .Release.Namespace }}
+{{- end }}
+{{- if .Values.cleanup.enabled }}

Review comment:
       ```suggestion
   {{- if and .Values.cleanup.enabled .Values.cleanup.serviceAccount.create }}
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] nwalens commented on a change in pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
nwalens commented on a change in pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#discussion_r706321921



##########
File path: chart/values.yaml
##########
@@ -1251,7 +1252,7 @@ dags:
     # Volume size for dags
     size: 1Gi
     # If using a custom storageClass, pass name here
-    storageClassName:
+    storageClassName: 

Review comment:
       Yeah, my bad, sorry about that.

##########
File path: chart/values.schema.json
##########
@@ -253,6 +253,11 @@
                     "description": "Specifies whether RBAC resources should be created.",
                     "type": "boolean",
                     "default": true
+                },
+                "createSCCRoleBinding": {
+                    "description": "Specifies whether SCC RoleBinding resource should be created.",

Review comment:
       Fair enough, I'm too good at documentation but I will do my best.

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding

Review comment:
       Yes, sorry that escaped me.

##########
File path: chart/templates/rbac/security-context-constraint-rolebinding.yaml
##########
@@ -0,0 +1,89 @@
+# 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.
+
+################################
+## Airflow Pod Reader Role Binding
+#################################
+{{- if and .Values.rbac.create .Values.rbac.createSCCRoleBinding }}
+{{- $schedulerLaunchExecutors := list "LocalExecutor" "KubernetesExecutor" "CeleryKubernetesExecutor" }}

Review comment:
       Make sense to me as well.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on pull request #18147: Allow airflow standard images to run in openshift utilising the official helm chart #18136

Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #18147:
URL: https://github.com/apache/airflow/pull/18147#issuecomment-928152614






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org