Last active
December 10, 2021 05:28
-
-
Save csm10495/8d6db5cffe8f97e523ca05fb5d5dd55f to your computer and use it in GitHub Desktop.
Airflow from helm simple example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import os | |
import subprocess | |
def run_command(cmd): | |
print (f">{cmd}") | |
ret_code = subprocess.call(cmd, shell=True) | |
print (f'>> Return Code: {ret_code}') | |
return ret_code | |
def get_fernet_key(): | |
return base64.urlsafe_b64encode(os.urandom(32)).decode() | |
def main(): | |
run_command(f'''helm install airflow apache-airflow/airflow --namespace airflow \ | |
--set fernetKey={get_fernet_key()} | |
--set executor="KubernetesExecutor" | |
--set dags.gitSync.depth=1 | |
--set dags.persistence.enabled=true | |
--set logs.persistence.enabled=true | |
--set dags.gitSync.enabled=true | |
--set dags.gitSync.repo="https://github.com/apache/airflow.git" | |
--set dags.gitSync.subPath="airflow/example_dags" | |
--set dags.gitSync.rev="HEAD" | |
'''.replace("\n", " ")) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment