Viento
Viento

Reputation: 119

Retrieve Kubernetes' Secret from Google Composer (Airflow)

I have an Apache Airflow working on Kubernetes (via Google Composer). I want to retrieve one variable store in Secret:

enter image description here

I need to consume the variables stored in this Secret from a DAG in Airflow.(python).

Upvotes: 2

Views: 950

Answers (1)

Viento
Viento

Reputation: 119

The variables are stored as "Environment Vars", so in Python is quite easy:

import os
os.environ['DB_USER'])

Upvotes: 1

Related Questions