Update Shipyard/Airflow Chart - Database Configurability

- Support configured Postgres admin password
- Use secrets for database job environment setup

This patch set also updates a bunch of banners

Change-Id: I238cfd123b5aad31c9cb93864cff7641f719f3df
This commit is contained in:
Anthony Lin 2018-01-29 03:54:51 +00:00
parent 8d486b22db
commit eb23a5a0d2
35 changed files with 166 additions and 96 deletions

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -34,7 +34,7 @@ pgsql_superuser_cmd () {
psql \ psql \
-h $db_fqdn \ -h $db_fqdn \
-p $db_port \ -p $db_port \
-U ${ROOT_DB_USER} \ -U ${DB_ADMIN_USER} \
--command="${DB_COMMAND}" --command="${DB_COMMAND}"
} }
@ -42,8 +42,8 @@ pgsql_superuser_cmd () {
pgsql_superuser_cmd "SELECT 1 FROM pg_database WHERE datname = '$DB_NAME'" | grep -q 1 || pgsql_superuser_cmd "CREATE DATABASE $DB_NAME" 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 # 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 "SELECT * FROM pg_roles WHERE rolname = '$DB_SERVICE_USER';" | tail -n +3 | head -n -2 | grep -q 1 || \
pgsql_superuser_cmd "CREATE ROLE ${DB_USER} LOGIN PASSWORD '$DB_PASS'" pgsql_superuser_cmd "CREATE ROLE ${DB_SERVICE_USER} LOGIN PASSWORD '$DB_SERVICE_PASSWORD'"
# Grant permissions to user # Grant permissions to user
pgsql_superuser_cmd "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_USER;" pgsql_superuser_cmd "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_SERVICE_USER;"

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -34,7 +34,7 @@ pgsql_superuser_cmd () {
psql \ psql \
-h $db_fqdn \ -h $db_fqdn \
-p $db_port \ -p $db_port \
-U ${ROOT_DB_USER} \ -U ${DB_ADMIN_USER} \
--command="${DB_COMMAND}" --command="${DB_COMMAND}"
} }
@ -42,13 +42,13 @@ pgsql_superuser_cmd () {
pgsql_superuser_cmd "SELECT 1 FROM pg_database WHERE datname = '$DB_NAME'" | grep -q 1 || pgsql_superuser_cmd "CREATE DATABASE $DB_NAME" 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 # 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 "SELECT * FROM pg_roles WHERE rolname = '$DB_SERVICE_USER';" | tail -n +3 | head -n -2 | grep -q 1 || \
pgsql_superuser_cmd "CREATE ROLE ${DB_USER} LOGIN PASSWORD '$DB_PASS'" pgsql_superuser_cmd "CREATE ROLE ${DB_SERVICE_USER} LOGIN PASSWORD '$DB_SERVICE_PASSWORD'"
# Grant permissions to user # Grant permissions to user
pgsql_superuser_cmd "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_USER;" pgsql_superuser_cmd "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_SERVICE_USER;"
# Grant permissions to shipyard user # Grant permissions to shipyard user
# This will allow shipyard user to query airflow database # This will allow shipyard user to query airflow database
psql -h $db_fqdn -p $db_port -U ${AIRFLOW_DB_USER} \ 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;" --command="GRANT select, insert, update, delete on all tables in schema public to $DB_SERVICE_USER;"

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,3 +1,5 @@
# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,3 +1,5 @@
# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -68,8 +68,8 @@ spec:
- name: AIRFLOW_CONN_AIRFLOWS_OWN_DB - name: AIRFLOW_CONN_AIRFLOWS_OWN_DB
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.admin }} name: {{ .Values.secrets.postgresql_airflow_db.user }}
key: DB_CONNECTION_AIRFLOW key: AIRFLOW_DATABASE_URI
# Set to -1 to stop scheduler from going into crash loops # Set to -1 to stop scheduler from going into crash loops
args: ["scheduler", "-n", "-1" ] args: ["scheduler", "-n", "-1" ]
volumeMounts: volumeMounts:

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -68,8 +68,8 @@ spec:
- name: AIRFLOW_CONN_AIRFLOWS_OWN_DB - name: AIRFLOW_CONN_AIRFLOWS_OWN_DB
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.admin }} name: {{ .Values.secrets.postgresql_airflow_db.user }}
key: DB_CONNECTION_AIRFLOW key: AIRFLOW_DATABASE_URI
ports: ports:
- containerPort: {{ .Values.network.airflow.web.port }} - containerPort: {{ .Values.network.airflow.web.port }}
args: ["webserver"] args: ["webserver"]

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -99,8 +99,8 @@ spec:
- name: AIRFLOW_CONN_AIRFLOWS_OWN_DB - name: AIRFLOW_CONN_AIRFLOWS_OWN_DB
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.admin }} name: {{ .Values.secrets.postgresql_airflow_db.user }}
key: DB_CONNECTION_AIRFLOW key: AIRFLOW_DATABASE_URI
ports: ports:
- containerPort: {{ .Values.network.airflow.worker.port }} - containerPort: {{ .Values.network.airflow.worker.port }}
args: ["worker"] args: ["worker"]

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -42,21 +42,38 @@ spec:
imagePullPolicy: {{ .Values.images.pull_policy | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.airflow_db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.jobs.airflow_db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env: env:
- name: DB_CONNECTION - name: AIRFLOW_DB_URL
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.admin }} name: {{ .Values.secrets.postgresql_airflow_db.user }}
key: DB_CONNECTION_AIRFLOW key: AIRFLOW_DATABASE_URI
- name: AIRFLOW_CONFIG_FILE - name: AIRFLOW_CONFIG_FILE
value: /etc/airflow/airflow.cfg value: /etc/airflow/airflow.cfg
- name: DB_NAME - name: DB_NAME
value: {{ .Values.database.postgresql_airflow.db_name }} valueFrom:
- name: DB_USER secretKeyRef:
value: {{ .Values.endpoints.postgresql_airflow_db.auth.user.username }} name: {{ .Values.secrets.postgresql_airflow_db.user }}
- name: DB_PASS key: AIRFLOW_DATABASE_NAME
value: {{ .Values.endpoints.postgresql_airflow_db.auth.user.password }} - name: DB_SERVICE_USER
- name: ROOT_DB_USER valueFrom:
value: {{ .Values.database.postgresql_airflow.db_root_user }} secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.user }}
key: AIRFLOW_DATABASE_USERNAME
- name: DB_SERVICE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.user }}
key: AIRFLOW_DATABASE_PASSWORD
- name: DB_ADMIN_USER
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.admin }}
key: AIRFLOW_DATABASE_USERNAME
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.admin }}
key: AIRFLOW_DATABASE_PASSWORD
command: command:
- /tmp/airflow-db-init.sh - /tmp/airflow-db-init.sh
volumeMounts: volumeMounts:

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,3 +1,5 @@
# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at

View File

@ -1,3 +1,5 @@
# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at

View File

@ -1,3 +1,5 @@
# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -44,23 +44,43 @@ spec:
imagePullPolicy: {{ .Values.images.pull_policy | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.shipyard_db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.jobs.shipyard_db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env: env:
- name: ROOT_DB_CONNECTION - name: SHIPYARD_DB_URL
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ .Values.secrets.postgresql_shipyard_db.admin }} name: {{ .Values.secrets.postgresql_shipyard_db.user }}
key: DB_CONNECTION_SHIPYARD key: SHIPYARD_DATABASE_URI
- name: SHIPYARD_CONFIG_FILE - name: SHIPYARD_CONFIG_FILE
value: /etc/shipyard/shipyard.conf value: /etc/shipyard/shipyard.conf
- name: DB_NAME - name: DB_NAME
value: {{ .Values.database.postgresql_shipyard.db_name }} valueFrom:
- name: DB_USER secretKeyRef:
value: {{ .Values.endpoints.postgresql_shipyard_db.auth.user.username }} name: {{ .Values.secrets.postgresql_shipyard_db.user }}
- name: DB_PASS key: SHIPYARD_DATABASE_NAME
value: {{ .Values.endpoints.postgresql_shipyard_db.auth.user.password }} - name: DB_SERVICE_USER
- name: ROOT_DB_USER valueFrom:
value: {{ .Values.database.postgresql_shipyard.db_root_user }} secretKeyRef:
name: {{ .Values.secrets.postgresql_shipyard_db.user }}
key: SHIPYARD_DATABASE_USERNAME
- name: DB_SERVICE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_shipyard_db.user }}
key: SHIPYARD_DATABASE_PASSWORD
- name: DB_ADMIN_USER
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_shipyard_db.admin }}
key: SHIPYARD_DATABASE_USERNAME
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_shipyard_db.admin }}
key: SHIPYARD_DATABASE_PASSWORD
- name: AIRFLOW_DB_USER - name: AIRFLOW_DB_USER
value: {{ .Values.endpoints.postgresql_airflow_db.auth.user.username }} valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_airflow_db.user }}
key: AIRFLOW_DATABASE_USERNAME
command: command:
- /tmp/shipyard-db-init.sh - /tmp/shipyard-db-init.sh
volumeMounts: volumeMounts:

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -44,19 +44,28 @@ spec:
imagePullPolicy: {{ .Values.images.pull_policy }} imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.shipyard_db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.jobs.shipyard_db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env: env:
- name: ROOT_DB_CONNECTION - name: SHIPYARD_DB_URL
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: {{ .Values.secrets.postgresql_shipyard_db.admin }} name: {{ .Values.secrets.postgresql_shipyard_db.user }}
key: DB_CONNECTION_SHIPYARD key: SHIPYARD_DATABASE_URI
- name: SHIPYARD_CONFIG_FILE - name: SHIPYARD_CONFIG_FILE
value: /etc/shipyard/shipyard.conf value: /etc/shipyard/shipyard.conf
- name: DB_NAME - name: DB_NAME
value: {{ .Values.database.postgresql_shipyard.db_name }} valueFrom:
- name: DB_USER secretKeyRef:
value: {{ .Values.endpoints.postgresql_shipyard_db.auth.user.username }} name: {{ .Values.secrets.postgresql_shipyard_db.user }}
- name: DB_PASS key: SHIPYARD_DATABASE_NAME
value: {{ .Values.endpoints.postgresql_shipyard_db.auth.user.password }} - name: DB_SERVICE_USER
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_shipyard_db.user }}
key: SHIPYARD_DATABASE_USERNAME
- name: DB_SERVICE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.secrets.postgresql_shipyard_db.user }}
key: SHIPYARD_DATABASE_PASSWORD
command: command:
- /tmp/shipyard-db-sync.sh - /tmp/shipyard-db-sync.sh
volumeMounts: volumeMounts:

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -18,6 +18,7 @@ limitations under the License.
{{- $envAll := . }} {{- $envAll := . }}
{{- range $key1, $userClass := tuple "admin" "user" }} {{- range $key1, $userClass := tuple "admin" "user" }}
{{- $secretName := index $envAll.Values.secrets.postgresql_airflow_db $userClass }} {{- $secretName := index $envAll.Values.secrets.postgresql_airflow_db $userClass }}
{{- $auth := index $envAll.Values.endpoints.postgresql_airflow_db.auth $userClass }}
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
@ -25,6 +26,14 @@ metadata:
name: {{ $secretName }} name: {{ $secretName }}
type: Opaque type: Opaque
data: data:
DB_CONNECTION_AIRFLOW: {{ tuple "postgresql_airflow_db" "internal" $userClass "postgresql" $envAll | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | b64enc -}} AIRFLOW_DATABASE_NAME: |-
{{ $auth.database | default "" | b64enc | indent 4 }}
AIRFLOW_DATABASE_PASSWORD: |-
{{ $auth.password | b64enc | indent 4 }}
AIRFLOW_DATABASE_USERNAME: |-
{{ $auth.username | b64enc | indent 4 }}
AIRFLOW_DATABASE_URI: |-
{{ tuple "postgresql_airflow_db" "internal" "user" "postgresql" $envAll | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | b64enc | indent 4 }}
...
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -1,15 +1,17 @@
{{/* {{/*
# Licensed under the Apache License, Version 2.0 (the "License"); Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# http://www.apache.org/licenses/LICENSE-2.0 You may obtain a copy of the License at
#
# Unless required by applicable law or agreed to in writing, software http://www.apache.org/licenses/LICENSE-2.0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Unless required by applicable law or agreed to in writing, software
# See the License for the specific language governing permissions and distributed under the License is distributed on an "AS IS" BASIS,
# limitations under the License. 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.secret_keystone }} {{- if .Values.manifests.secret_keystone }}
{{- $envAll := . }} {{- $envAll := . }}

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -18,6 +18,7 @@ limitations under the License.
{{- $envAll := . }} {{- $envAll := . }}
{{- range $key1, $userClass := tuple "admin" "user" }} {{- range $key1, $userClass := tuple "admin" "user" }}
{{- $secretName := index $envAll.Values.secrets.postgresql_shipyard_db $userClass }} {{- $secretName := index $envAll.Values.secrets.postgresql_shipyard_db $userClass }}
{{- $auth := index $envAll.Values.endpoints.postgresql_shipyard_db.auth $userClass }}
--- ---
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
@ -25,6 +26,14 @@ metadata:
name: {{ $secretName }} name: {{ $secretName }}
type: Opaque type: Opaque
data: data:
DB_CONNECTION_SHIPYARD: {{ tuple "postgresql_shipyard_db" "internal" $userClass "postgresql" $envAll | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | b64enc -}} SHIPYARD_DATABASE_NAME: |-
{{ $auth.database | default "" | b64enc | indent 4 }}
SHIPYARD_DATABASE_PASSWORD: |-
{{ $auth.password | b64enc | indent 4 }}
SHIPYARD_DATABASE_USERNAME: |-
{{ $auth.username | b64enc | indent 4 }}
SHIPYARD_DATABASE_URI: |-
{{ tuple "postgresql_shipyard_db" "internal" "user" "postgresql" $envAll | include "helm-toolkit.endpoints.authenticated_endpoint_uri_lookup" | b64enc | indent 4 }}
...
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,5 +1,5 @@
{{/* {{/*
Copyright 2017 The Openstack-Helm Authors. Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
# Copyright 2017 The Openstack-Helm Authors. # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -213,10 +213,11 @@ endpoints:
auth: auth:
admin: admin:
username: postgres username: postgres
password: postgres password: password
user: user:
username: shipyard username: shipyard
password: password password: password
database: shipyard
hosts: hosts:
default: postgresql default: postgresql
path: /shipyard path: /shipyard
@ -231,10 +232,11 @@ endpoints:
auth: auth:
admin: admin:
username: postgres username: postgres
password: postgres password: password
user: user:
username: airflow username: airflow
password: password password: password
database: airflow
hosts: hosts:
default: postgresql default: postgresql
path: /airflow path: /airflow
@ -281,14 +283,6 @@ secrets:
admin: airflow-db-admin admin: airflow-db-admin
user: airflow-db-user user: airflow-db-user
database:
postgresql_airflow:
db_name: airflow
db_root_user: postgres
postgresql_shipyard:
db_name: shipyard
db_root_user: postgres
conf: conf:
uwsgi: uwsgi:
threads: 1 threads: 1