blob: fdb66b5503c562158fefda204109e70e731b8ddf [file] [log] [blame]
Zack Williamsf0b8e942019-07-23 16:21:28 -07001#!/usr/bin/env bash
Andy Bavier188aff12018-05-18 05:43:55 -07002#
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 Bavieread6be62018-07-03 09:05:42 -070026OPENSTACK_HELM_COMMIT="${OPENSTACK_HELM_COMMIT:-79128a94fc4c7e7b301497abeab094fa01efaa06}"
Andy Bavier49ec1a02018-06-18 14:03:29 -070027OPENSTACK_HELM_INFRA_BRANCH="${OPENSTACK_HELM_BRANCH:-master}"
Andy Bavieread6be62018-07-03 09:05:42 -070028OPENSTACK_HELM_INFRA_COMMIT="${OPENSTACK_HELM_INFRA_COMMIT:-5d622a806e09e19c15189081299dc3155916550b}"
Andy Bavier49ec1a02018-06-18 14:03:29 -070029
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
Hyunsun Moon81c8e232019-05-21 03:40:22 -060040 "$DIR"/../scripts/cloudlab-disksetup.sh
Andy Bavier188aff12018-05-18 05:43:55 -070041fi
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}"
Zack Williamsf0b8e942019-07-23 16:21:28 -070047 if [ -n "${OPENSTACK_HELM_INFRA_COMMIT}" ]
Andy Bavier49ec1a02018-06-18 14:03:29 -070048 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}"
Zack Williamsf0b8e942019-07-23 16:21:28 -070058 if [ -n "${OPENSTACK_HELM_COMMIT}" ]
Andy Bavier49ec1a02018-06-18 14:03:29 -070059 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
Andy Bavieread6be62018-07-03 09:05:42 -070077cat <<EOF > /tmp/libvirt-cord.yaml
78---
79network:
80 backend: []
81EOF
82export OSH_EXTRA_HELM_ARGS_LIBVIRT="-f /tmp/libvirt-cord.yaml"
83
Andy Bavier188aff12018-05-18 05:43:55 -070084cat <<EOF > /tmp/nova-cord.yaml
85---
86labels:
87 api_metadata:
88 node_selector_key: openstack-helm-node-class
89 node_selector_value: primary
90network:
91 backend: []
92pod:
93 replicas:
94 api_metadata: 1
95 placement: 1
96 osapi: 1
97 conductor: 1
98 consoleauth: 1
99 scheduler: 1
100 novncproxy: 1
101EOF
102export OSH_EXTRA_HELM_ARGS_NOVA="-f /tmp/nova-cord.yaml"
103
104cat <<EOF > /tmp/neutron-cord.yaml
105---
106images:
107 tags:
108 neutron_server: xosproject/neutron-onos:newton
109manifests:
110 daemonset_dhcp_agent: false
111 daemonset_l3_agent: false
112 daemonset_lb_agent: false
113 daemonset_metadata_agent: false
114 daemonset_ovs_agent: false
115 daemonset_sriov_agent: false
116network:
117 backend: []
118 interface:
119 tunnel: "eth0"
120pod:
121 replicas:
122 server: 1
123conf:
124 plugins:
125 ml2_conf:
126 ml2:
127 type_drivers: vxlan
128 tenant_network_types: vxlan
129 mechanism_drivers: onos_ml2
130 ml2_type_vxlan:
131 vni_ranges: 1001:2000
132 onos:
133 url_path: http://onos-cord-ui.default.svc.cluster.local:8181/onos/cordvtn
134 username: onos
135 password: rocks
136EOF
137export OSH_EXTRA_HELM_ARGS_NEUTRON="-f /tmp/neutron-cord.yaml"
138
139cd ~/openstack-helm
140for STEP in $STEPS
141do
142 ./tools/deployment/developer/ceph/"$STEP".sh
143done