upgrade rancher/k8s to 1.6.25
[logging-analytics.git] / deploy / azure / oom_deployment.sh
1 #!/bin/bash
2 #############################################################################
3 #
4 # Copyright © 2018 Amdocs. 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 #        http://www.apache.org/licenses/LICENSE-2.0
10 #
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 #
17 #############################################################################
18 #
19 # This installation is for a rancher managed install of kubernetes
20 # after this run the standard oom install
21 # this installation can be run on amy ubuntu 16.04 VM or physical host
22 # https://wiki.onap.org/display/DW/ONAP+on+Kubernetes
23 # source from https://jira.onap.org/browse/OOM-715
24 # Michael O'Brien
25 # amsterdam
26 #     Rancher 1.6.10, Kubernetes 1.7.7, Kubectl 1.7.7, Helm 2.3.0, Docker 1.12
27 # beijing
28 #     Rancher 1.6.14, Kubernetes 1.8.10, Kubectl 1.8.10, Helm 2.8.2, Docker 17.03
29 # casablanca (until RC1)
30 #     Rancher 1.6.18, Kubernetes 1.10.3, Kubectl 1.10.3, Helm 2.9.2, Docker 17.03
31 # casablanca - integration change alignment for INT-586 - 29th Oct via LOG-806
32 #     Rancher 1.6.22, Kubernetes 1.11.2, kubectl 1.11.2, Helm 2.9.2, Docker 17.03
33 # master/dublin - LOG-895
34 #     Rancher 1.6.25, Kubernetes 1.11.3, kubectl 1.11.3, Helm 2.9.2, Docker 17.03
35 # run as root - because of the logout that would be required after the docker user set
36 # 10249-10255 security is provided by rancher oauth RBAC via github - use this instead of port level control in the NSG
37 # https://wiki.onap.org/display/DW/Cloud+Native+Deployment#CloudNativeDeployment-Security
38 usage() {
39 cat <<EOF
40 Usage: $0 [PARAMs]
41 -u                  : Display usage
42 -b [branch]         : branch = master or amsterdam (required)
43 -s [server]         : server = IP or DNS name (required)
44 -e [environment]    : use the default (onap)
45 -r [resourcegroup]  : ARM resource group name
46 -t [template]       : ARM template file
47 -p [parameters]     : ARM parameters file
48 EOF
49 }
50
51 install_onap() {
52   az group delete --name $RESOURCE_GROUP -y
53   az group create --name $RESOURCE_GROUP --location eastus2
54   az group deployment create --resource-group $RESOURCE_GROUP --template-file $TEMPLATE --parameters @$PARAMETERS 
55 }
56
57
58 BRANCH=
59 SERVER=
60 ENVIRON=
61 RESOURCE_GROUP=
62 TEMPLATE=
63 PARAMETERS=
64 while getopts ":b:s:e:r:t:p:u:" PARAM; do
65   case $PARAM in
66     u)
67       usage
68       exit 1
69       ;;
70     b)
71       BRANCH=${OPTARG}
72       ;;
73     e)
74       ENVIRON=${OPTARG}
75       ;;
76     s)
77       SERVER=${OPTARG}
78       ;;
79     r)
80       RESOURCE_GROUP=${OPTARG}
81       ;;
82     t)
83       TEMPLATE=${OPTARG}
84       ;;
85     p)
86       PARAMETERS=${OPTARG}
87       ;;
88     ?)
89       usage
90       exit
91       ;;
92     esac
93 done
94
95 if [[ -z $BRANCH ]]; then
96   usage
97   exit 1
98 fi
99
100 install_onap $RESOURCE_GROUP $TEMPLATE $BRANCH $SERVER $ENVIRON $PARAMETERS