Browse Source

Move Shipyard Chart

This PS migrates the Shipyard Chart into this repo

Change-Id: I2cf037ab662886a94c8439f43d248da9295a83b3
changes/87/569187/1
Anthony Lin 5 years ago
parent
commit
b002bd58fd
  1. 22
      charts/.helmignore
  2. 29
      charts/shipyard/Chart.yaml
  3. 18
      charts/shipyard/requirements.yaml
  4. 49
      charts/shipyard/templates/bin/_airflow-db-init.sh.tpl
  5. 21
      charts/shipyard/templates/bin/_airflow-db-sync.sh.tpl
  6. 22
      charts/shipyard/templates/bin/_airflow-shipyard-init.sh.tpl
  7. 54
      charts/shipyard/templates/bin/_shipyard-db-init.sh.tpl
  8. 19
      charts/shipyard/templates/bin/_shipyard-db-sync.sh.tpl
  9. 27
      charts/shipyard/templates/configmap-airflow-bin.yaml
  10. 59
      charts/shipyard/templates/configmap-airflow-etc.yaml
  11. 32
      charts/shipyard/templates/configmap-shipyard-bin.yaml
  12. 105
      charts/shipyard/templates/configmap-shipyard-etc.yaml
  13. 69
      charts/shipyard/templates/deployment-airflow-flower.yaml
  14. 127
      charts/shipyard/templates/deployment-airflow-scheduler.yaml
  15. 131
      charts/shipyard/templates/deployment-airflow-web.yaml
  16. 145
      charts/shipyard/templates/deployment-airflow-worker.yaml
  17. 76
      charts/shipyard/templates/deployment-shipyard.yaml
  18. 371
      charts/shipyard/templates/etc/_airflow.cfg.tpl
  19. 25
      charts/shipyard/templates/etc/_api-paste.ini.tpl
  20. 40
      charts/shipyard/templates/etc/_policy.yaml.tpl
  21. 375
      charts/shipyard/templates/etc/_shipyard.conf.tpl
  22. 47
      charts/shipyard/templates/ingress-airflow-api.yaml
  23. 47
      charts/shipyard/templates/ingress-shipyard-api.yaml
  24. 81
      charts/shipyard/templates/job-airflow-db-init.yaml
  25. 61
      charts/shipyard/templates/job-airflow-db-sync.yaml
  26. 65
      charts/shipyard/templates/job-ks-endpoints.yaml
  27. 60
      charts/shipyard/templates/job-ks-service.yaml
  28. 61
      charts/shipyard/templates/job-ks-user.yaml
  29. 83
      charts/shipyard/templates/job-shipyard-db-init.yaml
  30. 79
      charts/shipyard/templates/job-shipyard-db-sync.yaml
  31. 30
      charts/shipyard/templates/secret-airflow-db.yaml
  32. 28
      charts/shipyard/templates/secret-keystone-env.yaml
  33. 30
      charts/shipyard/templates/secret-shipyard-db.yaml
  34. 43
      charts/shipyard/templates/service-airflow-flower.yaml
  35. 32
      charts/shipyard/templates/service-airflow-ingress.yaml
  36. 43
      charts/shipyard/templates/service-airflow-web.yaml
  37. 32
      charts/shipyard/templates/service-shipyard-ingress.yaml
  38. 43
      charts/shipyard/templates/service-shipyard.yaml
  39. 571
      charts/shipyard/values.yaml

22
charts/.helmignore

@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj

29
charts/shipyard/Chart.yaml

@ -0,0 +1,29 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: v1
description: A Helm chart for Shipyard and Airflow
name: shipyard
version: 0.1.0
keywords:
- shipyard
- airflow
home: https://github.com/att-comdev/shipyard
sources:
- https://github.com/apache/incubator-airflow
- https://github.com/att-comdev/aic-helm
- https://git.openstack.org/cgit/openstack/openstack-helm
maintainers:
- name: OpenStack-Helm Authors
engine: gotpl

18
charts/shipyard/requirements.yaml

@ -0,0 +1,18 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
dependencies:
- name: helm-toolkit
repository: http://localhost:8879/charts
version: 0.1.0

49
charts/shipyard/templates/bin/_airflow-db-init.sh.tpl

@ -0,0 +1,49 @@
#!/bin/bash
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
set -ex
export HOME=/tmp
# Extract the DB string from shipyard.conf and get the
# value of the DB host and port
db_string=`grep -i sql_alchemy_conn ${AIRFLOW_CONFIG_FILE}`
db_fqdn=`echo ${db_string#*@} | cut -f1 -d"."`
db_port=`echo ${db_string#*@} | grep -o "[0-9]\+"`
pgsql_superuser_cmd () {
DB_COMMAND="$1"
if [[ ! -z $2 ]]; then
EXPORT PGDATABASE=$2
fi
psql \
-h $db_fqdn \
-p $db_port \
-U ${ROOT_DB_USER} \
--command="${DB_COMMAND}"
}
# Create db
pgsql_superuser_cmd "SELECT 1 FROM pg_database WHERE datname = '$DB_NAME'" | grep -q 1 || pgsql_superuser_cmd "CREATE DATABASE $DB_NAME"
# Create db user
pgsql_superuser_cmd "SELECT * FROM pg_roles WHERE rolname = '$DB_USER';" | tail -n +3 | head -n -2 | grep -q 1 || \
pgsql_superuser_cmd "CREATE ROLE ${DB_USER} LOGIN PASSWORD '$DB_PASS'"
# Grant permissions to user
pgsql_superuser_cmd "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_USER;"

21
charts/shipyard/templates/bin/_airflow-db-sync.sh.tpl

@ -0,0 +1,21 @@
#!/bin/bash
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
set -ex
airflow initdb

22
charts/shipyard/templates/bin/_airflow-shipyard-init.sh.tpl

@ -0,0 +1,22 @@
#!/bin/bash
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
set -ex
cp -vaR /home/shipyard/shipyard/shipyard_airflow/dags/*.py /tmp/airflow/dags/
cp -vaR /home/shipyard/shipyard/shipyard_airflow/plugins/*.py /tmp/airflow/plugins/

54
charts/shipyard/templates/bin/_shipyard-db-init.sh.tpl

@ -0,0 +1,54 @@
#!/bin/bash
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
set -ex
export HOME=/tmp
# Extract the DB string from shipyard.conf and get the
# value of the DB host and port
db_string=`grep -i postgresql_db ${SHIPYARD_CONFIG_FILE}`
db_fqdn=`echo ${db_string#*@} | cut -f1 -d"."`
db_port=`echo ${db_string#*@} | grep -o "[0-9]\+"`
pgsql_superuser_cmd () {
DB_COMMAND="$1"
if [[ ! -z $2 ]]; then
EXPORT PGDATABASE=$2
fi
psql \
-h $db_fqdn \
-p $db_port \
-U ${ROOT_DB_USER} \
--command="${DB_COMMAND}"
}
# Create db
pgsql_superuser_cmd "SELECT 1 FROM pg_database WHERE datname = '$DB_NAME'" | grep -q 1 || pgsql_superuser_cmd "CREATE DATABASE $DB_NAME"
# Create db user
pgsql_superuser_cmd "SELECT * FROM pg_roles WHERE rolname = '$DB_USER';" | tail -n +3 | head -n -2 | grep -q 1 || \
pgsql_superuser_cmd "CREATE ROLE ${DB_USER} LOGIN PASSWORD '$DB_PASS'"
# Grant permissions to user
pgsql_superuser_cmd "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_USER;"
# Grant permissions to shipyard user
# This will allow shipyard user to query airflow database
psql -h $db_fqdn -p $db_port -U ${AIRFLOW_DB_USER} \
--command="GRANT select, insert, update, delete on all tables in schema public to $DB_USER;"

19
charts/shipyard/templates/bin/_shipyard-db-sync.sh.tpl

@ -0,0 +1,19 @@
#!/bin/bash
{{/*
Copyright 2017 The Openstack-Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
set -ex

27
charts/shipyard/templates/configmap-airflow-bin.yaml

@ -0,0 +1,27 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if .Values.manifests.configmap_airflow_bin }}
{{- $envAll := . }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: airflow-bin
data:
airflow-db-init.sh: |+
{{ tuple "bin/_airflow-db-init.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
airflow-db-sync.sh: |+
{{ tuple "bin/_airflow-db-sync.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
airflow-shipyard-init.sh: |+
{{ tuple "bin/_airflow-shipyard-init.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}

59
charts/shipyard/templates/configmap-airflow-etc.yaml

@ -0,0 +1,59 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- $envAll := . }}
{{ include "airflow.conf.airflow_values_skeleton" .Values.conf.airflow | trunc 0 }}
# Add endpoint URI lookup for Airflow Web Server
{{- if empty .Values.conf.airflow.webserver.base_url -}}
{{- tuple "airflow_web" "internal" "airflow_web" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.airflow.webserver "base_url" | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.airflow.cli.endpoint_url -}}
{{- tuple "airflow_web" "internal" "airflow_web" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.airflow.cli "endpoint_url" | quote | trunc 0 -}}
{{- end -}}
# Add endpoint URI lookup for Postgresql DB Connection
{{- if empty .Values.conf.airflow.core.sql_alchemy_conn -}}
{{- tuple "postgresql_airflow_db" "internal" "user" "postgresql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.airflow.core "sql_alchemy_conn" | quote | trunc 0 -}}
{{- end -}}
# Add endpoint URI lookup for RabbitMQ Connection
{{- if empty .Values.conf.airflow.celery.broker_url -}}
{{- tuple "oslo_messaging" "internal" "user" "amqp" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.airflow.celery "broker_url" | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.airflow.celery.celery_result_backend -}}
{{- tuple "oslo_messaging" "internal" "user" "amqp" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.airflow.celery "celery_result_backend" | quote | trunc 0 -}}
{{- end -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: airflow-etc
data:
airflow.cfg: |+
{{ if .Values.conf.airflow.override -}}
{{ .Values.conf.airflow.override | indent 4 }}
{{- else -}}
{{- if .Values.conf.airflow.prefix -}}
{{ .Values.conf.airflow.prefix | indent 4 }}
{{- end }}
{{ tuple "etc/_airflow.cfg.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}
{{- if .Values.conf.airflow.append -}}
{{ .Values.conf.airflow.append | indent 4 }}
{{- end }}

32
charts/shipyard/templates/configmap-shipyard-bin.yaml

@ -0,0 +1,32 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if .Values.manifests.configmap_shipyard_bin }}
{{- $envAll := . }}
apiVersion: v1
kind: ConfigMap
metadata:
name: shipyard-bin
data:
ks-service.sh: |
{{- include "helm-toolkit.scripts.keystone_service" . | indent 4 }}
ks-endpoints.sh: |
{{- include "helm-toolkit.scripts.keystone_endpoints" . | indent 4 }}
ks-user.sh: |
{{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }}
ks-domain-user.sh: |
{{- include "helm-toolkit.scripts.keystone_domain_user" . | indent 4 }}
shipyard-db-init.sh: |+
{{ tuple "bin/_shipyard-db-init.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
shipyard-db-sync.sh: |+
{{ tuple "bin/_shipyard-db-sync.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}

105
charts/shipyard/templates/configmap-shipyard-etc.yaml

@ -0,0 +1,105 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- $envAll := . }}
{{ include "shipyard.conf.shipyard_values_skeleton" .Values.conf.shipyard | trunc 0 }}
{{- if empty .Values.conf.shipyard.keystone_authtoken.keystonemiddleware.auth_token.auth_uri -}}
{{- tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.shipyard.keystone_authtoken.keystonemiddleware.auth_token "auth_uri" | quote | trunc 0 -}}
{{- end -}}
# FIXME fix for broken keystonemiddleware oslo config gen in newton - will remove in future
{{- if empty .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator.auth_url -}}
{{- tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator "auth_url" | quote | trunc 0 -}}
{{- end -}}
# Add endpoint URI lookup for Airflow Web Server
{{- if empty .Values.conf.shipyard.base.web_server -}}
{{- tuple "airflow_web" "internal" "airflow_web" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.shipyard.base "web_server" | quote | trunc 0 -}}
{{- end -}}
# Add endpoint URI lookup for Shipyard Postgresql DB Connection
{{- if empty .Values.conf.shipyard.base.postgresql_db -}}
{{- tuple "postgresql_shipyard_db" "internal" "user" "postgresql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.shipyard.base "postgresql_db" | quote | trunc 0 -}}
{{- end -}}
# Add endpoint URI lookup for Shipyard Airflow Postgresql DB Connection
{{- if empty .Values.conf.shipyard.base.postgresql_airflow_db -}}
{{- tuple "postgresql_airflow_db" "internal" "user" "postgresql" . | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup"| set .Values.conf.shipyard.base "postgresql_airflow_db" | quote | trunc 0 -}}
{{- end -}}
# Add endpoint URI lookup for memcached servers Connection
{{- if empty .Values.conf.shipyard.keystone_authtoken.keystonemiddleware.auth_token.memcached_servers -}}
{{- tuple "oslo_cache" "internal" "memcache" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | set .Values.conf.shipyard.keystone_authtoken.keystonemiddleware.auth_token "memcached_servers" | quote | trunc 0 -}}
{{- end -}}
{{- $userIdentity := .Values.endpoints.identity.auth.user -}}
{{- if empty .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator.project_name -}}
{{- set .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator "project_name" $userIdentity.project_name | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator.project_domain_name -}}
{{- set .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator "project_domain_name" $userIdentity.project_domain_name | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator.user_domain_name -}}
{{- set .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator "user_domain_name" $userIdentity.user_domain_name | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator.username -}}
{{- set .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator "username" $userIdentity.username | quote | trunc 0 -}}
{{- end -}}
{{- if empty .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator.password -}}
{{- set .Values.conf.shipyard.keystone_authtoken.shipyard_orchestrator "password" $userIdentity.password | quote | trunc 0 -}}
{{- end -}}
# Set a random string as secret key.
{{- if empty .Values.conf.shipyard.keystone_authtoken.keystonemiddleware.auth_token.memcache_secret_key -}}
{{- randAlphaNum 64 | set .Values.conf.shipyard.keystone_authtoken.keystonemiddleware.auth_token "memcache_secret_key" | quote | trunc 0 -}}
{{- end -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: shipyard-etc
data:
shipyard.conf: |+
{{ if .Values.conf.shipyard.override -}}
{{ .Values.conf.shipyard.override | indent 4 }}
{{- else -}}
{{- if .Values.conf.shipyard.prefix -}}
{{ .Values.conf.shipyard.prefix | indent 4 }}
{{- end }}
{{ tuple "etc/_shipyard.conf.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}
{{- if .Values.conf.shipyard.append -}}
{{ .Values.conf.shipyard.append | indent 4 }}
{{- end }}
api-paste.ini: |+
{{ if .Values.conf.paste.override -}}
{{ .Values.conf.paste.override | indent 4 }}
{{- else -}}
{{- if .Values.conf.paste.prefix -}}
{{ .Values.conf.paste.prefix | indent 4 }}
{{- end }}
{{ tuple "etc/_api-paste.ini.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- if .Values.conf.paste.append -}}
{{ .Values.conf.paste.append | indent 4 }}
{{- end }}
{{- end }}
policy.yaml: |+
{{ if .Values.conf.policy.override -}}
{{ .Values.conf.policy.override | indent 4 }}
{{- else -}}
{{ tuple "etc/_policy.yaml.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
{{- end }}

69
charts/shipyard/templates/deployment-airflow-flower.yaml

@ -0,0 +1,69 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if .Values.manifests.deployment_airflow_flower }}
{{- $envAll := . }}
{{- $dependencies := .Values.dependencies.airflow_server }}
{{- $mounts_airflow_flower := .Values.pod.mounts.airflow_flower.airflow_flower }}
{{- $mounts_airflow_flower_init := .Values.pod.mounts.airflow_flower.init_container }}
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: airflow-flower
spec:
replicas: {{ .Values.pod.replicas.airflow.flower }}
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
template:
metadata:
labels:
{{ tuple $envAll "airflow" "flower" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
annotations:
configmap-bin-hash: {{ tuple "configmap-airflow-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-airflow-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec:
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
restartPolicy: Always
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.airflow.timeout | default "30" }}
initContainers:
{{ tuple $envAll $dependencies $mounts_airflow_flower_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers:
- name: airflow-flower
image: {{ .Values.images.airflow }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.airflow.flower | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env:
# To prevent the error: ValueError: invalid literal for int() with base 10: 'tcp://10.0.0.83:5555'
- name: FLOWER_PORT
value: "5555"
ports:
- containerPort: {{ .Values.network.airflow.flower.port }}
args: ["flower"]
readinessProbe:
tcpSocket:
port: {{ .Values.network.airflow.flower.port }}
volumeMounts:
- name: airflow-etc
mountPath: {{ .Values.conf.airflow.airflow_config_file }}
subPath: airflow.cfg
readOnly: true
{{ if $mounts_airflow_flower.volumeMounts }}{{ toYaml $mounts_airflow_flower.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: airflow-etc
configMap:
name: airflow-etc
defaultMode: 0444
{{ if $mounts_airflow_flower.volumes }}{{ toYaml $mounts_airflow_flower.volumes | indent 8 }}{{ end }}
{{- end }}

127
charts/shipyard/templates/deployment-airflow-scheduler.yaml

@ -0,0 +1,127 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if .Values.manifests.deployment_airflow_scheduler }}
{{- $envAll := . }}
{{- $dependencies := .Values.dependencies.airflow_server }}
{{- $mounts_airflow_scheduler := .Values.pod.mounts.airflow_scheduler.airflow_scheduler }}
{{- $mounts_airflow_scheduler_init := .Values.pod.mounts.airflow_scheduler.init_container }}
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: airflow-scheduler
spec:
replicas: {{ .Values.pod.replicas.airflow.scheduler }}
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
template:
metadata:
labels:
{{ tuple $envAll "airflow" "scheduler" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
annotations:
configmap-bin-hash: {{ tuple "configmap-airflow-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-airflow-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec:
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
restartPolicy: Always
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.airflow.timeout | default "30" }}
initContainers:
{{ tuple $envAll $dependencies $mounts_airflow_scheduler_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
{{- if .Values.prod_environment }}
- name: airflow-shipyard-init
image: {{ .Values.images.shipyard }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.shipyard_api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
command:
- /tmp/airflow-shipyard-init.sh
volumeMounts:
- name: airflow-bin
mountPath: /tmp/airflow-shipyard-init.sh
subPath: airflow-shipyard-init.sh
readOnly: true
- name: pod-shipyard-share-airflow-dags
mountPath: /tmp/airflow/dags/
- name: pod-shipyard-share-airflow-plugins
mountPath: /tmp/airflow/plugins/
{{- end }}
containers:
- name: airflow-scheduler
image: {{ .Values.images.airflow }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.airflow.scheduler | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env:
- name: AIRFLOW_CONN_AIRFLOWS_OWN_DB
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.admin }}
key: DB_CONNECTION_AIRFLOW
# Set to -1 to stop scheduler from going into crash loops
args: ["scheduler", "-n", "-1" ]
volumeMounts:
- name: airflow-etc
mountPath: {{ .Values.conf.airflow.airflow_config_file }}
subPath: airflow.cfg
readOnly: true
{{- if .Values.prod_environment }}
- name: shipyard-etc
mountPath: /usr/local/airflow/plugins/shipyard.conf
subPath: shipyard.conf
readOnly: true
- name: pod-shipyard-share-airflow-dags
mountPath: {{ .Values.conf.airflow.core.dags_folder }}
- name: pod-shipyard-share-airflow-plugins
mountPath: {{ .Values.conf.airflow.core.plugins_folder }}
{{ else }}
- name: airflow-dags
mountPath: {{ .Values.conf.airflow.core.dags_folder }}
- name: airflow-plugins
mountPath: {{ .Values.conf.airflow.core.plugins_folder }}
{{- end }}
- name: airflow-logs
mountPath: {{ .Values.conf.airflow.core.base_log_folder }}
{{ if $mounts_airflow_scheduler.volumeMounts }}{{ toYaml $mounts_airflow_scheduler.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: airflow-etc
configMap:
name: airflow-etc
defaultMode: 0444
{{- if .Values.prod_environment }}
- name: shipyard-etc
configMap:
name: shipyard-etc
defaultMode: 0444
- name: airflow-bin
configMap:
name: airflow-bin
defaultMode: 0555
- name: pod-shipyard-share-airflow-dags
emptyDir: {}
- name: pod-shipyard-share-airflow-plugins
emptyDir: {}
- name: airflow-logs
emptyDir: {}
{{ else }}
- name: airflow-dags
hostPath:
path: {{ .Values.pod.mounts.dag_path }}
- name: airflow-plugins
hostPath:
path: {{ .Values.pod.mounts.plugin_path }}
- name: airflow-logs
hostPath:
path: {{ .Values.pod.mounts.log_path }}
{{- end }}
{{ if $mounts_airflow_scheduler.volumes }}{{ toYaml $mounts_airflow_scheduler.volumes | indent 8 }}{{ end }}
{{- end }}

131
charts/shipyard/templates/deployment-airflow-web.yaml

@ -0,0 +1,131 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if .Values.manifests.deployment_airflow_web }}
{{- $envAll := . }}
{{- $dependencies := .Values.dependencies.airflow_server }}
{{- $mounts_airflow_web := .Values.pod.mounts.airflow_web.airflow_web }}
{{- $mounts_airflow_web_init := .Values.pod.mounts.airflow_web.init_container }}
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: airflow-web
spec:
replicas: {{ .Values.pod.replicas.airflow.web }}
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
template:
metadata:
labels:
{{ tuple $envAll "airflow" "web" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
annotations:
configmap-bin-hash: {{ tuple "configmap-airflow-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-airflow-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec:
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
restartPolicy: Always
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.airflow.timeout | default "30" }}
initContainers:
{{ tuple $envAll $dependencies $mounts_airflow_web_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
{{- if .Values.prod_environment }}
- name: airflow-shipyard-init
image: {{ .Values.images.shipyard }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.shipyard_api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
command:
- /tmp/airflow-shipyard-init.sh
volumeMounts:
- name: airflow-bin
mountPath: /tmp/airflow-shipyard-init.sh
subPath: airflow-shipyard-init.sh
readOnly: true
- name: pod-shipyard-share-airflow-dags
mountPath: /tmp/airflow/dags/
- name: pod-shipyard-share-airflow-plugins
mountPath: /tmp/airflow/plugins/
{{- end }}
containers:
- name: airflow-web
image: {{ .Values.images.airflow }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.airflow.web | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env:
- name: AIRFLOW_CONN_AIRFLOWS_OWN_DB
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.admin }}
key: DB_CONNECTION_AIRFLOW
ports:
- containerPort: {{ .Values.network.airflow.web.port }}
args: ["webserver"]
readinessProbe:
tcpSocket:
port: {{ .Values.network.airflow.web.port }}
volumeMounts:
- name: airflow-etc
mountPath: {{ .Values.conf.airflow.airflow_config_file }}
subPath: airflow.cfg
readOnly: true
{{- if .Values.prod_environment }}
- name: shipyard-etc
mountPath: /usr/local/airflow/plugins/shipyard.conf
subPath: shipyard.conf
readOnly: true
- name: pod-shipyard-share-airflow-dags
mountPath: {{ .Values.conf.airflow.core.dags_folder }}
- name: pod-shipyard-share-airflow-plugins
mountPath: {{ .Values.conf.airflow.core.plugins_folder }}
{{ else }}
- name: airflow-dags
mountPath: {{ .Values.conf.airflow.core.dags_folder }}
- name: airflow-plugins
mountPath: {{ .Values.conf.airflow.core.plugins_folder }}
{{- end }}
- name: airflow-logs
mountPath: {{ .Values.conf.airflow.core.base_log_folder }}
{{ if $mounts_airflow_web.volumeMounts }}{{ toYaml $mounts_airflow_web.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: airflow-etc
configMap:
name: airflow-etc
defaultMode: 0444
{{- if .Values.prod_environment }}
- name: shipyard-etc
configMap:
name: shipyard-etc
defaultMode: 0444
- name: airflow-bin
configMap:
name: airflow-bin
defaultMode: 0555
- name: pod-shipyard-share-airflow-dags
emptyDir: {}
- name: pod-shipyard-share-airflow-plugins
emptyDir: {}
- name: airflow-logs
emptyDir: {}
{{ else }}
- name: airflow-dags
hostPath:
path: {{ .Values.pod.mounts.dag_path }}
- name: airflow-plugins
hostPath:
path: {{ .Values.pod.mounts.plugin_path }}
- name: airflow-logs
hostPath:
path: {{ .Values.pod.mounts.log_path }}
{{- end }}
{{ if $mounts_airflow_web.volumes }}{{ toYaml $mounts_airflow_web.volumes | indent 8 }}{{ end }}
{{- end }}

145
charts/shipyard/templates/deployment-airflow-worker.yaml

@ -0,0 +1,145 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if .Values.manifests.deployment_airflow_worker }}
{{- $envAll := . }}
{{- $dependencies := .Values.dependencies.airflow_server }}
{{- $mounts_airflow_worker := .Values.pod.mounts.airflow_worker.airflow_worker }}
{{- $mounts_airflow_worker_init := .Values.pod.mounts.airflow_worker.init_container }}
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: airflow-worker
spec:
replicas: {{ .Values.pod.replicas.airflow.worker }}
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
template:
metadata:
labels:
{{ tuple $envAll "airflow" "worker" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
annotations:
configmap-bin-hash: {{ tuple "configmap-airflow-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-airflow-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec:
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
restartPolicy: Always
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.airflow.timeout | default "30" }}
initContainers:
{{ tuple $envAll $dependencies $mounts_airflow_worker_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
{{- if .Values.prod_environment }}
- name: airflow-shipyard-init
image: {{ .Values.images.shipyard }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.shipyard_api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
command:
- /tmp/airflow-shipyard-init.sh
volumeMounts:
- name: airflow-bin
mountPath: /tmp/airflow-shipyard-init.sh
subPath: airflow-shipyard-init.sh
readOnly: true
- name: pod-shipyard-share-airflow-dags
mountPath: /tmp/airflow/dags/
- name: pod-shipyard-share-airflow-plugins
mountPath: /tmp/airflow/plugins/
{{- end }}
containers:
- name: airflow-worker
image: {{ .Values.images.airflow }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.airflow.worker | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env:
- name: AIRFLOW_CONN_AIRFLOWS_OWN_DB
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.admin }}
key: DB_CONNECTION_AIRFLOW
ports:
- containerPort: {{ .Values.network.airflow.worker.port }}
args: ["worker"]
readinessProbe:
tcpSocket:
port: {{ .Values.network.airflow.worker.port }}
securityContext:
privileged: true
volumeMounts:
- name: airflow-etc
mountPath: {{ .Values.conf.airflow.airflow_config_file }}
subPath: airflow.cfg
readOnly: true
{{- if .Values.prod_environment }}
- name: shipyard-etc
mountPath: /usr/local/airflow/plugins/shipyard.conf
subPath: shipyard.conf
readOnly: true
- name: pod-shipyard-share-airflow-dags
mountPath: {{ .Values.conf.airflow.core.dags_folder }}
- name: pod-shipyard-share-airflow-plugins
mountPath: {{ .Values.conf.airflow.core.plugins_folder }}
{{ else }}
- name: airflow-dags
mountPath: {{ .Values.conf.airflow.core.dags_folder }}
- name: airflow-plugins
mountPath: {{ .Values.conf.airflow.core.plugins_folder }}
- name: docker
mountPath: /var/run
readOnly: false
- name: pod-var-lib-docker
mountPath: /var/lib/docker
readOnly: false
{{- end }}
- name: airflow-logs
mountPath: {{ .Values.conf.airflow.core.base_log_folder }}
{{ if $mounts_airflow_worker.volumeMounts }}{{ toYaml $mounts_airflow_worker.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: airflow-etc
configMap:
name: airflow-etc
defaultMode: 0444
{{- if .Values.prod_environment }}
- name: shipyard-etc
configMap:
name: shipyard-etc
defaultMode: 0444
- name: airflow-bin
configMap:
name: airflow-bin
defaultMode: 0555
- name: pod-shipyard-share-airflow-dags
emptyDir: {}
- name: pod-shipyard-share-airflow-plugins
emptyDir: {}
- name: airflow-logs
emptyDir: {}
{{ else }}
- name: airflow-dags
hostPath:
path: {{ .Values.pod.mounts.dag_path }}
- name: airflow-plugins
hostPath:
path: {{ .Values.pod.mounts.plugin_path }}
- name: airflow-logs
hostPath:
path: {{ .Values.pod.mounts.log_path }}
- name: docker
hostPath:
path: /var/run
- name: pod-var-lib-docker
hostPath:
path: /var/lib/docker
{{- end }}
{{ if $mounts_airflow_worker.volumes }}{{ toYaml $mounts_airflow_worker.volumes | indent 8 }}{{ end }}
{{- end }}

76
charts/shipyard/templates/deployment-shipyard.yaml

@ -0,0 +1,76 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if .Values.manifests.deployment_shipyard }}
{{- $envAll := . }}
{{- $dependencies := .Values.dependencies.shipyard }}
{{- $mounts_shipyard := .Values.pod.mounts.shipyard.shipyard }}
{{- $mounts_shipyard_init := .Values.pod.mounts.shipyard.init_container }}
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: shipyard
spec:
replicas: {{ .Values.pod.replicas.shipyard }}
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
template:
metadata:
labels:
{{ tuple $envAll "shipyard-api" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
annotations:
configmap-bin-hash: {{ tuple "configmap-shipyard-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-shipyard-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec:
nodeSelector:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.shipyard.timeout | default "30" }}
restartPolicy: Always
initContainers:
{{ tuple $envAll $dependencies $mounts_shipyard_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers:
- name: shipyard
image: {{ .Values.images.shipyard }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.shipyard_api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
ports:
- containerPort: {{ .Values.network.shipyard.port }}
readinessProbe:
tcpSocket:
port: {{ .Values.network.shipyard.port }}
volumeMounts:
- name: etc-shipyard
mountPath: /etc/shipyard
- name: shipyard-etc
mountPath: /etc/shipyard/shipyard.conf
subPath: shipyard.conf
readOnly: true
- name: shipyard-etc
subPath: api-paste.ini
mountPath: /etc/shipyard/api-paste.ini
readOnly: true
- name: shipyard-etc
subPath: policy.yaml
mountPath: /etc/shipyard/policy.yaml
readOnly: true
{{ if $mounts_shipyard.volumeMounts }}{{ toYaml $mounts_shipyard.volumeMounts | indent 12 }}{{ end }}
volumes:
- name: etc-shipyard
emptyDir: {}
- name: shipyard-etc
configMap:
name: shipyard-etc
defaultMode: 0444
{{ if $mounts_shipyard.volumes }}{{ toYaml $mounts_shipyard.volumes | indent 8 }}{{ end }}
{{- end }}

371
charts/shipyard/templates/etc/_airflow.cfg.tpl

@ -0,0 +1,371 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{ include "airflow.conf.airflow_values_skeleton" .Values.conf.airflow | trunc 0 }}
{{ include "airflow.conf.airflow" .Values.conf.airflow}}
{{- define "airflow.conf.airflow_values_skeleton" -}}
{{- if not .core -}}{{- set . "core" dict -}}{{- end -}}
{{- if not .webserver -}}{{- set . "webserver" dict -}}{{- end -}}
{{- if not .email -}}{{- set . "email" dict -}}{{- end -}}
{{- if not .smtp -}}{{- set . "smtp" dict -}}{{- end -}}
{{- if not .celery -}}{{- set . "celery" dict -}}{{- end -}}
{{- if not .scheduler -}}{{- set . "scheduler" dict -}}{{- end -}}
{{- if not .mesos -}}{{- set . "mesos" dict -}}{{- end -}}
{{- end -}}
{{- define "airflow.conf.airflow" -}}
[core]
# The home folder for airflow, is ~/airflow
{{ if not .core.airflow_home }}#{{ end }}airflow_home = {{ .core.airflow_home | default "<None>" }}
# The folder where your airflow pipelines live, most likely a
# subfolder in a code repository
{{ if not .core.dags_folder }}#{{ end }}dags_folder = {{ .core.dags_folder | default "<None>" }}
# The folder where airflow should store its log files. This location
{{ if not .core.base_log_folder }}#{{ end }}base_log_folder = {{ .core.base_log_folder | default "<None>" }}
# Airflow can store logs remotely in AWS S3 or Google Cloud Storage. Users
# must supply a remote location URL (starting with either 's3://...' or
# 'gs://...') and an Airflow connection id that provides access to the storage
# location.
{{ if not .core.remote_base_log_folder }}#{{ end }}remote_base_log_folder = {{ .core.remote_base_log_folder | default "<None>" }}
{{ if not .core.remote_log_conn_id }}#{{ end }}remote_log_conn_id = {{ .core.remote_log_conn_id | default "<None>" }}
# Use server-side encryption for logs stored in S3
{{ if not .core.encrypt_s3_logs }}#{{ end }}encrypt_s3_logs = {{ .core.encrypt_s3_logs | default "<None>" }}
# deprecated option for remote log storage, use remote_base_log_folder instead!
# s3_log_folder =
# The executor class that airflow should use. Choices include
# SequentialExecutor, LocalExecutor, CeleryExecutor
{{ if not .core.executor }}#{{ end }}executor = {{ .core.executor | default "<None>" }}
# The SqlAlchemy connection string to the metadata database.
# SqlAlchemy supports many different database engine, more information
# their website
{{ if not .core.sql_alchemy_conn }}#{{ end }}sql_alchemy_conn = {{ .core.sql_alchemy_conn | default "<None>" }}
# The SqlAlchemy pool size is the maximum number of database connections
# in the pool.
{{ if not .core.sql_alchemy_pool_size }}#{{ end }}sql_alchemy_pool_size = {{ .core.sql_alchemy_pool_size | default "<None>" }}
# The SqlAlchemy pool recycle is the number of seconds a connection
# can be idle in the pool before it is invalidated. This config does
# not apply to sqlite.
{{ if not .core.sql_alchemy_pool_recycle }}#{{ end }}sql_alchemy_pool_recycle = {{ .core.sql_alchemy_pool_recycle | default "<None>" }}
# The amount of parallelism as a setting to the executor. This defines
# the max number of task instances that should run simultaneously
# on this airflow installation
{{ if not .core.parallelism }}#{{ end }}parallelism = {{ .core.parallelism | default "<None>" }}
# The number of task instances allowed to run concurrently by the scheduler
{{ if not .core.dag_concurrency }}#{{ end }}dag_concurrency = {{ .core.dag_concurrency | default "<None>" }}
# Are DAGs paused by at creation
{{ if not .core.dags_are_paused_at_creation }}#{{ end }}dags_are_paused_at_creation = {{ .core.dags_are_paused_at_creation | default "<None>" }}
# When not using pools, tasks are run in the pool",
# whose size is guided by this config element
{{ if not .core.non_pooled_task_slot_count }}#{{ end }}non_pooled_task_slot_count = {{ .core.non_pooled_task_slot_count | default "<None>" }}
# The maximum number of active DAG runs per DAG
{{ if not .core.max_active_runs_per_dag }}#{{ end }}max_active_runs_per_dag = {{ .core.max_active_runs_per_dag | default "<None>" }}
# Whether to load the examples that ship with Airflow. It's good to
# get started, but you probably want to set this to False in a production
# environment
{{ if not .core.load_examples }}#{{ end }}load_examples = {{ .core.load_examples | default "<None>" }}
# Where your Airflow plugins are stored
{{ if not .core.plugins_folder }}#{{ end }}plugins_folder = {{ .core.plugins_folder | default "<None>" }}
# Secret key to save connection passwords in the db
{{ if not .core.fernet_key }}#{{ end }}fernet_key = {{ .core.fernet_key | default "<None>" }}
# Whether to disable pickling dags
{{ if not .core.donot_pickle }}#{{ end }}donot_pickle = {{ .core.donot_pickle | default "<None>" }}
# How long before timing out a python file import while filling the DagBag
{{ if not .core.dagbag_import_timeout }}#{{ end }}dagbag_import_timeout = {{ .core.dagbag_import_timeout | default "<None>" }}
# The class to use for running task instances in a subprocess
{{ if not .core.task_runner }}#{{ end }}task_runner = {{ .core.task_runner | default "<None>" }}
# If set, tasks without a `run_as_user` argument will be run with this user
# Can be used to de-elevate a sudo user running Airflow when executing tasks
{{ if not .core.default_impersonation }}#{{ end }}default_impersonation = {{ .core.default_impersonation | default "<None>" }}
# What security module to use (for example kerberos):
{{ if not .core.security }}#{{ end }}security = {{ .core.security | default "<None>" }}
# Turn unit test mode on (overwrites many configuration options with test
# values at runtime)
{{ if not .core.unit_test_mode }}#{{ end }}unit_test_mode = {{ .core.unit_test_mode | default "<None>" }}
[cli]
# In what way should the cli access the API. The LocalClient will use the
# database directly, while the json_client will use the api running on the
# webserver
{{ if not .cli.api_client }}#{{ end }}api_client = {{ .cli.api_client | default "<None>" }}
{{ if not .cli.endpoint_url }}#{{ end }}endpoint_url = {{ .cli.endpoint_url | default "<None>" }}
[api]
# How to authenticate users of the API
{{ if not .api.auth_backend }}#{{ end }}auth_backend = {{ .api.auth_backend | default "<None>" }}
[operators]
# The default owner assigned to each new operator, unless
# provided explicitly or passed via `default_args`
{{ if not .operators.default_owner }}#{{ end }}default_owner = {{ .operators.default_owner | default "<None>" }}
{{ if not .operators.default_cpus }}#{{ end }}default_cpus = {{ .operators.default_cpus | default "<None>" }}
{{ if not .operators.default_ram }}#{{ end }}default_ram = {{ .operators.default_ram | default "<None>" }}
{{ if not .operators.default_disk }}#{{ end }}default_disk = {{ .operators.default_disk | default "<None>" }}
{{ if not .operators.default_gpus }}#{{ end }}default_gpus = {{ .operators.default_gpus | default "<None>" }}
[webserver]
# The base url of your website as airflow cannot guess what domain or
# cname you are using. This is use in automated emails that
# airflow sends to point links to the right web server
{{ if not .webserver.base_url }}#{{ end }}base_url = {{ .webserver.base_url | default "<None>" }}
# The ip specified when starting the web server
{{ if not .webserver.web_server_host }}#{{ end }}web_server_host = {{ .webserver.web_server_host | default "<None>" }}
# The port on which to run the web server
{{ if not .webserver.web_server_port }}#{{ end }}web_server_port = {{ .webserver.web_server_port | default "<None>" }}
# Paths to the SSL certificate and key for the web server. When both are
# provided SSL will be enabled. This does not change the web server port.
{{ if not .webserver.web_server_ssl_cert }}#{{ end }}web_server_ssl_cert = {{ .webserver.web_server_ssl_cert | default "<None>" }}
{{ if not .webserver.web_server_ssl_key }}#{{ end }}web_server_ssl_key = {{ .webserver.web_server_ssl_key | default "<None>" }}
# The time the gunicorn webserver waits before timing out on a worker
{{ if not .webserver.web_server_worker_timeout }}#{{ end }}web_server_worker_timeout = {{ .webserver.web_server_worker_timeout | default "<None>" }}
# Number of workers to refresh at a time. When set to 0, worker refresh is
# disabled. When nonzero, airflow periodically refreshes webserver workers by
# bringing up new ones and killing old ones.
{{ if not .webserver.worker_refresh_batch_size }}#{{ end }}worker_refresh_batch_size = {{ .webserver.worker_refresh_batch_size | default "<None>" }}
# Number of seconds to wait before refreshing a batch of workers.
{{ if not .webserver.worker_refresh_interval }}#{{ end }}worker_refresh_interval = {{ .webserver.worker_refresh_interval | default "<None>" }}
# Secret key used to run your flask app
{{ if not .webserver.secret_key }}#{{ end }}secret_key = {{ .webserver.secret_key | default "<None>" }}
# Number of workers to run the Gunicorn web server
{{ if not .webserver.workers }}#{{ end }}workers = {{ .webserver.workers | default "<None>" }}
# The worker class gunicorn should use. Choices include
# sync ), eventlet, gevent
{{ if not .webserver.worker_class }}#{{ end }}worker_class = {{ .webserver.worker_class | default "<None>" }}
# Log files for the gunicorn webserver. '-' means log to stderr.
{{ if not .webserver.access_logfile }}#{{ end }}access_logfile = {{ .webserver.access_logfile | default "<None>" }}
{{ if not .webserver.error_logfile }}#{{ end }}error_logfile = {{ .webserver.error_logfile | default "<None>" }}
# Expose the configuration file in the web server
{{ if not .webserver.expose_config }}#{{ end }}expose_config = {{ .webserver.expose_config | default "<None>" }}
# Set to true to turn on authentication : http://pythonhosted.org/airflow/installation.html#web-authentication
{{ if not .webserver.authenticate }}#{{ end }}authenticate = {{ .webserver.authenticate | default "<None>" }}
# Filter the list of dags by owner name (requires authentication to be enabled)
{{ if not .webserver.filter_by_owner }}#{{ end }}filter_by_owner = {{ .webserver.filter_by_owner | default "<None>" }}
# Filtering mode. Choices include user ) and ldapgroup.
# Ldap group filtering requires using the ldap backend
#
# Note that the ldap server needs the "memberOf" overlay to be set up
# in order to user the ldapgroup mode.
{{ if not .webserver.owner_mode }}#{{ end }}owner_mode = {{ .webserver.owner_mode | default "<None>" }}
# Default DAG orientation. Valid values are:
# LR (Left->Right), TB (Top->Bottom), RL (Right->Left), BT (Bottom->Top)
{{ if not .webserver.dag_orientation }}#{{ end }}dag_orientation = {{ .webserver.dag_orientation | default "<None>" }}
# Puts the webserver in demonstration mode; blurs the names of Operators for
# privacy.
{{ if not .webserver.demo_mode }}#{{ end }}demo_mode = {{ .webserver.demo_mode | default "<None>" }}
# The amount of time (in secs) webserver will wait for initial handshake
# while fetching logs from other worker machine
{{ if not .webserver.log_fetch_timeout_sec }}#{{ end }}log_fetch_timeout_sec = {{ .webserver.log_fetch_timeout_sec | default "<None>" }}
# By, the webserver shows paused DAGs. Flip this to hide paused
# DAGs by
{{ if not .webserver.hide_paused_dags_by_default }}#{{ end }}hide_paused_dags_by_default = {{ .webserver.hide_paused_dags_by_default | default "<None>" }}
[email]
{{ if not .email.email_backend }}#{{ end }}email_backend = {{ .email.email_backend | default "<None>" }}
[smtp]
# If you want airflow to send emails on retries, failure, and you want to
# the airflow.utils.send_email function, you have to configure an smtp
# server here
{{ if not .smtp.smtp_host }}#{{ end }}smtp_host = {{ .smtp.smtp_host | default "<None>" }}
{{ if not .smtp.smtp_starttls }}#{{ end }}smtp_smtp_starttls = {{ .smtp.smtp_starttls | default "<None>" }}
smtp_ssl = {{ .smtp.smtp_ssl | default "<None>" }}
{{ if not .smtp.smtp_user }}#{{ end }}smtp_user = {{ .smtp.smtp_user | default "<None>" }}
{{ if not .smtp.smtp_port }}#{{ end }}smtp_port = {{ .smtp.smtp_port | default "<None>" }}
{{ if not .smtp.smtp_password }}#{{ end }}smtp_password = {{ .smtp.smtp_password | default "<None>" }}
{{ if not .smtp.smtp_mail_from }}#{{ end }}smtp_mail_from = {{ .smtp.smtp_mail_from | default "<None>" }}
[celery]
# This section only applies if you are using the CeleryExecutor in
# [core] section above
# The app name that will be used by celery
{{ if not .celery.celery_app_name }}#{{ end }}celery_app_name = {{ .celery.celery_app_name | default "<None>" }}
# The concurrency that will be used when starting workers with the
# "airflow worker" command. This defines the number of task instances that
# a worker will take, so size up your workers based on the resources on
# your worker box and the nature of your tasks
{{ if not .celery.celeryd_concurrency }}#{{ end }}celeryd_concurrency = {{ .celery.celeryd_concurrency | default "<None>" }}
# When you start an airflow worker, airflow starts a tiny web server
# subprocess to serve the workers local log files to the airflow main
# web server, who then builds pages and sends them to users. This defines
# the port on which the logs are served. It needs to be unused, and open
# visible from the main web server to connect into the workers.
{{ if not .celery.worker_log_server_port }}#{{ end }}worker_log_server_port = {{ .celery.worker_log_server_port | default "<None>" }}
# The Celery broker URL. Celery supports RabbitMQ, Redis and experimentally
# a sqlalchemy database. Refer to the Celery documentation for more
# information.
{{ if not .celery.broker_url }}#{{ end }}broker_url = {{ .celery.broker_url | default "<None>" }}
# Another key Celery setting
{{ if not .celery.celery_result_backend }}#{{ end }}celery_result_backend = {{ .celery.celery_result_backend | default "<None>" }}
# Celery Flower is a sweet UI for Celery. Airflow has a shortcut to start
# it `airflow flower`. This defines the IP that Celery Flower runs on
{{ if not .celery.flower_host }}#{{ end }}flower_host = {{ .celery.flower_host | default "<None>" }}
# This defines the port that Celery Flower runs on
{{ if not .celery.flower_port }}#{{ end }}flower_port = {{ .celery.flower_port | default "<None>" }}
# Default queue that tasks get assigned to and that worker listen on.
{{ if not .celery.default_queue }}#{{ end }}default_queue = {{ .celery.default_queue | default "<None>" }}
[scheduler]
# Task instances listen for external kill signal (when you clear tasks
# from the CLI or the UI), this defines the frequency at which they should
# listen (in seconds).
{{ if not .scheduler.job_heartbeat_sec }}#{{ end }}job_heartbeat_sec = {{ .scheduler.job_heartbeat_sec | default "<None>" }}
# The scheduler constantly tries to trigger new tasks (look at the
# scheduler section in the docs for more information). This defines
# how often the scheduler should run (in seconds).
{{ if not .scheduler.scheduler_heartbeat_sec }}#{{ end }}scheduler_heartbeat_sec = {{ .scheduler.scheduler_heartbeat_sec | default "<None>" }}
# after how much time should the scheduler terminate in seconds
# -1 indicates to run continuously (see also num_runs)
{{ if not .scheduler.run_duration }}#{{ end }}run_duration = {{ .scheduler.run_duration | default "<None>" }}
# after how much time a new DAGs should be picked up from the filesystem
{{ if not .scheduler.min_file_process_interval }}#{{ end }}min_file_process_interval = {{ .scheduler.min_file_process_interval | default "<None>" }}
{{ if not .scheduler.dag_dir_list_interval }}#{{ end }}dag_dir_list_interval = {{ .scheduler.dag_dir_list_interval | default "<None>" }}
# How often should stats be printed to the logs
{{ if not .scheduler.print_stats_interval }}#{{ end }}print_stats_interval = {{ .scheduler.print_stats_interval | default "<None>" }}
{{ if not .scheduler.child_process_log_directory }}#{{ end }}child_process_log_directory = {{ .scheduler.child_process_log_directory | default "<None>" }}
# Local task jobs periodically heartbeat to the DB. If the job has
# not heartbeat in this many seconds, the scheduler will mark the
# associated task instance as failed and will re-schedule the task.
{{ if not .scheduler.scheduler_zombie_task_threshold }}#{{ end }}scheduler_zombie_task_threshold = {{ .scheduler.scheduler_zombie_task_threshold | default "<None>" }}
# Turn off scheduler catchup by setting this to False.
# Default behavior is unchanged and
# Command Line Backfills still work, but the scheduler
# will not do scheduler catchup if this is False,
# however it can be set on a per DAG basis in the
# DAG definition (catchup)
{{ if not .scheduler.catchup_by_default }}#{{ end }}catchup_by_default = {{ .scheduler.catchup_by_default | default "<None>" }}
# Statsd (https://github.com/etsy/statsd) integration settings
# statsd_on = False
# statsd_host = localhost
# statsd_port = 8125
# statsd_prefix = airflow
# The scheduler can run multiple threads in parallel to schedule dags.
# This defines how many threads will run. However airflow will never
# use more threads than the amount of cpu cores available.
{{ if not .scheduler.max_threads }}#{{ end }}max_threads = {{ .scheduler.max_threads | default "<None>" }}
{{ if not .scheduler.authenticate }}#{{ end }}authenticate = {{ .scheduler.authenticate | default "<None>" }}
[mesos]
# Mesos master address which MesosExecutor will connect to.
{{ if not .mesos.master }}#{{ end }}master = {{ .mesos.master | default "<None>" }}
# The framework name which Airflow scheduler will register itself as on mesos
{{ if not .mesos.framework_name }}#{{ end }}framework_name = {{ .mesos.framework_name | default "<None>" }}
# Number of cpu cores required for running one task instance using
# 'airflow run <dag_id> <task_id> <execution_date> --local -p <pickle_id>'
# command on a mesos slave
{{ if not .mesos.task_cpu }}#{{ end }}task_cpu = {{ .mesos.task_cpu | default "<None>" }}
# Memory in MB required for running one task instance using
# 'airflow run <dag_id> <task_id> <execution_date> --local -p <pickle_id>'
# command on a mesos slave
{{ if not .mesos.task_memory }}#{{ end }}task_memory = {{ .mesos.task_memory | default "<None>" }}
# Enable framework checkpointing for mesos
# See http://mesos.apache.org/documentation/latest/slave-recovery/
{{ if not .mesos.checkpoint }}#{{ end }}checkpoint = {{ .mesos.checkpoint | default "<None>" }}
# Failover timeout in milliseconds.
# When checkpointing is enabled and this option is set, Mesos waits
# until the configured timeout for
# the MesosExecutor framework to re-register after a failover. Mesos
# shuts down running tasks if the
# MesosExecutor framework fails to re-register within this timeframe.
# failover_timeout = 604800
# Enable framework authentication for mesos
# See http://mesos.apache.org/documentation/latest/configuration/
{{ if not .mesos.authenticate }}#{{ end }}authenticate = {{ .mesos.authenticate | default "<None>" }}
# Mesos credentials, if authentication is enabled
#_principal = admin
#_secret = admin
[kerberos]
#ccache = /tmp/airflow_krb5_ccache
# gets augmented with fqdn
#principal = airflow
#reinit_frequency = 3600
#kinit_path = kinit
#keytab = airflow.keytab
[github_enterprise]
#api_rev = v3
[admin]
# UI to hide sensitive variable fields when set to True
{{ if not .admin.hide_sensitive_variable_fields }}#{{ end }}hide_sensitive_variable_fields = {{ .admin.hide_sensitive_variable_fields | default "<None>" }}
{{- end -}}

25
charts/shipyard/templates/etc/_api-paste.ini.tpl

@ -0,0 +1,25 @@
# Copyright 2017 The Openstack-Helm Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#PasteDeploy Configuration File
#Used to configure uWSGI middleware pipeline
[app:shipyard-api]