디렉토리 구조 및 각 서비스 추가
This commit is contained in:
141
helm/airflow/files/pod-template-file.kubernetes-helm-yaml
Normal file
141
helm/airflow/files/pod-template-file.kubernetes-helm-yaml
Normal file
@@ -0,0 +1,141 @@
|
||||
{{/*
|
||||
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.
|
||||
*/}}
|
||||
---
|
||||
{{- $nodeSelector := or .Values.workers.nodeSelector .Values.nodeSelector }}
|
||||
{{- $affinity := or .Values.workers.affinity .Values.affinity }}
|
||||
{{- $tolerations := or .Values.workers.tolerations .Values.tolerations }}
|
||||
{{- $topologySpreadConstraints := or .Values.workers.topologySpreadConstraints .Values.topologySpreadConstraints }}
|
||||
{{- $securityContext := include "airflowPodSecurityContext" (list . .Values.workers) }}
|
||||
{{- $containerSecurityContext := include "containerSecurityContext" (list . .Values.workers) }}
|
||||
{{- $containerLifecycleHooks := or .Values.workers.containerLifecycleHooks .Values.containerLifecycleHooks }}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: placeholder-name
|
||||
labels:
|
||||
tier: airflow
|
||||
component: worker
|
||||
release: {{ .Release.Name }}
|
||||
{{- if or (.Values.labels) (.Values.workers.labels) }}
|
||||
{{- mustMerge .Values.workers.labels .Values.labels | toYaml | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.airflowPodAnnotations .Values.workers.podAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.airflowPodAnnotations }}
|
||||
{{- toYaml .Values.airflowPodAnnotations | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.workers.podAnnotations }}
|
||||
{{- toYaml .Values.workers.podAnnotations | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if or (and .Values.dags.gitSync.enabled (not .Values.dags.persistence.enabled)) .Values.workers.extraInitContainers }}
|
||||
initContainers:
|
||||
{{- if and .Values.dags.gitSync.enabled (not .Values.dags.persistence.enabled) }}
|
||||
{{- include "git_sync_container" (dict "Values" .Values "is_init" "true" "Template" .Template) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.workers.extraInitContainers }}
|
||||
{{- toYaml .Values.workers.extraInitContainers | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- envFrom: {{- include "custom_airflow_environment_from" . | default "\n []" | indent 6 }}
|
||||
env:
|
||||
- name: AIRFLOW__CORE__EXECUTOR
|
||||
value: LocalExecutor
|
||||
{{- include "standard_airflow_environment" . | indent 6}}
|
||||
{{- include "custom_airflow_environment" . | indent 6 }}
|
||||
{{- include "container_extra_envs" (list . .Values.workers.env) | indent 6 }}
|
||||
image: {{ template "pod_template_image" . }}
|
||||
imagePullPolicy: {{ .Values.images.pod_template.pullPolicy }}
|
||||
securityContext: {{ $containerSecurityContext | nindent 8 }}
|
||||
{{- if $containerLifecycleHooks }}
|
||||
lifecycle: {{- tpl (toYaml $containerLifecycleHooks) . | nindent 8 }}
|
||||
{{- end }}
|
||||
name: base
|
||||
resources: {{- toYaml .Values.workers.resources | nindent 8 }}
|
||||
volumeMounts:
|
||||
- mountPath: {{ template "airflow_logs" . }}
|
||||
name: logs
|
||||
{{- include "airflow_config_mount" . | nindent 8 }}
|
||||
{{- if or .Values.dags.gitSync.enabled .Values.dags.persistence.enabled }}
|
||||
{{- include "airflow_dags_mount" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.volumeMounts }}
|
||||
{{- toYaml .Values.volumeMounts | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.workers.extraVolumeMounts }}
|
||||
{{- tpl (toYaml .Values.workers.extraVolumeMounts) . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.workers.extraContainers }}
|
||||
{{- toYaml .Values.workers.extraContainers | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.workers.priorityClassName }}
|
||||
priorityClassName: {{ .Values.workers.priorityClassName }}
|
||||
{{- end }}
|
||||
{{- if .Values.workers.runtimeClassName }}
|
||||
priorityClassName: {{ .Values.workers.runtimeClassName }}
|
||||
{{- end }}
|
||||
{{- if or .Values.registry.secretName .Values.registry.connection }}
|
||||
imagePullSecrets:
|
||||
- name: {{ template "registry_secret" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.workers.hostAliases }}
|
||||
hostAliases: {{- toYaml .Values.workers.hostAliases | nindent 4 }}
|
||||
{{- end }}
|
||||
restartPolicy: Never
|
||||
securityContext: {{ $securityContext | nindent 4 }}
|
||||
nodeSelector: {{- toYaml $nodeSelector | nindent 4 }}
|
||||
affinity: {{- toYaml $affinity | nindent 4 }}
|
||||
{{- if .Values.schedulerName }}
|
||||
schedulerName: {{ .Values.schedulerName }}
|
||||
{{- end }}
|
||||
terminationGracePeriodSeconds: {{ .Values.workers.terminationGracePeriodSeconds }}
|
||||
tolerations: {{- toYaml $tolerations | nindent 4 }}
|
||||
topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | nindent 4 }}
|
||||
serviceAccountName: {{ include "worker.serviceAccountName" . }}
|
||||
volumes:
|
||||
{{- if .Values.dags.persistence.enabled }}
|
||||
- name: dags
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ template "airflow_dags_volume_claim" . }}
|
||||
{{- else if .Values.dags.gitSync.enabled }}
|
||||
- name: dags
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.logs.persistence.enabled }}
|
||||
- name: logs
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ template "airflow_logs_volume_claim" . }}
|
||||
{{- else }}
|
||||
- emptyDir: {}
|
||||
name: logs
|
||||
{{- end }}
|
||||
{{- if and .Values.dags.gitSync.enabled .Values.dags.gitSync.sshKeySecret }}
|
||||
{{- include "git_sync_ssh_key_volume" . | nindent 2 }}
|
||||
{{- end }}
|
||||
- configMap:
|
||||
name: {{ include "airflow_config" . }}
|
||||
name: config
|
||||
{{- if .Values.volumes }}
|
||||
{{- toYaml .Values.volumes | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- if .Values.workers.extraVolumes }}
|
||||
{{- tpl (toYaml .Values.workers.extraVolumes) . | nindent 2 }}
|
||||
{{- end }}
|
||||
87
helm/airflow/files/statsd-mappings.yml
Normal file
87
helm/airflow/files/statsd-mappings.yml
Normal file
@@ -0,0 +1,87 @@
|
||||
# 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.
|
||||
---
|
||||
mappings:
|
||||
# Map dot separated stats to labels
|
||||
- match: airflow.dagrun.dependency-check.*.*
|
||||
name: "airflow_dagrun_dependency_check"
|
||||
labels:
|
||||
dag_id: "$1"
|
||||
|
||||
- match: airflow.operator_successes_(.*)
|
||||
match_type: regex
|
||||
name: "airflow_operator_successes"
|
||||
labels:
|
||||
operator: "$1"
|
||||
|
||||
- match: airflow.operator_failures_(.*)
|
||||
match_type: regex
|
||||
name: "airflow_operator_failures"
|
||||
labels:
|
||||
operator: "$1"
|
||||
|
||||
- match: airflow.scheduler_heartbeat
|
||||
match_type: regex
|
||||
name: "airflow_scheduler_heartbeat"
|
||||
labels:
|
||||
type: counter
|
||||
|
||||
- match: airflow.dag.*.*.duration
|
||||
name: "airflow_task_duration"
|
||||
labels:
|
||||
dag_id: "$1"
|
||||
task_id: "$2"
|
||||
|
||||
- match: airflow.dagrun.duration.success.*
|
||||
name: "airflow_dagrun_duration"
|
||||
labels:
|
||||
dag_id: "$1"
|
||||
|
||||
- match: airflow.dagrun.duration.failed.*
|
||||
name: "airflow_dagrun_failed"
|
||||
labels:
|
||||
dag_id: "$1"
|
||||
|
||||
- match: airflow.dagrun.schedule_delay.*
|
||||
name: "airflow_dagrun_schedule_delay"
|
||||
labels:
|
||||
dag_id: "$1"
|
||||
|
||||
- match: airflow.dag_processing.last_runtime.*
|
||||
name: "airflow_dag_processing_last_runtime"
|
||||
labels:
|
||||
dag_file: "$1"
|
||||
|
||||
- match: airflow.dag_processing.last_run.seconds_ago.*
|
||||
name: "airflow_dag_processing_last_run_seconds_ago"
|
||||
labels:
|
||||
dag_file: "$1"
|
||||
|
||||
- match: airflow.pool.open_slots.*
|
||||
name: "airflow_pool_open_slots"
|
||||
labels:
|
||||
pool: "$1"
|
||||
|
||||
- match: airflow.pool.used_slots.*
|
||||
name: "airflow_pool_used_slots"
|
||||
labels:
|
||||
pool: "$1"
|
||||
|
||||
- match: airflow.pool.starving_tasks.*
|
||||
name: "airflow_pool_starving_tasks"
|
||||
labels:
|
||||
pool: "$1"
|
||||
Reference in New Issue
Block a user