DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
We defer the following goals to a future design:
Dynamic service account binding during task execution.
Revoking a service account in the middle of task execution.
ACL support around service accounts (e.g., which group of workflow/dag users can access a particular service account).
High-Level Overview
KubernetesExecutor
Config
The KubernetesExecutor config is extended to include the list of service accounts used:
[kubernetes] gcp_service_accounts=key_name1=key_path1,key_name2=key_path2,key_name3=key_path3 |
|---|
Where key_name is service account ID (e.g., service-account@xxx.iam.gserviceaccount.com) and the key_path saves the service account key file location accessible from the KubernetesExecutor.
Setup
When the Airflow Scheduler and KubernetesExecutor are initialized, the following steps related to service account management are executed:
- Read gcp_service_accounts config and inject these service accounts into Kubernetes cluster as secrets:
kubectl create secret generic service-account-name --from-file=key.json=<PATH-TO-KEY-FILE>.json - Start the service account initializer controller (the controller code will check for uninitialized pod object, modify the Pod manifest to include service account volumes|volumeMounts|GOOGLE_APPLICATION_CREDENTIALS ENV so that k8s master will schedule the Pod):
kubectl create -f initializer-controller-deployment.yaml - Create the service account initializer config:
apiVersion: admissionregistration.k8s.io/v1alpha1
kind: InitializerConfiguration
Metadata:
name: example-service-account-config
initializers:
- name: serviceaccounts.google.com
rules:
- apiGroups:
- ""
apiVersions:
- v1
resources:
- pods