opendatahub-io-contrib / airflow-on-openshift

Deploy Airflow onto OpenShift with Helm
7 stars 15 forks source link
airflow data-science helm helm-chart helm-charts kubernetes odh opendatahub openshift

Airflow on OpenShift

Deploy Airflow on OpenShift via Helm

Table of Contents

Requirements

Compatibility

Tested with:

Install

Quickstart

scripts/easy_install.sh

Install Airflow via helm

# add helm repo
helm repo add apache-airflow https://airflow.apache.org

# get project
PROJECT=$(oc project -q)

# get openshift uid/gid range
CHART_UID=$(oc get project ${PROJECT} -o jsonpath="{['metadata.annotations.openshift\.io/sa\.scc\.uid-range']}" | sed "s@/.*@@")
CHART_GID=$(oc get project ${PROJECT} -o jsonpath="{['metadata.annotations.openshift\.io/sa\.scc\.supplemental-groups']}" | sed "s@/.*@@")

echo "UID/GID: ${CHART_UID}/${CHART_GID}"

# copy and edit values.yaml
cp example_values.yaml values.yaml

# edit values.yaml

# install via helm
helm upgrade \
    --install airflow apache-airflow/airflow \
    --namespace ${PROJECT} \
    --version 1.10.0 \
    --set uid=${CHART_UID} \
    --set gid=${CHART_GID} \
    --set redis.securityContext.runAsUser=${CHART_UID} \
    --values ./values.yaml

Create Routes

# create route for airflow
oc create route edge \
    --service=airflow-webserver \
    --insecure-policy=Redirect \
    --port=8080

# create route for airflow flower
oc create route edge \
    --service=airflow-flower \
    --insecure-policy=Redirect \
    --port=5555

# confirm routes
oc get routes

References