Add feature gate capability to OSH-Infra

This patch set adds the feature gate capability to OpenStack-Helm-Infra
repository without depending on the main OpenStack-Helm repository.

Change-Id: I70b8fac4fd2365f8eedcf50519f125eb34534f2f
Signed-off-by: Tin Lam <tlam@omegaprime.dev>
Signed-off-by: Tin Lam <tin@irrational.io>
This commit is contained in:
Tin Lam 2019-10-22 08:46:16 -05:00 committed by Tin Lam
parent 8bd11d1ad2
commit daefed7218
29 changed files with 213 additions and 36 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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')

View File

@ -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

View File

@ -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}"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 \

View File

@ -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 \

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -1 +0,0 @@
../common/nagios.sh

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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