From b6c30b4ef1d0d4a58d07dfd7a47ae8545eb3b5f1 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Fri, 26 May 2023 11:10:11 +0200 Subject: [PATCH] Create airflow secret as part of OSM Helm chart Change-Id: Ia4c001df698d6a9b3743d30ab6507ca400cab072 Signed-off-by: garciadeblas --- .../osm/templates/airflow/airflow-secret.yaml | 29 +++++++++++++++++++ installers/helm/osm/values.yaml | 3 ++ installers/install_ngsa.sh | 1 - 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 installers/helm/osm/templates/airflow/airflow-secret.yaml diff --git a/installers/helm/osm/templates/airflow/airflow-secret.yaml b/installers/helm/osm/templates/airflow/airflow-secret.yaml new file mode 100644 index 00000000..10c664be --- /dev/null +++ b/installers/helm/osm/templates/airflow/airflow-secret.yaml @@ -0,0 +1,29 @@ +{{- if not .Values.global.oldServiceAssurance -}} +{{- if .Values.airflow.enabled -}} +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# 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 +kind: Secret +type: Opaque +metadata: + name: airflow-webserver-secret + labels: + {{- include "osm.labels" . | nindent 4 }} +data: + webserver-secret-key: {{ randAlphaNum 32 | b64enc | quote }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/installers/helm/osm/values.yaml b/installers/helm/osm/values.yaml index 1ef77230..e018b2b9 100644 --- a/installers/helm/osm/values.yaml +++ b/installers/helm/osm/values.yaml @@ -65,6 +65,9 @@ global: oldServiceAssurance: false +airflow: + enabled: true + certauth: enabled: true diff --git a/installers/install_ngsa.sh b/installers/install_ngsa.sh index 87f5daa1..8f18f03a 100755 --- a/installers/install_ngsa.sh +++ b/installers/install_ngsa.sh @@ -34,7 +34,6 @@ function install_airflow() { if ! helm -n osm status airflow 2> /dev/null ; then # if it does not exist, create secrets and install - kubectl -n osm create secret generic airflow-webserver-secret --from-literal="webserver-secret-key=$(python3 -c 'import secrets; print(secrets.token_hex(16))')" helm repo add apache-airflow https://airflow.apache.org helm repo update helm -n osm install airflow apache-airflow/airflow -f ${OSM_HELM_WORK_DIR}/airflow-values.yaml --version ${AIRFLOW_HELM_VERSION} -- 2.25.1