align Rancher/k8s with 1.6.22 post RC1
[logging-analytics.git] / deploy / rancher / oom_entrypoint.sh
1 #!/bin/bash
2 #############################################################################
3 #
4 # Copyright © 2018 Amdocs.
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/LOG-325
24 # Michael O'Brien
25 #
26 # Amsterdam
27 #     Rancher 1.6.10, Kubernetes 1.7.7, Kubectl 1.7.7, Helm 2.3.0, Docker 1.12
28 # master (casablanca : RC2)
29 #     Rancher 1.6.22, Kubernetes 1.11.2, Kubectl 1.11.2, Helm 2.9.2, Docker 17.03
30 # run as root - because of the logout that would be required after the docker user set
31
32 usage() {
33 cat <<EOF
34 Usage: $0 [PARAMs]
35 -u                  : Display usage
36 -b [branch]         : branch = master or amsterdam (required)
37 -s [server]         : server = IP or DNS name (required)
38 -e [environment]    : use the default (onap)
39 EOF
40 }
41
42 install_rancher_and_onap() {
43   echo "Running rancher install first - 25 min"
44   wget https://git.onap.org/logging-analytics/plain/deploy/rancher/oom_rancher_setup.sh
45   sudo chmod 777 oom_rancher_setup.sh
46   sudo ./oom_rancher_setup.sh -b $BRANCH -s $SERVER -e $ENVIRON
47   echo "Running oom install - 45-90 min - 120 pod limit per vm"
48   wget https://git.onap.org/logging-analytics/plain/deploy/cd.sh
49   sudo chmod 777 cd.sh
50   wget https://jira.onap.org/secure/attachment/11124/aaiapisimpledemoopenecomporg.cer
51   if [ "$BRANCH" == "amsterdam" ]; then
52     wget https://jira.onap.org/secure/attachment/11218/onap-parameters-amsterdam.yaml
53     sudo cp onap-parameters-amsterdam.yaml onap-parameters.yaml
54   else
55     wget https://jira.onap.org/secure/attachment/11414/values.yaml
56   fi
57   wget https://jira.onap.org/secure/attachment/11126/aai-cloud-region-put.json
58   sudo ./cd.sh -b $BRANCH -e $ENVIRON
59 }
60
61 BRANCH=master
62 SERVER=
63 ENVIRON=onap
64
65 while getopts ":b:s:e:u:" PARAM; do
66   case $PARAM in
67     u)
68       usage
69       exit 1
70       ;;
71     b)
72       BRANCH=${OPTARG}
73       ;;
74     e)
75       ENVIRON=${OPTARG}
76       ;;
77     s)
78       SERVER=${OPTARG}
79       ;;
80     ?)
81       usage
82       exit
83       ;;
84   esac
85 done
86
87 if [[ -z $SERVER ]]; then
88   usage
89   exit 1
90 fi
91
92 install_rancher_and_onap $BRANCH $SERVER $ENVIRON