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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
