Minor fix for RANPM
[nonrtric/plt/ranpm.git] / install / install-pm-connect.sh
1 #!/bin/bash
2
3 #  ============LICENSE_START===============================================
4 #  Copyright (C) 2023 Nordix Foundation. All rights reserved.
5 #  ========================================================================
6 #  Licensed under the Apache License, Version 2.0 (the "License");
7 #  you may not use this file except in compliance with the License.
8 #  You may obtain a copy of the License at
9 #
10 #       http://www.apache.org/licenses/LICENSE-2.0
11 #
12 #  Unless required by applicable law or agreed to in writing, software
13 #  distributed under the License is distributed on an "AS IS" BASIS,
14 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 #  See the License for the specific language governing permissions and
16 #  limitations under the License.
17 #  ============LICENSE_END=================================================
18 #
19
20 . scripts/get_influxdb2_token.sh
21 . scripts/create_influxdb2_bucket.sh
22
23 echo "Installing: pm connect"
24 echo " Retriving influxdb2 access token..."
25 export INFLUXDB2_TOKEN=$(get_influxdb2_token influxdb2-0 nonrtric)
26
27 echo "influxdb2_connection_bean=#class:com.influxdb.client.InfluxDBClientFactory#create('http://influxdb2.nonrtric:8086', '$INFLUXDB2_TOKEN')" > .tmp.decode.input
28 export PM_KAFKA_CONNECT_BEAN=$(base64 -i .tmp.decode.input)
29
30 envsubst '${PM_KAFKA_CONNECT_BEAN}' < helm/nrt-pm-kafka-connect/values-template.yaml > helm/nrt-pm-kafka-connect/values.yaml
31
32 bucket=ts_pms_metrics
33 echo "Creating bucket $bucket in influxdb2"
34 create_influxdb2_bucket influxdb2-0 nonrtric $bucket
35
36 echo " helm install..."
37 helm install -n nonrtric nrt-pm-kafka-connect helm/nrt-pm-kafka-connect
38
39 echo "done"
40