Skip to content

Commit b84fce1

Browse files
authored
Updated install scripts (#732)
* Updated install scripts Updated install scripts to accept a global override as well as service override and corrected bootstrap to setup the global overrides directory as well as the service overrides directorys * fixed Making automation happy * Update setup-hosts.sh * Update install-barbican.sh
1 parent 060065e commit b84fce1

23 files changed

+682
-324
lines changed

bin/install-barbican.sh

+40-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,41 @@
11
#!/bin/bash
2-
pushd /opt/genestack/submodules/openstack-helm || exit
3-
helm upgrade --install barbican ./barbican \
4-
--namespace=openstack \
5-
--timeout 120m \
6-
-f /opt/genestack/base-helm-configs/barbican/barbican-helm-overrides.yaml \
7-
-f /etc/genestack/helm-configs/barbican/barbican-helm-overrides.yaml \
8-
--set endpoints.identity.auth.admin.password="$(kubectl --namespace openstack get secret keystone-admin -o jsonpath='{.data.password}' | base64 -d)" \
9-
--set endpoints.identity.auth.barbican.password="$(kubectl --namespace openstack get secret barbican-admin -o jsonpath='{.data.password}' | base64 -d)" \
10-
--set endpoints.oslo_db.auth.admin.password="$(kubectl --namespace openstack get secret mariadb -o jsonpath='{.data.root-password}' | base64 -d)" \
11-
--set endpoints.oslo_db.auth.barbican.password="$(kubectl --namespace openstack get secret barbican-db-password -o jsonpath='{.data.password}' | base64 -d)" \
12-
--set endpoints.oslo_messaging.auth.admin.password="$(kubectl --namespace openstack get secret rabbitmq-default-user -o jsonpath='{.data.password}' | base64 -d)" \
13-
--set endpoints.oslo_messaging.auth.barbican.password="$(kubectl --namespace openstack get secret barbican-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)" \
14-
--set endpoints.oslo_cache.auth.memcache_secret_key="$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)" \
15-
--set conf.barbican.keystone_authtoken.memcache_secret_key="$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)" \
16-
--post-renderer /etc/genestack/kustomize/kustomize.sh \
17-
--post-renderer-args barbican/overlay "$@"
18-
popd || exit
2+
3+
GLOBAL_OVERRIDES_DIR="/etc/genestack/helm-configs/global_overrides"
4+
CONFIG_DIR="/etc/genestack/helm-configs/barbican"
5+
6+
pushd /opt/genestack/submodules/openstack-helm || exit 1
7+
8+
HELM_CMD="helm upgrade --install barbican ./barbican \
9+
--namespace=openstack \
10+
--timeout 120m"
11+
12+
# Add the base overrides file
13+
HELM_CMD+=" -f /opt/genestack/base-helm-configs/barbican/barbican-helm-overrides.yaml"
14+
15+
# Append YAML files from the directories
16+
for dir in "$GLOBAL_OVERRIDES_DIR" "$CONFIG_DIR"; do
17+
if compgen -G "${dir}/*.yaml" > /dev/null; then
18+
for yaml_file in "${dir}"/*.yaml; do
19+
HELM_CMD+=" -f ${yaml_file}"
20+
done
21+
fi
22+
done
23+
24+
HELM_CMD+=" --set endpoints.identity.auth.admin.password=\"$(kubectl --namespace openstack get secret keystone-admin -o jsonpath='{.data.password}' | base64 -d)\""
25+
HELM_CMD+=" --set endpoints.identity.auth.barbican.password=\"$(kubectl --namespace openstack get secret barbican-admin -o jsonpath='{.data.password}' | base64 -d)\""
26+
HELM_CMD+=" --set endpoints.oslo_db.auth.admin.password=\"$(kubectl --namespace openstack get secret mariadb -o jsonpath='{.data.root-password}' | base64 -d)\""
27+
HELM_CMD+=" --set endpoints.oslo_db.auth.barbican.password=\"$(kubectl --namespace openstack get secret barbican-db-password -o jsonpath='{.data.password}' | base64 -d)\""
28+
HELM_CMD+=" --set endpoints.oslo_messaging.auth.admin.password=\"$(kubectl --namespace openstack get secret rabbitmq-default-user -o jsonpath='{.data.password}' | base64 -d)\""
29+
HELM_CMD+=" --set endpoints.oslo_messaging.auth.barbican.password=\"$(kubectl --namespace openstack get secret barbican-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)\""
30+
HELM_CMD+=" --set endpoints.oslo_cache.auth.memcache_secret_key=\"$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)\""
31+
HELM_CMD+=" --set conf.barbican.keystone_authtoken.memcache_secret_key=\"$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)\""
32+
33+
HELM_CMD+=" --post-renderer /etc/genestack/kustomize/kustomize.sh"
34+
HELM_CMD+=" --post-renderer-args barbican/overlay $*"
35+
36+
echo "Executing Helm command:"
37+
echo "${HELM_CMD}"
38+
39+
eval "${HELM_CMD}"
40+
41+
popd || exit 1

bin/install-ceilometer.sh

+50-27
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,51 @@
11
#!/bin/bash
2-
pushd /opt/genestack/submodules/openstack-helm || exit
3-
helm upgrade --install ceilometer ./ceilometer \
4-
--namespace=openstack \
5-
--timeout 10m \
6-
-f /opt/genestack/base-helm-configs/ceilometer/ceilometer-helm-overrides.yaml \
7-
-f /etc/genestack/helm-configs/ceilometer/ceilometer-helm-overrides.yaml \
8-
--set endpoints.identity.auth.admin.password="$(kubectl --namespace openstack get secret keystone-admin -o jsonpath='{.data.password}' | base64 -d)" \
9-
--set endpoints.identity.auth.ceilometer.password="$(kubectl --namespace openstack get secret ceilometer-keystone-admin-password -o jsonpath='{.data.password}' | base64 -d)" \
10-
--set endpoints.identity.auth.test.password="$(kubectl --namespace openstack get secret ceilometer-keystone-test-password -o jsonpath='{.data.password}' | base64 -d)" \
11-
--set endpoints.oslo_messaging.auth.admin.username="$(kubectl --namespace openstack get secret rabbitmq-default-user -o jsonpath='{.data.username}' | base64 -d)" \
12-
--set endpoints.oslo_messaging.auth.admin.password="$(kubectl --namespace openstack get secret rabbitmq-default-user -o jsonpath='{.data.password}' | base64 -d)" \
13-
--set endpoints.oslo_messaging.auth.ceilometer.password="$(kubectl --namespace openstack get secret ceilometer-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)" \
14-
--set endpoints.oslo_cache.auth.memcache_secret_key="$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)" \
15-
--set conf.ceilometer.keystone_authtoken.memcache_secret_key="$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)" \
16-
--set conf.ceilometer.oslo_messaging_notifications.transport_url="\
17-
rabbit://ceilometer:$(kubectl --namespace openstack get secret ceilometer-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/ceilometer"\
18-
--set conf.ceilometer.notification.messaging_urls.values="{\
19-
rabbit://ceilometer:$(kubectl --namespace openstack get secret ceilometer-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/ceilometer,\
20-
rabbit://cinder:$(kubectl --namespace openstack get secret cinder-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/cinder,\
21-
rabbit://glance:$(kubectl --namespace openstack get secret glance-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/glance,\
22-
rabbit://heat:$(kubectl --namespace openstack get secret heat-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/heat,\
23-
rabbit://keystone:$(kubectl --namespace openstack get secret keystone-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/keystone,\
24-
rabbit://neutron:$(kubectl --namespace openstack get secret neutron-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/neutron,\
25-
rabbit://nova:$(kubectl --namespace openstack get secret nova-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/nova}" \
26-
--post-renderer /etc/genestack/kustomize/kustomize.sh \
27-
--post-renderer-args ceilometer/overlay "$@"
28-
popd || exit
2+
3+
GLOBAL_OVERRIDES_DIR="/etc/genestack/helm-configs/global_overrides"
4+
SERVICE_CONFIG_DIR="/etc/genestack/helm-configs/ceilometer"
5+
BASE_OVERRIDES="/opt/genestack/base-helm-configs/ceilometer/ceilometer-helm-overrides.yaml"
6+
7+
pushd /opt/genestack/submodules/openstack-helm || exit 1
8+
9+
HELM_CMD="helm upgrade --install ceilometer ./ceilometer \
10+
--namespace=openstack \
11+
--timeout 10m"
12+
13+
HELM_CMD+=" -f ${BASE_OVERRIDES}"
14+
15+
# Append any additional YAML override files from the specified directories
16+
for dir in "$GLOBAL_OVERRIDES_DIR" "$SERVICE_CONFIG_DIR"; do
17+
if compgen -G "${dir}/*.yaml" > /dev/null; then
18+
for yaml_file in "${dir}"/*.yaml; do
19+
HELM_CMD+=" -f ${yaml_file}"
20+
done
21+
fi
22+
done
23+
24+
HELM_CMD+=" --set endpoints.identity.auth.admin.password=\"\$(kubectl --namespace openstack get secret keystone-admin -o jsonpath='{.data.password}' | base64 -d)\""
25+
HELM_CMD+=" --set endpoints.identity.auth.ceilometer.password=\"\$(kubectl --namespace openstack get secret ceilometer-keystone-admin-password -o jsonpath='{.data.password}' | base64 -d)\""
26+
HELM_CMD+=" --set endpoints.identity.auth.test.password=\"\$(kubectl --namespace openstack get secret ceilometer-keystone-test-password -o jsonpath='{.data.password}' | base64 -d)\""
27+
HELM_CMD+=" --set endpoints.oslo_messaging.auth.admin.username=\"\$(kubectl --namespace openstack get secret rabbitmq-default-user -o jsonpath='{.data.username}' | base64 -d)\""
28+
HELM_CMD+=" --set endpoints.oslo_messaging.auth.admin.password=\"\$(kubectl --namespace openstack get secret rabbitmq-default-user -o jsonpath='{.data.password}' | base64 -d)\""
29+
HELM_CMD+=" --set endpoints.oslo_messaging.auth.ceilometer.password=\"\$(kubectl --namespace openstack get secret ceilometer-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)\""
30+
HELM_CMD+=" --set endpoints.oslo_cache.auth.memcache_secret_key=\"\$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)\""
31+
HELM_CMD+=" --set conf.ceilometer.keystone_authtoken.memcache_secret_key=\"\$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)\""
32+
33+
HELM_CMD+=" --set conf.ceilometer.oslo_messaging.transport_url=\"rabbit://ceilometer:\$(kubectl --namespace openstack get secret ceilometer-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/ceilometer\""
34+
35+
HELM_CMD+=" --set conf.ceilometer.notification.messaging_urls.values=\"{\
36+
rabbit://ceilometer:\$(kubectl --namespace openstack get secret ceilometer-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/ceilometer,\
37+
rabbit://cinder:\$(kubectl --namespace openstack get secret cinder-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/cinder,\
38+
rabbit://glance:\$(kubectl --namespace openstack get secret glance-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/glance,\
39+
rabbit://heat:\$(kubectl --namespace openstack get secret heat-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/heat,\
40+
rabbit://keystone:\$(kubectl --namespace openstack get secret keystone-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/keystone,\
41+
rabbit://neutron:\$(kubectl --namespace openstack get secret neutron-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/neutron,\
42+
rabbit://nova:\$(kubectl --namespace openstack get secret nova-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)@rabbitmq.openstack.svc.cluster.local:5672/nova}\""
43+
44+
HELM_CMD+=" --post-renderer /etc/genestack/kustomize/kustomize.sh"
45+
HELM_CMD+=" --post-renderer-args ceilometer/overlay $*"
46+
47+
echo "Executing Helm command:"
48+
echo "${HELM_CMD}"
49+
eval "${HELM_CMD}"
50+
51+
popd || exit 1

bin/install-cinder.sh

+38-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
#!/bin/bash
2-
pushd /opt/genestack/submodules/openstack-helm || exit
3-
helm upgrade --install cinder ./cinder \
2+
3+
GLOBAL_OVERRIDES_DIR="/etc/genestack/helm-configs/global_overrides"
4+
SERVICE_CONFIG_DIR="/etc/genestack/helm-configs/cinder"
5+
BASE_OVERRIDES="/opt/genestack/base-helm-configs/cinder/cinder-helm-overrides.yaml"
6+
7+
pushd /opt/genestack/submodules/openstack-helm || exit 1
8+
9+
HELM_CMD="helm upgrade --install cinder ./cinder \
410
--namespace=openstack \
5-
--timeout 120m \
6-
-f /opt/genestack/base-helm-configs/cinder/cinder-helm-overrides.yaml \
7-
-f /etc/genestack/helm-configs/cinder/cinder-helm-overrides.yaml \
8-
--set endpoints.identity.auth.admin.password="$(kubectl --namespace openstack get secret keystone-admin -o jsonpath='{.data.password}' | base64 -d)" \
9-
--set endpoints.identity.auth.cinder.password="$(kubectl --namespace openstack get secret cinder-admin -o jsonpath='{.data.password}' | base64 -d)" \
10-
--set endpoints.oslo_db.auth.admin.password="$(kubectl --namespace openstack get secret mariadb -o jsonpath='{.data.root-password}' | base64 -d)" \
11-
--set endpoints.oslo_db.auth.cinder.password="$(kubectl --namespace openstack get secret cinder-db-password -o jsonpath='{.data.password}' | base64 -d)" \
12-
--set endpoints.oslo_cache.auth.memcache_secret_key="$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)" \
13-
--set conf.cinder.keystone_authtoken.memcache_secret_key="$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)" \
14-
--set conf.cinder.database.slave_connection="mysql+pymysql://cinder:$(kubectl --namespace openstack get secret cinder-db-password -o jsonpath='{.data.password}' | base64 -d)@mariadb-cluster-secondary.openstack.svc.cluster.local:3306/cinder" \
15-
--set endpoints.oslo_messaging.auth.admin.password="$(kubectl --namespace openstack get secret rabbitmq-default-user -o jsonpath='{.data.password}' | base64 -d)" \
16-
--set endpoints.oslo_messaging.auth.cinder.password="$(kubectl --namespace openstack get secret cinder-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)" \
17-
--post-renderer /etc/genestack/kustomize/kustomize.sh \
18-
--post-renderer-args cinder/overlay "$@"
19-
popd || exit
11+
--timeout 120m"
12+
13+
HELM_CMD+=" -f ${BASE_OVERRIDES}"
14+
15+
for dir in "$GLOBAL_OVERRIDES_DIR" "$SERVICE_CONFIG_DIR"; do
16+
if compgen -G "${dir}/*.yaml" > /dev/null; then
17+
for yaml_file in "${dir}"/*.yaml; do
18+
HELM_CMD+=" -f ${yaml_file}"
19+
done
20+
fi
21+
done
22+
23+
HELM_CMD+=" --set endpoints.identity.auth.admin.password=\"\$(kubectl --namespace openstack get secret keystone-admin -o jsonpath='{.data.password}' | base64 -d)\""
24+
HELM_CMD+=" --set endpoints.identity.auth.cinder.password=\"\$(kubectl --namespace openstack get secret cinder-admin -o jsonpath='{.data.password}' | base64 -d)\""
25+
HELM_CMD+=" --set endpoints.oslo_db.auth.admin.password=\"\$(kubectl --namespace openstack get secret mariadb -o jsonpath='{.data.root-password}' | base64 -d)\""
26+
HELM_CMD+=" --set endpoints.oslo_db.auth.cinder.password=\"\$(kubectl --namespace openstack get secret cinder-db-password -o jsonpath='{.data.password}' | base64 -d)\""
27+
HELM_CMD+=" --set endpoints.oslo_cache.auth.memcache_secret_key=\"\$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)\""
28+
HELM_CMD+=" --set conf.cinder.keystone_authtoken.memcache_secret_key=\"\$(kubectl --namespace openstack get secret os-memcached -o jsonpath='{.data.memcache_secret_key}' | base64 -d)\""
29+
HELM_CMD+=" --set conf.cinder.database.slave_connection=\"mysql+pymysql://cinder:\$(kubectl --namespace openstack get secret cinder-db-password -o jsonpath='{.data.password}' | base64 -d)@mariadb-cluster-secondary.openstack.svc.cluster.local:3306/cinder\""
30+
HELM_CMD+=" --set endpoints.oslo_messaging.auth.admin.password=\"\$(kubectl --namespace openstack get secret rabbitmq-default-user -o jsonpath='{.data.password}' | base64 -d)\""
31+
HELM_CMD+=" --set endpoints.oslo_messaging.auth.cinder.password=\"\$(kubectl --namespace openstack get secret cinder-rabbitmq-password -o jsonpath='{.data.password}' | base64 -d)\""
32+
33+
HELM_CMD+=" --post-renderer /etc/genestack/kustomize/kustomize.sh"
34+
HELM_CMD+=" --post-renderer-args cinder/overlay $*"
35+
36+
echo "Executing Helm command:"
37+
echo "${HELM_CMD}"
38+
eval "${HELM_CMD}"
39+
40+
popd || exit 1

bin/install-fluentbit.sh

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
#!/bin/bash
22
# shellcheck disable=SC2124,SC2145,SC2294
33

4-
# Directory to check for YAML files
5-
CONFIG_DIR="/etc/genestack/helm-configs/fluentbit"
4+
GLOBAL_OVERRIDES_DIR="/etc/genestack/helm-configs/global_overrides"
5+
SERVICE_CONFIG_DIR="/etc/genestack/helm-configs/fluentbit"
66

7-
# Base helm command setup
87
HELM_CMD="helm upgrade --install --namespace fluentbit --create-namespace fluentbit fluent/fluent-bit"
98

10-
# Add the base overrides file
119
HELM_CMD+=" -f /opt/genestack/base-helm-configs/fluentbit/fluentbit-helm-overrides.yaml"
1210

13-
# Check if YAML files exist in the specified directory
14-
if compgen -G "${CONFIG_DIR}/*.yaml" > /dev/null; then
15-
# Append all YAML files from the directory to the helm command
16-
for yaml_file in "${CONFIG_DIR}"/*.yaml; do
17-
HELM_CMD+=" -f ${yaml_file}"
18-
done
19-
fi
11+
for dir in "$GLOBAL_OVERRIDES_DIR" "$SERVICE_CONFIG_DIR"; do
12+
if compgen -G "${dir}/*.yaml" > /dev/null; then
13+
for yaml_file in "${dir}"/*.yaml; do
14+
HELM_CMD+=" -f ${yaml_file}"
15+
done
16+
fi
17+
done
2018

21-
HELM_CMD+=" ${@}"
19+
HELM_CMD+=" $*"
2220

23-
# Run the helm command
2421
echo "Executing Helm command:"
2522
echo "${HELM_CMD}"
2623
eval "${HELM_CMD}"

0 commit comments

Comments
 (0)