diff --git a/tools/deployment/apparmor/020-ceph.sh b/tools/deployment/apparmor/020-ceph.sh index 248a6ed0a..16f77a125 100755 --- a/tools/deployment/apparmor/020-ceph.sh +++ b/tools/deployment/apparmor/020-ceph.sh @@ -202,20 +202,21 @@ for CHART in ceph-mon ceph-client ceph-provisioners; do --namespace=ceph \ --values=/tmp/ceph.yaml \ ${OSH_INFRA_EXTRA_HELM_ARGS} \ - ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_DEPLOY} + ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_DEPLOY:-$(./tools/deployment/common/get-values-overrides.sh ${CHART})} done - helm upgrade --install ceph-osd ./ceph-osd \ - --namespace=ceph \ - --values=/tmp/ceph.yaml \ - --values=/tmp/ceph-osd.yaml - #NOTE: Wait for deploy - ./tools/deployment/common/wait-for-pods.sh ceph +helm upgrade --install ceph-osd ./ceph-osd \ + --namespace=ceph \ + --values=/tmp/ceph.yaml \ + --values=/tmp/ceph-osd.yaml - #NOTE: Validate deploy - MON_POD=$(kubectl get pods \ - --namespace=ceph \ - --selector="application=ceph" \ - --selector="component=mon" \ - --no-headers | awk '{ print $1; exit }') - kubectl exec -n ceph ${MON_POD} -- ceph -s +#NOTE: Wait for deploy +./tools/deployment/common/wait-for-pods.sh ceph + +#NOTE: Validate deploy +MON_POD=$(kubectl get pods \ + --namespace=ceph \ + --selector="application=ceph" \ + --selector="component=mon" \ + --no-headers | awk '{ print $1; exit }') +kubectl exec -n ceph ${MON_POD} -- ceph -s diff --git a/tools/deployment/apparmor/040-memcached.sh b/tools/deployment/apparmor/040-memcached.sh index 54e4b92a1..b9c1cc89c 100755 --- a/tools/deployment/apparmor/040-memcached.sh +++ b/tools/deployment/apparmor/040-memcached.sh @@ -17,6 +17,7 @@ set -xe namespace="osh-infra" +: ${OSH_INFRA_EXTRA_HELM_ARGS_MEMCACHED:="$(./tools/deployment/common/get-values-overrides.sh memcached)"} # NOTE: Lint and package chart make memcached diff --git a/tools/deployment/apparmor/050-libvirt.sh b/tools/deployment/apparmor/050-libvirt.sh index a4e51acb9..e9d706348 100755 --- a/tools/deployment/apparmor/050-libvirt.sh +++ b/tools/deployment/apparmor/050-libvirt.sh @@ -164,11 +164,14 @@ conf: EOF #NOTE: Deploy command +: ${OSH_EXTRA_HELM_ARGS_LIBVIRT:="$(./tools/deployment/common/get-values-overrides.sh libvirt)"} helm upgrade --install libvirt ./libvirt \ --namespace=openstack \ --values=/tmp/libvirt.yaml \ - --set network.backend="null" + --set network.backend="null" \ + ${OSH_EXTRA_HELM_ARGS} \ + ${OSH_EXTRA_HELM_ARGS_LIBVIRT} #NOTE: Validate Deployment info ./tools/deployment/common/wait-for-pods.sh openstack diff --git a/tools/deployment/common/040-ldap.sh b/tools/deployment/common/040-ldap.sh index 4f6ab7e1b..85340575e 100755 --- a/tools/deployment/common/040-ldap.sh +++ b/tools/deployment/common/040-ldap.sh @@ -16,13 +16,16 @@ set -xe +: ${OSH_INFRA_EXTRA_HELM_ARGS_LDAP:="$(./tools/deployment/common/get-values-overrides.sh ldap)"} + #NOTE: Pull images and lint chart make ldap #NOTE: Deploy command helm upgrade --install ldap ./ldap \ --namespace=osh-infra \ - --set bootstrap.enabled=true + --set bootstrap.enabled=true \ + ${OSH_INFRA_EXTRA_HELM_ARGS_LDAP} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh osh-infra diff --git a/tools/deployment/common/env-variables.sh b/tools/deployment/common/env-variables.sh new file mode 100755 index 000000000..f4f407f8c --- /dev/null +++ b/tools/deployment/common/env-variables.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# 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 -e + +export API_ADDR=$(kubectl get endpoints kubernetes -o json | jq -r '.subsets[0].addresses[0].ip') +export API_PORT=$(kubectl get endpoints kubernetes -o json | jq -r '.subsets[0].ports[0].port') diff --git a/tools/deployment/common/fluentbit.sh b/tools/deployment/common/fluentbit.sh index 93c106878..317d8282b 100755 --- a/tools/deployment/common/fluentbit.sh +++ b/tools/deployment/common/fluentbit.sh @@ -19,8 +19,13 @@ set -xe #NOTE: Lint and package chart make fluentbit +: ${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTBIT:="$(./tools/deployment/common/get-values-overrides.sh fluentbit)"} + helm upgrade --install fluentbit ./fluentbit \ - --namespace=osh-infra + --namespace=osh-infra \ + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_FLUENTBIT} + #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh osh-infra diff --git a/tools/deployment/common/get-values-overrides.sh b/tools/deployment/common/get-values-overrides.sh new file mode 100755 index 000000000..ef1b588f3 --- /dev/null +++ b/tools/deployment/common/get-values-overrides.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# +# 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 -e + +HELM_CHART="$1" + +: "${HELM_CHART_ROOT_PATH:="../openstack-helm-infra"}" +: "${CONTAINER_DISTRO_NAME:="ubuntu"}" +: "${CONTAINER_DISTRO_VERSION:="xenial"}" +: "${FEATURE_GATES:=""}" +OSH_INFRA_FEATURE_MIX="${FEATURE_GATES},${CONTAINER_DISTRO_NAME}_${CONTAINER_DISTRO_VERSION},${CONTAINER_DISTRO_NAME}" + +function echoerr () { + echo "$@" 1>&2; +} + +function generate_awk_exp_from_mask () { + local POSITION=1 + for VALUE in $@; do + [ "${VALUE}" -eq 1 ] && echo -n "print \$${POSITION};" + POSITION=$((POSITION+1)) + done + echo -e "\n" +} + +function combination () { + POWER=$((2**$#)) + BITS="$(awk "BEGIN { while (c++ < $#) printf \"0\" }")" + while [ "${POWER}" -gt 1 ];do + POWER=$((POWER-1)) + BIN="$(bc <<< "obase=2; ${POWER}")" + MASK="$(echo "${BITS}" | sed -e "s/0\{${#BIN}\}$/$BIN/" | grep -o .)" + #NOTE: This line is odd, but written to support both BSD and GNU utils + awk -v ORS="-" "{$(generate_awk_exp_from_mask "$MASK")}" <<< "$@" | awk 1 | sed 's/-$//' + done +} + +function override_file_args () { + OVERRIDE_ARGS="" + echoerr "We will attempt to use values-override files with the following paths:" + for FILE in $(combination ${1//,/ } | uniq | tac); do + FILE_PATH="${HELM_CHART_ROOT_PATH}/${HELM_CHART}/values_overrides/${FILE}.yaml" + if [ -f "${FILE_PATH}" ]; then + envsubst < ${FILE_PATH} > /tmp/${HELM_CHART}-${FILE}.yaml + OVERRIDE_ARGS+=" --values=/tmp/${HELM_CHART}-${FILE}.yaml " + fi + echoerr "${FILE_PATH}" + done + echo "${OVERRIDE_ARGS}" +} + +echoerr "We are going to deploy the service ${HELM_CHART} using ${CONTAINER_DISTRO_NAME} (${CONTAINER_DISTRO_VERSION}) distribution containers." +source ${HELM_CHART_ROOT_PATH}/tools/deployment/common/env-variables.sh +override_file_args "${OSH_INFRA_FEATURE_MIX}" diff --git a/tools/deployment/keystone-auth/060-mariadb.sh b/tools/deployment/keystone-auth/060-mariadb.sh index 56c5d6708..8f651c20b 100755 --- a/tools/deployment/keystone-auth/060-mariadb.sh +++ b/tools/deployment/keystone-auth/060-mariadb.sh @@ -16,6 +16,8 @@ set -xe +: ${OSH_INFRA_EXTRA_HELM_ARGS_MARIADB:="$(./tools/deployment/common/get-values-overrides.sh mariadb)"} + #NOTE: Lint and package chart make mariadb diff --git a/tools/deployment/keystone-auth/070-keystone.sh b/tools/deployment/keystone-auth/070-keystone.sh index 5be164414..878a98c13 100755 --- a/tools/deployment/keystone-auth/070-keystone.sh +++ b/tools/deployment/keystone-auth/070-keystone.sh @@ -19,6 +19,7 @@ set -xe : ${OSH_PATH:="../openstack-helm"} : ${OSH_INFRA_EXTRA_HELM_ARGS:=""} : ${OSH_EXTRA_HELM_ARGS:=""} +: ${OSH_EXTRA_HELM_ARGS_KEYSTONE:="$(./tools/deployment/common/get-values-overrides.sh keystone)"} # Install LDAP make ldap diff --git a/tools/deployment/multinode/030-ceph.sh b/tools/deployment/multinode/030-ceph.sh index f37df3b6f..95b8808a7 100755 --- a/tools/deployment/multinode/030-ceph.sh +++ b/tools/deployment/multinode/030-ceph.sh @@ -103,7 +103,7 @@ for CHART in ceph-mon ceph-osd ceph-client ceph-provisioners; do --namespace=ceph \ --values=/tmp/ceph.yaml \ ${OSH_INFRA_EXTRA_HELM_ARGS} \ - ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_DEPLOY} + ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_DEPLOY:-$(./tools/deployment/common/get-values-overrides.sh ${CHART})} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh ceph 1200 diff --git a/tools/deployment/multinode/035-ceph-ns-activate.sh b/tools/deployment/multinode/035-ceph-ns-activate.sh index ea1f3cefe..102690112 100755 --- a/tools/deployment/multinode/035-ceph-ns-activate.sh +++ b/tools/deployment/multinode/035-ceph-ns-activate.sh @@ -42,6 +42,9 @@ conf: rgw_ks: enabled: false EOF + +: ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_NS_ACTIVATE:="$(./tools/deployment/common/get-values-overrides.sh ceph-provisioners)"} + helm upgrade --install ceph-osh-infra-config ./ceph-provisioners \ --namespace=osh-infra \ --values=/tmp/ceph-osh-infra-config.yaml \ diff --git a/tools/deployment/multinode/045-mariadb.sh b/tools/deployment/multinode/045-mariadb.sh index fbc83735c..80ee36dfb 100755 --- a/tools/deployment/multinode/045-mariadb.sh +++ b/tools/deployment/multinode/045-mariadb.sh @@ -21,6 +21,8 @@ make mariadb #NOTE: Deploy command : ${OSH_INFRA_EXTRA_HELM_ARGS:=""} +: ${OSH_INFRA_EXTRA_HELM_ARGS_MARIADB:="$(./tools/deployment/common/get-values-overrides.sh mariadb)"} + helm upgrade --install mariadb ./mariadb \ --namespace=osh-infra \ --set monitoring.prometheus.enabled=true \ diff --git a/tools/deployment/network-policy/045-mariadb.sh b/tools/deployment/network-policy/045-mariadb.sh index 32a3c992b..affb378e0 100755 --- a/tools/deployment/network-policy/045-mariadb.sh +++ b/tools/deployment/network-policy/045-mariadb.sh @@ -58,6 +58,8 @@ EOF #NOTE: Deploy command : ${OSH_INFRA_EXTRA_HELM_ARGS:=""} +: ${OSH_INFRA_EXTRA_HELM_ARGS_MARIADB:="$(./tools/deployment/common/get-values-overrides.sh mariadb)"} + helm upgrade --install mariadb ./mariadb \ --namespace=osh-infra \ --values=/tmp/mariadb.yaml \ diff --git a/tools/deployment/openstack-support/025-ceph-ns-activate.sh b/tools/deployment/openstack-support/025-ceph-ns-activate.sh index 4a402550a..87009df3d 100755 --- a/tools/deployment/openstack-support/025-ceph-ns-activate.sh +++ b/tools/deployment/openstack-support/025-ceph-ns-activate.sh @@ -41,11 +41,14 @@ conf: rgw_ks: enabled: false EOF + +: ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_NS_ACTIVATE:="$(./tools/deployment/common/get-values-overrides.sh ceph-provisioners)"} + helm upgrade --install ceph-openstack-config ./ceph-provisioners \ --namespace=openstack \ --values=/tmp/ceph-openstack-config.yaml \ - ${OSH_EXTRA_HELM_ARGS} \ - ${OSH_EXTRA_HELM_ARGS_CEPH_NS_ACTIVATE} + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_NS_ACTIVATE} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh openstack diff --git a/tools/deployment/openstack-support/030-rabbitmq.sh b/tools/deployment/openstack-support/030-rabbitmq.sh index fa5f8883a..0a904ad2e 100755 --- a/tools/deployment/openstack-support/030-rabbitmq.sh +++ b/tools/deployment/openstack-support/030-rabbitmq.sh @@ -16,6 +16,8 @@ set -xe +: ${OSH_INFRA_EXTRA_HELM_ARGS_RABBITMQ:="$(./tools/deployment/common/get-values-overrides.sh rabbitmq)"} + #NOTE: Lint and package chart make rabbitmq @@ -25,8 +27,8 @@ helm upgrade --install rabbitmq ./rabbitmq \ --namespace=openstack \ --recreate-pods \ --force \ - ${OSH_EXTRA_HELM_ARGS} \ - ${OSH_EXTRA_HELM_ARGS_RABBITMQ} + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_RABBITMQ} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh openstack diff --git a/tools/deployment/openstack-support/040-memcached.sh b/tools/deployment/openstack-support/040-memcached.sh index 776141855..1e36e9074 100755 --- a/tools/deployment/openstack-support/040-memcached.sh +++ b/tools/deployment/openstack-support/040-memcached.sh @@ -16,6 +16,8 @@ set -xe +: ${OSH_INFRA_EXTRA_HELM_ARGS_MEMCACHED:="$(./tools/deployment/common/get-values-overrides.sh memcached)"} + #NOTE: Lint and package chart make memcached @@ -23,8 +25,8 @@ make memcached : ${OSH_EXTRA_HELM_ARGS:=""} helm upgrade --install memcached ./memcached \ --namespace=openstack \ - ${OSH_EXTRA_HELM_ARGS} \ - ${OSH_EXTRA_HELM_ARGS_MEMCACHED} + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_MEMCACHED} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh openstack diff --git a/tools/deployment/openstack-support/050-libvirt.sh b/tools/deployment/openstack-support/050-libvirt.sh index 48c053a7e..65577f7fc 100755 --- a/tools/deployment/openstack-support/050-libvirt.sh +++ b/tools/deployment/openstack-support/050-libvirt.sh @@ -15,13 +15,17 @@ # under the License. set -xe +: ${OSH_INFRA_EXTRA_HELM_ARGS_LIBVIRT:="$(./tools/deployment/common/get-values-overrides.sh libvirt)"} + #NOTE: Lint and package chart make libvirt #NOTE: Deploy command helm upgrade --install libvirt ./libvirt \ --namespace=openstack \ - --set network.backend="null" + --set network.backend="null" \ + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_LIBVIRT} #NOTE: Please be aware that a network backend might affect #The loadability of this, as some need to be asynchronously diff --git a/tools/deployment/openstack-support/060-openvswitch.sh b/tools/deployment/openstack-support/060-openvswitch.sh index b903afede..20a7b0f0d 100755 --- a/tools/deployment/openstack-support/060-openvswitch.sh +++ b/tools/deployment/openstack-support/060-openvswitch.sh @@ -15,6 +15,8 @@ # under the License. set -xe +: ${OSH_EXTRA_HELM_ARGS_OPENVSWITCH:="$(./tools/deployment/common/get-values-overrides.sh openvswitch)"} + #NOTE: Deploy command helm upgrade --install openvswitch ./openvswitch \ --namespace=openstack \ diff --git a/tools/deployment/osh-infra-logging/020-ceph.sh b/tools/deployment/osh-infra-logging/020-ceph.sh index c642c3dcb..3dca839f9 100755 --- a/tools/deployment/osh-infra-logging/020-ceph.sh +++ b/tools/deployment/osh-infra-logging/020-ceph.sh @@ -193,7 +193,7 @@ for CHART in ceph-mon ceph-osd ceph-client ceph-provisioners; do --namespace=ceph \ --values=/tmp/ceph.yaml \ ${OSH_INFRA_EXTRA_HELM_ARGS} \ - ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_DEPLOY} + ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_DEPLOY:-$(./tools/deployment/common/get-values-overrides.sh ${CHART})} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh ceph diff --git a/tools/deployment/osh-infra-logging/025-ceph-ns-activate.sh b/tools/deployment/osh-infra-logging/025-ceph-ns-activate.sh index a88d88d47..ab8eac56b 100755 --- a/tools/deployment/osh-infra-logging/025-ceph-ns-activate.sh +++ b/tools/deployment/osh-infra-logging/025-ceph-ns-activate.sh @@ -41,6 +41,9 @@ conf: rgw_ks: enabled: false EOF + +: ${OSH_EXTRA_HELM_ARGS_CEPH_NS_ACTIVATE:="$(./tools/deployment/common/get-values-overrides.sh ceph-provisioners)"} + helm upgrade --install ceph-osh-infra-config ./ceph-provisioners \ --namespace=osh-infra \ --values=/tmp/ceph-osh-infra-config.yaml \ diff --git a/tools/deployment/osh-infra-logging/050-elasticsearch.sh b/tools/deployment/osh-infra-logging/050-elasticsearch.sh index ed5c3dbd4..27b7be130 100755 --- a/tools/deployment/osh-infra-logging/050-elasticsearch.sh +++ b/tools/deployment/osh-infra-logging/050-elasticsearch.sh @@ -59,9 +59,14 @@ conf: unit_count: 365 EOF + +: ${OSH_INFRA_EXTRA_HELM_ARGS_ELASTICSEARCH:="$(./tools/deployment/common/get-values-overrides.sh elasticsearch)"} + helm upgrade --install elasticsearch ./elasticsearch \ - --namespace=osh-infra \ - --values=/tmp/elasticsearch.yaml + --namespace=osh-infra \ + --values=/tmp/elasticsearch.yaml\ + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_ELASTICSEARCH} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh osh-infra diff --git a/tools/deployment/osh-infra-logging/075-kibana.sh b/tools/deployment/osh-infra-logging/075-kibana.sh index 5939b8619..0feded0f6 100755 --- a/tools/deployment/osh-infra-logging/075-kibana.sh +++ b/tools/deployment/osh-infra-logging/075-kibana.sh @@ -19,9 +19,13 @@ set -xe #NOTE: Lint and package chart make kibana +: ${OSH_INFRA_EXTRA_HELM_ARGS_KIBANA:="$(./tools/deployment/common/get-values-overrides.sh kibana)"} + #NOTE: Deploy command helm upgrade --install kibana ./kibana \ - --namespace=osh-infra + --namespace=osh-infra \ + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_KIBANA} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh osh-infra diff --git a/tools/deployment/osh-infra-monitoring/045-mariadb.sh b/tools/deployment/osh-infra-monitoring/045-mariadb.sh index fbc83735c..87dc575de 100755 --- a/tools/deployment/osh-infra-monitoring/045-mariadb.sh +++ b/tools/deployment/osh-infra-monitoring/045-mariadb.sh @@ -19,6 +19,8 @@ set -xe #NOTE: Lint and package chart make mariadb +: ${OSH_INFRA_EXTRA_HELM_ARGS_MARIADB:="$(./tools/deployment/common/get-values-overrides.sh mariadb)"} + #NOTE: Deploy command : ${OSH_INFRA_EXTRA_HELM_ARGS:=""} helm upgrade --install mariadb ./mariadb \ diff --git a/tools/deployment/osh-infra-monitoring/110-grafana.sh b/tools/deployment/osh-infra-monitoring/110-grafana.sh index 569e1b423..5cfc510a9 100755 --- a/tools/deployment/osh-infra-monitoring/110-grafana.sh +++ b/tools/deployment/osh-infra-monitoring/110-grafana.sh @@ -19,9 +19,13 @@ set -xe #NOTE: Lint and package chart make grafana +: ${OSH_INFRA_EXTRA_HELM_ARGS_GRAFANA:="$(./tools/deployment/common/get-values-overrides.sh grafana)"} + #NOTE: Deploy command helm upgrade --install grafana ./grafana \ - --namespace=osh-infra + --namespace=osh-infra \ + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_GRAFANA} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh osh-infra diff --git a/tools/deployment/osh-infra-monitoring/120-nagios.sh b/tools/deployment/osh-infra-monitoring/120-nagios.sh deleted file mode 120000 index 300a142bb..000000000 --- a/tools/deployment/osh-infra-monitoring/120-nagios.sh +++ /dev/null @@ -1 +0,0 @@ -../common/nagios.sh \ No newline at end of file diff --git a/tools/deployment/osh-infra-monitoring/120-nagios.sh b/tools/deployment/osh-infra-monitoring/120-nagios.sh new file mode 100755 index 000000000..2915ea368 --- /dev/null +++ b/tools/deployment/osh-infra-monitoring/120-nagios.sh @@ -0,0 +1,36 @@ +#!/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 -xe + +#NOTE: Lint and package chart +make nagios + +: ${OSH_INFRA_EXTRA_HELM_ARGS_NAGIOS:="$(./tools/deployment/common/get-values-overrides.sh nagios)"} + +#NOTE: Deploy command +helm upgrade --install nagios ./nagios \ + --namespace=osh-infra \ + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_NAGIOS} + +#NOTE: Wait for deploy +./tools/deployment/common/wait-for-pods.sh osh-infra + +#NOTE: Validate Deployment info +helm status nagios + +helm test nagios diff --git a/tools/deployment/osh-infra-monitoring/130-postgresql.sh b/tools/deployment/osh-infra-monitoring/130-postgresql.sh index c4dd70b0e..aed9bb602 100755 --- a/tools/deployment/osh-infra-monitoring/130-postgresql.sh +++ b/tools/deployment/osh-infra-monitoring/130-postgresql.sh @@ -21,6 +21,8 @@ make postgresql #NOTE: Deploy command : ${OSH_INFRA_EXTRA_HELM_ARGS:=""} +: ${OSH_INFRA_EXTRA_HELM_ARGS_POSTGRESQL:="$(./tools/deployment/common/get-values-overrides.sh postgresql)"} + helm upgrade --install postgresql ./postgresql \ --namespace=osh-infra \ --set monitoring.prometheus.enabled=true \ @@ -28,7 +30,7 @@ helm upgrade --install postgresql ./postgresql \ --set storage.pvc.enabled=true \ --set pod.replicas.server=3 \ ${OSH_INFRA_EXTRA_HELM_ARGS} \ - ${OSH_INFRA_EXTRA_HELM_ARGS_MARIADB} + ${OSH_INFRA_EXTRA_HELM_ARGS_POSTGRESQL} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh osh-infra diff --git a/tools/deployment/tenant-ceph/030-ceph.sh b/tools/deployment/tenant-ceph/030-ceph.sh index 7a1836d2c..de2f45ad2 100755 --- a/tools/deployment/tenant-ceph/030-ceph.sh +++ b/tools/deployment/tenant-ceph/030-ceph.sh @@ -120,7 +120,7 @@ for CHART in ceph-mon ceph-osd ceph-client ceph-provisioners; do --namespace=ceph \ --values=/tmp/ceph.yaml \ ${OSH_INFRA_EXTRA_HELM_ARGS} \ - ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_DEPLOY} + ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_DEPLOY:-$(./tools/deployment/common/get-values-overrides.sh ${CHART})} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh ceph 1200 diff --git a/tools/deployment/tenant-ceph/040-tenant-ceph.sh b/tools/deployment/tenant-ceph/040-tenant-ceph.sh index 2529552f5..b0b947c15 100755 --- a/tools/deployment/tenant-ceph/040-tenant-ceph.sh +++ b/tools/deployment/tenant-ceph/040-tenant-ceph.sh @@ -147,7 +147,7 @@ for CHART in ceph-mon ceph-osd ceph-client; do --namespace=tenant-ceph \ --values=/tmp/tenant-ceph.yaml \ ${OSH_INFRA_EXTRA_HELM_ARGS} \ - ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_DEPLOY} + ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_DEPLOY:-$(./tools/deployment/common/get-values-overrides.sh ${CHART})} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh tenant-ceph 1200 diff --git a/tools/deployment/tenant-ceph/045-tenant-ceph-ns-activate.sh b/tools/deployment/tenant-ceph/045-tenant-ceph-ns-activate.sh index e22d63b90..68671936a 100755 --- a/tools/deployment/tenant-ceph/045-tenant-ceph-ns-activate.sh +++ b/tools/deployment/tenant-ceph/045-tenant-ceph-ns-activate.sh @@ -64,11 +64,14 @@ storageclass: adminSecretNamespace: tenant-ceph userSecretName: pvc-tenant-ceph-cephfs-client-key EOF + +: ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_NS_ACTIVATE:="$(./tools/deployment/common/get-values-overrides.sh ceph-provisioners)"} + helm upgrade --install tenant-ceph-openstack-config ./ceph-provisioners \ --namespace=openstack \ --values=/tmp/tenant-ceph-openstack-config.yaml \ - ${OSH_EXTRA_HELM_ARGS} \ - ${OSH_EXTRA_HELM_ARGS_CEPH_NS_ACTIVATE} + ${OSH_INFRA_EXTRA_HELM_ARGS} \ + ${OSH_INFRA_EXTRA_HELM_ARGS_CEPH_NS_ACTIVATE} #NOTE: Wait for deploy ./tools/deployment/common/wait-for-pods.sh openstack