3
1

More than 5 years have passed since last update.

最小構成の Airflow を GKE に deploy する

Last updated at Posted at 2019-02-25

はじめに

参考とする実装

  • metabase-gke で GKE への deploy 実績があるのでこれを参考にする

Kubernetes の設定の examples

Deployment、Service、Ingress

  • この辺の構成を理解していないと設定ファイルの書き方に迷う

Deployment

DeploymentはReplicaSetを生成・管理し、ReplicaSetはPodを生成・管理します。

ReplicaSet(ReplicationControllerの後継)はPodTemplateと呼ばれるPodのテンプレートをもとに、Podを指定された数(レプリカ数)に調整・管理を行う仕組みです。

Service

Pod,Nodeの存在を抽象化し、Podとの通信に単一のエンドポイントを提供するのがServiceの主な役割になります。

Ingress

ingressはHTTPSレイヤーのロードバランサーであり、

  • IP管理などを個別のserviceではなくingressで管理できる
  • Googleが推奨している

Ingress の導入

aiflow の場合 /admin/ がルートになるので readinessProbe で health check のパスを変更しておく

初回の証明書取得

  • Let's Encrypt 側でエンドポイントを確認できるまでは証明書が取得できないので、一旦 http で証明書を取得してから https に移行する

Reverse Proxy (Ingress) 内での Airflow の設定

  • 環境変数 AIRFLOW__WEBSERVER__ENABLE_PROXY_FIXTrue を設定する

実装

Ingress のトラブルシューティング

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1