-
Notifications
You must be signed in to change notification settings - Fork 17.4k
Add optional OTel service to the Airflow Helm Chart #64902
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
71bb87c
add otel to helm chart
xBis7 003ac5b
use Kustomize for grafana, jaeger, prometheus
xBis7 af397e8
enable specific service per flag + unit test
xBis7 2be7911
remove grafana, jaeger and prometheus kustomization logic
xBis7 68585dc
traces enabled and metrics disabled, by default
xBis7 ff5306f
remove otelCollector.enabled flag
xBis7 86ee71c
add statsd comments about otel metrics overriding the config
xBis7 4bd2e00
make OTEL_METRIC_EXPORT_INTERVAL configurable and provide default val…
xBis7 4952f30
remove hardcoded value for metrics otel_port in values.yaml
xBis7 73f9adc
add option to override the configmap
xBis7 50812ab
add otelCollector.args and make the config.yml file as the default ar…
xBis7 79b84aa
rename extraAnnotations to annotations in otel-collector-service.yaml
xBis7 8b32005
parameterize the readiness and liveness probe values
xBis7 45735d0
remove prometheus from the configmap
xBis7 e570cd2
update the default value for OTEL_TRACES_EXPORTER
xBis7 c5b2322
fix tests in airflow_aux + otel-collector-serviceaccount.yaml
xBis7 49fe21f
fix spellcheck errors in docs
xBis7 4af0025
fix tests in security
xBis7 c22c68b
otel collector unit tests + networkpolicy file
xBis7 591bba5
values.schema.json cleanup
xBis7 19a8f07
add a minimum to all integer configs in values.schema.json
xBis7 304de3a
fix heading comments
xBis7 1a204a4
change config default to ~ from empty string
xBis7 2ad2c1c
fix static check error
xBis7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| {{/* | ||
| 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. | ||
| */}} | ||
|
|
||
| ########################### | ||
| ## OTel Collector ConfigMap | ||
| ########################### | ||
| {{- if or .Values.otelCollector.tracesEnabled .Values.otelCollector.metricsEnabled }} | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: {{ include "airflow.fullname" . }}-otel-collector | ||
| labels: | ||
| tier: airflow | ||
| component: config | ||
| release: {{ .Release.Name }} | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| heritage: {{ .Release.Service }} | ||
| {{- with .Values.labels }} | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| data: | ||
| config.yml: | | ||
| {{- if .Values.otelCollector.config }} | ||
| {{ tpl .Values.otelCollector.config . | indent 4 }} | ||
| {{- else }} | ||
| extensions: | ||
| health_check: | ||
| endpoint: 0.0.0.0:13133 | ||
|
|
||
| receivers: | ||
| otlp: | ||
| protocols: | ||
| grpc: | ||
| endpoint: 0.0.0.0:{{ .Values.ports.otelCollectorOtlpGrpc }} | ||
| http: | ||
| endpoint: 0.0.0.0:{{ .Values.ports.otelCollectorOtlpHttp }} | ||
|
|
||
| processors: | ||
| batch: {} | ||
|
|
||
| exporters: | ||
| logging: | ||
| verbosity: basic | ||
|
|
||
| service: | ||
| extensions: [health_check] | ||
| pipelines: | ||
| traces: | ||
| receivers: [otlp] | ||
| processors: [batch] | ||
| exporters: [logging] | ||
| metrics: | ||
| receivers: [otlp] | ||
| processors: [batch] | ||
| exporters: [logging] | ||
| {{- end }} | ||
| {{- end }} |
115 changes: 115 additions & 0 deletions
115
chart/templates/otel-collector/otel-collector-deployment.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| {{/* | ||
| 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. | ||
| */}} | ||
|
|
||
| ############################ | ||
| ## OTel Collector Deployment | ||
| ############################ | ||
| {{- if or .Values.otelCollector.tracesEnabled .Values.otelCollector.metricsEnabled }} | ||
| {{- $nodeSelector := or .Values.otelCollector.nodeSelector .Values.nodeSelector }} | ||
| {{- $affinity := or .Values.otelCollector.affinity .Values.affinity }} | ||
| {{- $tolerations := or .Values.otelCollector.tolerations .Values.tolerations }} | ||
| {{- $topologySpreadConstraints := or .Values.otelCollector.topologySpreadConstraints .Values.topologySpreadConstraints }} | ||
| {{- $revisionHistoryLimit := include "airflow.revisionHistoryLimit" (list .Values.otelCollector.revisionHistoryLimit .Values.revisionHistoryLimit) }} | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: {{ include "airflow.fullname" . }}-otel-collector | ||
| labels: | ||
| tier: airflow | ||
| component: otel-collector | ||
| release: {{ .Release.Name }} | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| heritage: {{ .Release.Service }} | ||
| {{- if or .Values.labels .Values.otelCollector.labels }} | ||
| {{- mustMerge .Values.otelCollector.labels .Values.labels | toYaml | nindent 4 }} | ||
| {{- end }} | ||
| {{- with .Values.otelCollector.annotations }} | ||
|
xBis7 marked this conversation as resolved.
|
||
| annotations: {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| replicas: 1 | ||
| {{- if ne $revisionHistoryLimit "" }} | ||
| revisionHistoryLimit: {{ $revisionHistoryLimit }} | ||
| {{- end }} | ||
| selector: | ||
| matchLabels: | ||
| tier: airflow | ||
| component: otel-collector | ||
| release: {{ .Release.Name }} | ||
| template: | ||
| metadata: | ||
| labels: | ||
| tier: airflow | ||
| component: otel-collector | ||
| release: {{ .Release.Name }} | ||
| {{- if or .Values.labels .Values.otelCollector.labels }} | ||
| {{- mustMerge .Values.otelCollector.labels .Values.labels | toYaml | nindent 8 }} | ||
| {{- end }} | ||
| annotations: | ||
| checksum/otel-collector-config: {{ include (print $.Template.BasePath "/configmaps/otel-collector-configmap.yaml") . | sha256sum }} | ||
| {{- with .Values.otelCollector.podAnnotations }} | ||
| {{- tpl (toYaml .) $ | nindent 8 }} | ||
| {{- end }} | ||
| spec: | ||
| nodeSelector: {{- toYaml $nodeSelector | nindent 8 }} | ||
| affinity: {{- toYaml $affinity | nindent 8 }} | ||
| tolerations: {{- toYaml $tolerations | nindent 8 }} | ||
| topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | nindent 8 }} | ||
| terminationGracePeriodSeconds: {{ .Values.otelCollector.terminationGracePeriodSeconds }} | ||
| serviceAccountName: {{ include "otelCollector.serviceAccountName" . }} | ||
| {{- if .Values.otelCollector.priorityClassName }} | ||
| priorityClassName: {{ .Values.otelCollector.priorityClassName }} | ||
| {{- end }} | ||
| restartPolicy: Always | ||
| securityContext: {{- toYaml .Values.otelCollector.securityContexts.pod | nindent 8 }} | ||
|
xBis7 marked this conversation as resolved.
|
||
| containers: | ||
| - name: otel-collector | ||
| image: {{ template "otel_collector_image" . }} | ||
| imagePullPolicy: {{ .Values.images.otelCollector.pullPolicy }} | ||
| securityContext: {{- toYaml .Values.otelCollector.securityContexts.container | nindent 12 }} | ||
| args: {{- tpl (toYaml .Values.otelCollector.args) . | nindent 12 }} | ||
| ports: | ||
| - name: otlp-grpc | ||
| containerPort: {{ .Values.ports.otelCollectorOtlpGrpc }} | ||
| protocol: TCP | ||
| - name: otlp-http | ||
| containerPort: {{ .Values.ports.otelCollectorOtlpHttp }} | ||
| protocol: TCP | ||
| livenessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: 13133 | ||
| initialDelaySeconds: {{ .Values.otelCollector.livenessProbe.initialDelaySeconds }} | ||
| periodSeconds: {{ .Values.otelCollector.livenessProbe.periodSeconds }} | ||
| readinessProbe: | ||
| httpGet: | ||
| path: / | ||
| port: 13133 | ||
| initialDelaySeconds: {{ .Values.otelCollector.readinessProbe.initialDelaySeconds }} | ||
| periodSeconds: {{ .Values.otelCollector.readinessProbe.periodSeconds }} | ||
| resources: {{- toYaml .Values.otelCollector.resources | nindent 12 }} | ||
| volumeMounts: | ||
| - name: config | ||
| mountPath: /etc/otel-collector | ||
| readOnly: true | ||
| volumes: | ||
| - name: config | ||
| configMap: | ||
| name: {{ include "airflow.fullname" . }}-otel-collector | ||
| {{- end }} | ||
59 changes: 59 additions & 0 deletions
59
chart/templates/otel-collector/otel-collector-networkpolicy.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| {{/* | ||
| 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 OTel Collector NetworkPolicy | ||
| ####################################### | ||
| {{- if and .Values.networkPolicies.enabled (or .Values.otelCollector.tracesEnabled .Values.otelCollector.metricsEnabled) }} | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: {{ include "airflow.fullname" . }}-otel-collector-policy | ||
| labels: | ||
| tier: airflow | ||
| component: otel-collector-policy | ||
| release: {{ .Release.Name }} | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| heritage: {{ .Release.Service }} | ||
| {{- if or .Values.labels .Values.otelCollector.labels }} | ||
| {{- mustMerge .Values.otelCollector.labels .Values.labels | toYaml | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| tier: airflow | ||
| component: otel-collector | ||
| release: {{ .Release.Name }} | ||
| policyTypes: | ||
| - Ingress | ||
| ingress: | ||
| - from: | ||
| - podSelector: | ||
| matchLabels: | ||
| tier: airflow | ||
| release: {{ .Release.Name }} | ||
| {{- if .Values.otelCollector.extraNetworkPolicies }} | ||
| {{- toYaml .Values.otelCollector.extraNetworkPolicies | nindent 4 }} | ||
| {{- end }} | ||
| ports: | ||
| - protocol: TCP | ||
| port: {{ .Values.ports.otelCollectorOtlpHttp }} | ||
| - protocol: TCP | ||
| port: {{ .Values.ports.otelCollectorOtlpGrpc }} | ||
| {{- end }} |
55 changes: 55 additions & 0 deletions
55
chart/templates/otel-collector/otel-collector-service.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| {{/* | ||
| 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. | ||
| */}} | ||
|
|
||
| ######################### | ||
| ## OTel Collector Service | ||
| ######################### | ||
| {{- if or .Values.otelCollector.tracesEnabled .Values.otelCollector.metricsEnabled }} | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: {{ include "airflow.fullname" . }}-otel-collector | ||
| labels: | ||
| tier: airflow | ||
| component: otel-collector | ||
| release: {{ .Release.Name }} | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| heritage: {{ .Release.Service }} | ||
| {{- if or .Values.labels .Values.otelCollector.labels }} | ||
| {{- mustMerge .Values.otelCollector.labels .Values.labels | toYaml | nindent 4 }} | ||
| {{- end }} | ||
| {{- with .Values.otelCollector.service.annotations }} | ||
| annotations: {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| type: ClusterIP | ||
| selector: | ||
| tier: airflow | ||
| component: otel-collector | ||
| release: {{ .Release.Name }} | ||
| ports: | ||
| - name: otlp-grpc | ||
| protocol: TCP | ||
| port: {{ .Values.ports.otelCollectorOtlpGrpc }} | ||
| targetPort: {{ .Values.ports.otelCollectorOtlpGrpc }} | ||
| - name: otlp-http | ||
| protocol: TCP | ||
| port: {{ .Values.ports.otelCollectorOtlpHttp }} | ||
| targetPort: {{ .Values.ports.otelCollectorOtlpHttp }} | ||
| {{- end }} |
41 changes: 41 additions & 0 deletions
41
chart/templates/otel-collector/otel-collector-serviceaccount.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| {{/* | ||
| 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 OTel Collector ServiceAccount | ||
| ######################################## | ||
| {{- if and (or .Values.otelCollector.tracesEnabled .Values.otelCollector.metricsEnabled) .Values.otelCollector.serviceAccount.create }} | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| automountServiceAccountToken: {{ .Values.otelCollector.serviceAccount.automountServiceAccountToken }} | ||
| metadata: | ||
| name: {{ include "otelCollector.serviceAccountName" . }} | ||
| labels: | ||
| tier: airflow | ||
| component: otel-collector | ||
| release: {{ .Release.Name }} | ||
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
| heritage: {{ .Release.Service }} | ||
| {{- if or .Values.labels .Values.otelCollector.labels }} | ||
| {{- mustMerge .Values.otelCollector.labels .Values.labels | toYaml | nindent 4 }} | ||
| {{- end }} | ||
| {{- with .Values.otelCollector.serviceAccount.annotations }} | ||
| annotations: {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| {{- end }} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.