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
1 change: 1 addition & 0 deletions chart/templates/cleanup/cleanup-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{{- if and .Values.cleanup.serviceAccount.create .Values.cleanup.enabled }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.cleanup.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "cleanup.serviceAccountName" . }}
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
{{- if and .Values.dagProcessor.serviceAccount.create .Values.dagProcessor.enabled }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.dagProcessor.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "dagProcessor.serviceAccountName" . }}
labels:
Expand Down
1 change: 1 addition & 0 deletions chart/templates/flower/flower-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{{- if and .Values.flower.enabled (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) .Values.flower.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.flower.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "flower.serviceAccountName" . }}
labels:
Expand Down
1 change: 1 addition & 0 deletions chart/templates/jobs/create-user-job-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{{- if and .Values.createUserJob.serviceAccount.create .Values.webserver.defaultUser.enabled }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.createUserJob.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "createUserJob.serviceAccountName" . }}
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{{- if .Values.migrateDatabaseJob.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.migrateDatabaseJob.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "migrateDatabaseJob.serviceAccountName" . }}
labels:
Expand Down
1 change: 1 addition & 0 deletions chart/templates/pgbouncer/pgbouncer-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{{- if and .Values.pgbouncer.serviceAccount.create .Values.pgbouncer.enabled }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.pgbouncer.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "pgbouncer.serviceAccountName" . }}
labels:
Expand Down
1 change: 1 addition & 0 deletions chart/templates/redis/redis-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{{- if and .Values.redis.enabled .Values.redis.serviceAccount.create (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor")) }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.redis.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "redis.serviceAccountName" . }}
labels:
Expand Down
1 change: 1 addition & 0 deletions chart/templates/scheduler/scheduler-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{{- if .Values.scheduler.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.scheduler.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "scheduler.serviceAccountName" . }}
labels:
Expand Down
1 change: 1 addition & 0 deletions chart/templates/statsd/statsd-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{{- if and .Values.statsd.enabled .Values.statsd.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.statsd.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "statsd.serviceAccountName" . }}
labels:
Expand Down
1 change: 1 addition & 0 deletions chart/templates/triggerer/triggerer-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
{{- if and .Values.triggerer.serviceAccount.create .Values.triggerer.enabled }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.triggerer.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "triggerer.serviceAccountName" . }}
labels:
Expand Down
1 change: 1 addition & 0 deletions chart/templates/webserver/webserver-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{{- if .Values.webserver.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.webserver.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "webserver.serviceAccountName" . }}
labels:
Expand Down
1 change: 1 addition & 0 deletions chart/templates/workers/worker-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{{- if and .Values.workers.serviceAccount.create (or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") (eq .Values.executor "KubernetesExecutor") (eq .Values.executor "LocalKubernetesExecutor")) }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.workers.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "worker.serviceAccountName" . }}
labels:
Expand Down
60 changes: 60 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,11 @@
"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",
Expand Down Expand Up @@ -2015,6 +2020,11 @@
"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",
Expand Down Expand Up @@ -2444,6 +2454,11 @@
"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",
Expand Down Expand Up @@ -2873,6 +2888,11 @@
"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",
Expand Down Expand Up @@ -3221,6 +3241,11 @@
"type": "object",
"additionalProperties": false,
"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",
Expand Down Expand Up @@ -3467,6 +3492,11 @@
"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",
Expand Down Expand Up @@ -3784,6 +3814,11 @@
"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",
Expand Down Expand Up @@ -4514,6 +4549,11 @@
"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",
Expand Down Expand Up @@ -4765,6 +4805,11 @@
"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",
Expand Down Expand Up @@ -5249,6 +5294,11 @@
"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",
Expand Down Expand Up @@ -5548,6 +5598,11 @@
"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",
Expand Down Expand Up @@ -5950,6 +6005,11 @@
"type": "object",
"additionalProperties": false,
"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",
Expand Down
36 changes: 36 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ workers:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -750,6 +753,9 @@ scheduler:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -905,6 +911,9 @@ createUserJob:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -985,6 +994,9 @@ migrateDatabaseJob:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -1066,6 +1078,9 @@ webserver:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -1259,6 +1274,9 @@ triggerer:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -1412,6 +1430,9 @@ dagProcessor:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -1563,6 +1584,9 @@ flower:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -1645,6 +1669,9 @@ statsd:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -1723,6 +1750,9 @@ pgbouncer:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -1867,6 +1897,9 @@ redis:

# Create ServiceAccount
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.
Expand Down Expand Up @@ -2010,6 +2043,9 @@ cleanup:

# Create ServiceAccount
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.
Expand Down
20 changes: 20 additions & 0 deletions helm_tests/airflow_aux/test_cleanup_pods.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,23 @@ def test_should_add_component_specific_labels(self):

assert "test_label" in jmespath.search("metadata.labels", docs[0])
assert jmespath.search("metadata.labels", docs[0])["test_label"] == "test_label_value"

def test_default_automount_service_account_token(self):
docs = render_chart(
values={
"cleanup": {
"enabled": True,
},
},
show_only=["templates/cleanup/cleanup-serviceaccount.yaml"],
)
assert jmespath.search("automountServiceAccountToken", docs[0]) is True

def test_overriden_automount_service_account_token(self):
docs = render_chart(
values={
"cleanup": {"enabled": True, "serviceAccount": {"automountServiceAccountToken": False}},
},
show_only=["templates/cleanup/cleanup-serviceaccount.yaml"],
)
assert jmespath.search("automountServiceAccountToken", docs[0]) is False
Loading