-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.sh
More file actions
56 lines (50 loc) · 1.31 KB
/
deploy.sh
File metadata and controls
56 lines (50 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
NAMESPACE=tracing
CHART_VERSION=0.117.1
APPLICATION="opentelemetry-collector"
ENVIRONMENT=`kubectl config current-context | cut -d- -f1`
DEPLOY=false
TEMPLATE=false
while getopts "dt" arg; do
case $arg in
d)
echo "-d was triggered, Deploying"
DEPLOY=true
;;
t)
echo "-t was triggered, Rendering template"
TEMPLATE=true
;;
*)
echo "Showing differences"
;;
esac
done
echo "Environment is ${ENVIRONMENT}"
if [ ${DEPLOY} == "true" ]
then
ACTION="Upgrading"
COMMAND="upgrade"
FLAGS="--atomic --wait --timeout 300s --install ${APPLICATION}"
elif [ ${TEMPLATE} == true ]
then
ACTION="Rendering template"
COMMAND="template ${APPLICATION}"
FLAGS=""
else
ACTION="Showing differences of"
COMMAND="diff upgrade --install ${APPLICATION}"
FLAGS="-C 1"
fi
echo "${ACTION} ${APPLICATION} in namespace ${NAMESPACE}..."
# Adddd helm repository
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo update
# install opentelemetry chart
helm ${COMMAND} \
${OTEL_PROCESSOR} \
--namespace=${NAMESPACE} \
${FLAGS} \
-f values.yaml \
-f values.${ENVIRONMENT}.yaml \
open-telemetry/opentelemetry-collector --version ${CHART_VERSION}