|
1 | 1 | #!/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 |
0 commit comments