Deploy Airflow on OpenShift via Helm
Tested with:
- Airflow 2.6.2 - 2.7.0
- OpenShift 4.11+
- Helm chart 1.10.0
scripts/easy_install.sh
# 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 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