-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun.ps1
43 lines (38 loc) · 1.26 KB
/
run.ps1
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
$open_weather_id=$args[0]
$new_relic_url=$args[1]
$new_relic_key=$args[2]
$install_istio_addons=[bool]$args[3]
if ( -not $open_weather_id ) {
Write-Output "Error: You need to provide an open weather api key"
exit
}
if ( -not $new_relic_url ) {
Write-Output "Error: You need to provide the new relic logging url"
exit
}
if ( -not $new_relic_key ) {
Write-Output "Error: You need to provide a new relic api key"
exit
}
try {
istioctl install -y
if ( $install_istio_addons ) {
kubectl apply -f https://github.com/istio/istio/raw/master/samples/addons/jaeger.yaml
kubectl apply -f https://github.com/istio/istio/raw/master/samples/addons/prometheus.yaml
kubectl apply -f https://github.com/istio/istio/raw/master/samples/addons/grafana.yaml
kubectl apply -f https://github.com/istio/istio/raw/master/samples/addons/kiali.yaml
}
}
catch {
Write-Output "Error: You don't have Istio or/and Kubectl installed"
exit
}
try {
helm upgrade --install -f ./charts/values.istio.yaml grpc charts `
--set weatherService.openWeatherId=$open_weather_id `
--set newRelic.apiKey=$new_relic_key `
--set newRelic.baseUrl=$new_relic_url
}
catch {
Write-Output "Error: You don't have helm charts installed"
}