Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions chart/files/pod-template-file.kubernetes-helm-yaml
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,7 @@ spec:
terminationGracePeriodSeconds: {{ .Values.workers.terminationGracePeriodSeconds }}
tolerations: {{- toYaml $tolerations | nindent 4 }}
topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | nindent 4 }}
{{- if .Values.workers.useWorkerDedicatedServiceAccounts }}
serviceAccountName: {{ include "worker.kubernetes.serviceAccountName" . }}
{{- else }}
serviceAccountName: {{ include "worker.serviceAccountName" . }}
{{- end }}
volumes:
{{- if .Values.dags.persistence.enabled }}
- name: dags
Expand Down
1 change: 0 additions & 1 deletion chart/newsfragments/52357.improvement.rst

This file was deleted.

30 changes: 5 additions & 25 deletions chart/templates/_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -658,23 +658,13 @@ server_tls_key_file = /etc/pgbouncer/server.key
{{- end }}
{{- end }}

{{/* Helper for service account name generation */}}
{{- define "_serviceAccountNameGen" -}}
{{- if .sa.create }}
{{- default (printf "%s-%s" (include "airflow.serviceAccountName" .) (default .key .nameSuffix )) .sa.name | quote }}
{{- else }}
{{- default "default" .sa.name | quote }}
{{- end }}
{{- end }}

{{/* Helper to generate service account name respecting .Values.$section.serviceAccount or .Values.$section.$subSection.serviceAccount flags */}}
{{/* Helper to generate service account name respecting .Values.$section.serviceAccount flags */}}
{{- define "_serviceAccountName" -}}
{{- if .subKey }}
{{- $sa := get (get (get .Values .key) .subKey) "serviceAccount" -}}
{{- include "_serviceAccountNameGen" (merge (dict "sa" $sa "key" .key "nameSuffix" .nameSuffix) .) }}
{{- $sa := get (get .Values .key) "serviceAccount" }}
{{- if $sa.create }}
{{- default (printf "%s-%s" (include "airflow.serviceAccountName" .) (default .key .nameSuffix )) $sa.name | quote }}
{{- else }}
{{- $sa := get (get .Values .key) "serviceAccount" }}
{{- include "_serviceAccountNameGen" (merge (dict "sa" $sa "key" .key "nameSuffix" .nameSuffix) .) }}
{{- default "default" $sa.name | quote }}
{{- end }}
{{- end }}

Expand Down Expand Up @@ -724,16 +714,6 @@ server_tls_key_file = /etc/pgbouncer/server.key
{{- include "_serviceAccountName" (merge (dict "key" "workers" "nameSuffix" "worker") .) -}}
{{- end }}

{{/* Create the name of the worker celery service account to use */}}
{{- define "worker.celery.serviceAccountName" -}}
{{- include "_serviceAccountName" (merge (dict "key" "workers" "subKey" "celery" "nameSuffix" "worker-celery") .) -}}
{{- end }}

{{/* Create the name of the worker kubernetes service account to use */}}
{{- define "worker.kubernetes.serviceAccountName" -}}
{{- include "_serviceAccountName" (merge (dict "key" "workers" "subKey" "kubernetes" "nameSuffix" "worker-kubernetes") .) -}}
{{- end }}

{{/* Create the name of the triggerer service account to use */}}
{{- define "triggerer.serviceAccountName" -}}
{{- include "_serviceAccountName" (merge (dict "key" "triggerer") .) -}}
Expand Down
10 changes: 0 additions & 10 deletions chart/templates/rbac/pod-launcher-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,14 @@ subjects:
{{- end }}
{{- end }}
{{- $workerAdded := false }}
{{- $workersDedicatedSA := .Values.workers.useWorkerDedicatedServiceAccounts -}}
{{- range $executor := $executors }}
{{- if and (has $executor $workerLaunchExecutors) (not $workerAdded) }}
{{- $workerAdded = true }}
{{- if $workersDedicatedSA }}
- kind: ServiceAccount
name: {{ include "worker.celery.serviceAccountName" $ }}
namespace: "{{ $.Release.Namespace }}"
- kind: ServiceAccount
name: {{ include "worker.kubernetes.serviceAccountName" $ }}
namespace: "{{ $.Release.Namespace }}"
{{- else }}
- kind: ServiceAccount
name: {{ include "worker.serviceAccountName" $ }}
namespace: "{{ $.Release.Namespace }}"
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.triggerer.enabled }}
- kind: ServiceAccount
name: {{ include "triggerer.serviceAccountName" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,10 @@ subjects:
name: {{ include "webserver.serviceAccountName" . }}
namespace: "{{ .Release.Namespace }}"
{{- if $hasWorkers }}
{{- if .Values.workers.useWorkerDedicatedServiceAccounts }}
- kind: ServiceAccount
name: {{ include "worker.celery.serviceAccountName" . }}
namespace: "{{ .Release.Namespace }}"
- kind: ServiceAccount
name: {{ include "worker.kubernetes.serviceAccountName" . }}
namespace: "{{ .Release.Namespace }}"
{{- else }}
- kind: ServiceAccount
name: {{ include "worker.serviceAccountName" . }}
namespace: "{{ .Release.Namespace }}"
{{- end }}
{{- end }}
- kind: ServiceAccount
name: {{ include "scheduler.serviceAccountName" . }}
namespace: "{{ .Release.Namespace }}"
Expand Down
41 changes: 0 additions & 41 deletions chart/templates/workers/worker-celery-serviceaccount.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions chart/templates/workers/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,7 @@ spec:
{{- end }}
terminationGracePeriodSeconds: {{ .Values.workers.terminationGracePeriodSeconds }}
restartPolicy: Always
{{- if .Values.workers.useWorkerDedicatedServiceAccounts }}
serviceAccountName: {{ include "worker.celery.serviceAccountName" . }}
{{- else }}
serviceAccountName: {{ include "worker.serviceAccountName" . }}
{{- end }}
securityContext: {{ $securityContext | nindent 8 }}
imagePullSecrets: {{ include "image_pull_secrets" . | nindent 8 }}
initContainers:
Expand Down
41 changes: 0 additions & 41 deletions chart/templates/workers/worker-kubernetes-serviceaccount.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion chart/templates/workers/worker-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
################################
## Airflow Worker ServiceAccount
#################################
{{- if and .Values.workers.serviceAccount.create (not .Values.workers.useWorkerDedicatedServiceAccounts) (include "airflow.podLaunchingExecutor" .) }}
{{- if and .Values.workers.serviceAccount.create (include "airflow.podLaunchingExecutor" .) }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.workers.serviceAccount.automountServiceAccountToken }}
Expand Down
69 changes: 0 additions & 69 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2691,11 +2691,6 @@
}
]
},
"useWorkerDedicatedServiceAccounts": {
"description": "One common Service Account for all workers will be created if flag is set to false. If true, dedicated Service Accounts for every worker type will be created.",
"type": "boolean",
"default": false
},
"celery": {
"description": "Airflow Celery Workers configuration.",
"type": "object",
Expand Down Expand Up @@ -2861,38 +2856,6 @@
}
}
},
"serviceAccount": {
"description": "Create ServiceAccount.",
"type": "object",
"properties": {
"automountServiceAccountToken": {
"description": "Specifies if ServiceAccount's API credentials should be mounted onto Pods.",
"type": "boolean",
"default": true
},
"create": {
"description": "Specifies whether a ServiceAccount should be created.",
"type": "boolean",
"default": true
},
"name": {
"description": "The name of the ServiceAccount to use. If not set and create is true, a name is generated using the release name.",
"type": [
"string",
"null"
],
"default": null
},
"annotations": {
"description": "Annotations to add to the Airflow Celery worker Kubernetes ServiceAccount.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
}
}
},
"persistence": {
"description": "Persistence configuration for Airflow Celery workers.",
"type": "object",
Expand Down Expand Up @@ -3095,38 +3058,6 @@
]
}
}
},
"serviceAccount": {
"description": "Create ServiceAccount.",
"type": "object",
"properties": {
"automountServiceAccountToken": {
"description": "Specifies if ServiceAccount's API credentials should be mounted onto Pods.",
"type": "boolean",
"default": true
},
"create": {
"description": "Specifies whether a ServiceAccount should be created.",
"type": "boolean",
"default": true
},
"name": {
"description": "The name of the ServiceAccount to use. If not set and create is true, a name is generated using the release name.",
"type": [
"string",
"null"
],
"default": null
},
"annotations": {
"description": "Annotations to add to the worker Kubernetes ServiceAccount.",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
Expand Down
30 changes: 0 additions & 30 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1043,10 +1043,6 @@ workers:
# requests:
# storage: "20Gi"

# One common Service Account for all workers will be created if flag is set to false.
# If true, dedicated Service Accounts for every worker type will be created.
useWorkerDedicatedServiceAccounts: false

celery:
# Number of Airflow Celery workers
replicas: 1
Expand Down Expand Up @@ -1120,19 +1116,6 @@ workers:
pod: {}
container: {}

# Create ServiceAccount for Airflow Celery workers
serviceAccount:
# default value is true
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
automountServiceAccountToken: true
# Specifies whether a ServiceAccount should be created
create: true
# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the release name
name: ~
# Annotations to add to worker kubernetes service account.
annotations: {}

# Persistence volume configuration for Airflow Celery workers
persistence:
# Enable persistent volumes
Expand Down Expand Up @@ -1191,19 +1174,6 @@ workers:
pod: {}
container: {}

# Create ServiceAccount for pods created with pod-template-file
serviceAccount:
# Auto mount service account token into the pod. Default value is true.
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
automountServiceAccountToken: true
# Specifies whether a ServiceAccount should be created
create: true
# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the release name.
name: ~
# Annotations to add to worker kubernetes service account
annotations: {}

# Airflow scheduler settings
scheduler:
enabled: true
Expand Down
Loading
Loading