blob: 50d9f26bddf5d8a499158b0480b8c791deafca7a [file] [log] [blame]
Andy Bavier188aff12018-05-18 05:43:55 -07001#!/bin/bash
2#
3# Copyright 2017-present Open Networking Foundation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
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# Install openstack-helm dev setup on Ubuntu 16.04 server #
19# Including customizations to Neutron for CORD #
20###########################################################
21
22set -xe
23
24# CORD versioning
25OPENSTACK_HELM_BRANCH="${OPENSTACK_HELM_BRANCH:-master}"
Andy Bavier49ec1a02018-06-18 14:03:29 -070026OPENSTACK_HELM_COMMIT="${OPENSTACK_HELM_COMMIT:-5cfa1501a2e4912860f5393e81e72f37688e919f}"
27OPENSTACK_HELM_INFRA_BRANCH="${OPENSTACK_HELM_BRANCH:-master}"
28OPENSTACK_HELM_INFRA_COMMIT="${OPENSTACK_HELM_INFRA_COMMIT:-b0c34c4468633af62e88a604d6e27c53343d4686}"
29
Andy Bavier188aff12018-05-18 05:43:55 -070030
31# openstack-helm steps to execute
32STEPS="000-install-packages 010-deploy-k8s 020-setup-client 030-ingress 040-ceph 045-ceph-ns-activate 050-mariadb 060-rabbitmq 070-memcached 080-keystone 090-heat 110-ceph-radosgateway 120-glance 140-openvswitch 150-libvirt 160-compute-kit"
33
34
35# Set up extra disk space if running on CloudLab
36DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
37if [ -d /usr/local/etc/emulab ]
38then
39 sudo delgroup docker || true
40 "$DIR"/cloudlab-disk-setup.sh
41fi
42
Andy Bavier49ec1a02018-06-18 14:03:29 -070043if [ ! -e ~/openstack-helm-infra ]
44then
45 cd ~
46 git clone https://git.openstack.org/openstack/openstack-helm-infra.git -b "${OPENSTACK_HELM_INFRA_BRANCH}"
47 if [ ! -z "${OPENSTACK_HELM_INFRA_COMMIT}" ]
48 then
49 cd openstack-helm-infra
50 git reset --hard "${OPENSTACK_HELM_INFRA_COMMIT}"
51 fi
52fi
53
54if [ ! -e ~/openstack-helm ]
55then
56 cd ~
57 git clone https://git.openstack.org/openstack/openstack-helm.git -b "${OPENSTACK_HELM_BRANCH}"
58 if [ ! -z "${OPENSTACK_HELM_COMMIT}" ]
59 then
60 cd openstack-helm
61 git reset --hard "${OPENSTACK_HELM_COMMIT}"
62 fi
63 sed -i 's/--remote=db:Open_vSwitch,Open_vSwitch,manager_options/--remote=db:Open_vSwitch,Open_vSwitch,manager_options --remote=ptcp:6641/' ~/openstack-helm/openvswitch/templates/bin/_openvswitch-db-server.sh.tpl
64fi
Andy Bavier188aff12018-05-18 05:43:55 -070065
66# Customizations for CORD
67cat <<EOF > /tmp/glance-cord.yaml
68---
69network:
70 api:
71 ingress:
72 annotations:
73 nginx.ingress.kubernetes.io/proxy-body-size: "0"
74EOF
75export OSH_EXTRA_HELM_ARGS_GLANCE="-f /tmp/glance-cord.yaml"
76
77cat <<EOF > /tmp/nova-cord.yaml
78---
79labels:
80 api_metadata:
81 node_selector_key: openstack-helm-node-class
82 node_selector_value: primary
83network:
84 backend: []
85pod:
86 replicas:
87 api_metadata: 1
88 placement: 1
89 osapi: 1
90 conductor: 1
91 consoleauth: 1
92 scheduler: 1
93 novncproxy: 1
94EOF
95export OSH_EXTRA_HELM_ARGS_NOVA="-f /tmp/nova-cord.yaml"
96
97cat <<EOF > /tmp/neutron-cord.yaml
98---
99images:
100 tags:
101 neutron_server: xosproject/neutron-onos:newton
102manifests:
103 daemonset_dhcp_agent: false
104 daemonset_l3_agent: false
105 daemonset_lb_agent: false
106 daemonset_metadata_agent: false
107 daemonset_ovs_agent: false
108 daemonset_sriov_agent: false
109network:
110 backend: []
111 interface:
112 tunnel: "eth0"
113pod:
114 replicas:
115 server: 1
116conf:
117 plugins:
118 ml2_conf:
119 ml2:
120 type_drivers: vxlan
121 tenant_network_types: vxlan
122 mechanism_drivers: onos_ml2
123 ml2_type_vxlan:
124 vni_ranges: 1001:2000
125 onos:
126 url_path: http://onos-cord-ui.default.svc.cluster.local:8181/onos/cordvtn
127 username: onos
128 password: rocks
129EOF
130export OSH_EXTRA_HELM_ARGS_NEUTRON="-f /tmp/neutron-cord.yaml"
131
132cd ~/openstack-helm
133for STEP in $STEPS
134do
135 ./tools/deployment/developer/ceph/"$STEP".sh
136done