2 # ================================================================================
3 # Copyright (c) 2018 Cisco Systems. All rights reserved.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ============LICENSE_END=========================================================
18 # Install PNDA in Openstack with Heat templates
20 # Input files for components to be installed in /inputs
22 if [ "z{{ .Values.enabled }}" != "ztrue" ]
25 echo "PNDA bootstrap is disabled - skipping pnda-cli launch"
32 CLUSTER_PREFIX="{{ .Release.Name }}-{{ include "common.namespace" . }}-pnda"
33 DATANODES="{{ .Values.pnda.dataNodes }}"
34 KAFKANODES="{{ .Values.pnda.kafkaNodes }}"
35 VERSION="{{ .Values.pnda.version }}"
36 KEYPAIR_NAME="{{ .Values.pnda_keypair_name }}"
37 KEYFILE="$KEYPAIR_NAME.pem"
41 cp /inputs/pnda_env.yaml .
42 cp /secrets/pnda.pem $KEYFILE
45 (cd tools && ./gen-certs.py)
47 KUBE_API="https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT_HTTPS/api/v1"
48 KUBE_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
50 for i in 1 2 3 4 5 6 7 8 9
52 MIRROR_IP=$(curl -s $KUBE_API/namespaces/{{ include "common.namespace" . }}/services/dcae-pnda-mirror \
53 --header "Authorization: Bearer $KUBE_TOKEN" \
54 --insecure | jq -r '.status.loadBalancer.ingress[0].ip')
56 if [ "$MIRROR_IP" != "null" ]; then
62 PNDA_MIRROR="http://$MIRROR_IP:80"
64 sed -i -e 's?CLIENT_IP/32?CLIENT_IP?' bootstrap-scripts/package-install.sh
66 ./cli/pnda-cli.py create -e $CLUSTER_PREFIX -f pico -n $DATANODES -k $KAFKANODES \
67 -b $VERSION -s $KEYPAIR_NAME --set "mirrors.PNDA_MIRROR=$PNDA_MIRROR"