File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 38
38
secret = 'airflow-secrets' ,
39
39
# Key of a secret stored in this Secret object
40
40
key = 'sql_alchemy_conn' )
41
+ secret_volume = secret .Secret (
42
+ 'volume' ,
43
+ # Path where we mount the secret as volume
44
+ '/var/secrets/google' ,
45
+ # Name of Kubernetes Secret
46
+ 'service-account' ,
47
+ # Key in the form of service account file name
48
+ 'service-account.json' )
41
49
# [END composer_kubernetespodoperator_secretobject]
42
50
43
51
YESTERDAY = datetime .datetime .now () - datetime .timedelta (days = 1 )
118
126
startup_timeout_seconds = 300 ,
119
127
# The secrets to pass to Pod, the Pod will fail to create if the
120
128
# secrets you specify in a Secret object do not exist in Kubernetes.
121
- secrets = [secret_env ],
129
+ secrets = [secret_env , secret_volume ],
122
130
# env_vars allows you to specify environment variables for your
123
131
# container to use. env_vars is templated.
124
- env_vars = {'EXAMPLE_VAR' : '/example/value' })
132
+ env_vars = {
133
+ 'EXAMPLE_VAR' : '/example/value' ,
134
+ 'GOOGLE_APPLICATION_CREDENTIALS' : '/var/secrets/google/service-account.json' })
125
135
# [END composer_kubernetespodoperator_secretconfig]
126
136
# [START composer_kubernetespodaffinity]
127
137
kubernetes_affinity_ex = kubernetes_pod_operator .KubernetesPodOperator (
You can’t perform that action at this time.
0 commit comments