You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Miretpl (via GitHub)" <gi...@apache.org> on 2025/10/15 22:40:32 UTC
Re: [PR] Customize statsd dagprocessor labels [airflow]
Miretpl commented on code in PR #55832:
URL: https://github.com/apache/airflow/pull/55832#discussion_r2434139841
##########
chart/templates/statsd/statsd-serviceaccount.yaml:
##########
@@ -32,8 +32,8 @@ metadata:
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
- {{- with .Values.labels }}
- {{- toYaml . | nindent 4 }}
+ {{- if or (.Values.labels) (.Values.statsd.labels) }}
Review Comment:
I saw in couple of places that people write:
```
or (value1) (value2)
```
but I think the below will work also:
```
or value1 value2
```
Is there any difference between these two? I tried to find something, but without any success.
##########
chart/docs/customizing-labels.rst:
##########
@@ -0,0 +1,62 @@
+.. 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.
+
+Customizing Labels for Pods
+---------------------------
+
+The Helm chart allows you to customize labels for your Airflow objects. You can set global labels that apply to all objects and pods defined in the chart, as well as component-specific labels for individual Airflow components.
+
+Global Labels
+~~~~~~~~~~~~~
+
+Global labels can be set using the ``labels`` parameter in your values file. These labels will be applied to all Airflow objects and pods defined in the chart:
+
+.. code-block:: yaml
+
+ labels:
+ environment: production
+
+Component-Specific Labels
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can also set specific labels for individual Airflow components. These labels will be merged with the global labels, with component-specific labels taking precedence.
+
+For example, to add specific labels to different components:
+
+.. code-block:: yaml
+
+ # Global labels applied to all pods
+ labels:
+ environment: production
+
+ # Scheduler specific labels
+ scheduler:
+ labels:
+ role: scheduler
+
+ # Worker specific labels
+ workers:
+ labels:
+ role: worker
+
+ # Webserver specific labels
+ webserver:
+ labels:
+ role: ui
+
+.. note::
+ Component-specific labels take precedence over global labels when there are conflicts. This allows you to override global labels for specific components when needed.
Review Comment:
The first paragraph under the `Component-Specific Labels` section is, in a way, duplicating that information. Maybe we should combine these two to not repeat information and potentially miss one more place to change?
##########
chart/values.yaml:
##########
@@ -2174,6 +2174,9 @@ dagProcessor:
securityContexts:
container: {}
+ # Labels specific to dag processor objects and pods
+ labels: {}
+ # Environment variables to add to dag processor container
Review Comment:
```suggestion
# Labels specific to dag processor objects
labels: {}
# Environment variables to add to dag processor container
```
I think that `pods` are also `objects`, so the latter should not be needed.
--
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