Andy Bavier | 188aff1 | 2018-05-18 05:43:55 -0700 | [diff] [blame] | 1 | #!/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 | |
| 22 | set -xe |
| 23 | |
| 24 | # CORD versioning |
| 25 | OPENSTACK_HELM_BRANCH="${OPENSTACK_HELM_BRANCH:-master}" |
Andy Bavier | ead6be6 | 2018-07-03 09:05:42 -0700 | [diff] [blame] | 26 | OPENSTACK_HELM_COMMIT="${OPENSTACK_HELM_COMMIT:-79128a94fc4c7e7b301497abeab094fa01efaa06}" |
Andy Bavier | 49ec1a0 | 2018-06-18 14:03:29 -0700 | [diff] [blame] | 27 | OPENSTACK_HELM_INFRA_BRANCH="${OPENSTACK_HELM_BRANCH:-master}" |
Andy Bavier | ead6be6 | 2018-07-03 09:05:42 -0700 | [diff] [blame] | 28 | OPENSTACK_HELM_INFRA_COMMIT="${OPENSTACK_HELM_INFRA_COMMIT:-5d622a806e09e19c15189081299dc3155916550b}" |
Andy Bavier | 49ec1a0 | 2018-06-18 14:03:29 -0700 | [diff] [blame] | 29 | |
Andy Bavier | 188aff1 | 2018-05-18 05:43:55 -0700 | [diff] [blame] | 30 | |
| 31 | # openstack-helm steps to execute |
| 32 | STEPS="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 |
| 36 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 37 | if [ -d /usr/local/etc/emulab ] |
| 38 | then |
| 39 | sudo delgroup docker || true |
| 40 | "$DIR"/cloudlab-disk-setup.sh |
| 41 | fi |
| 42 | |
Andy Bavier | 49ec1a0 | 2018-06-18 14:03:29 -0700 | [diff] [blame] | 43 | if [ ! -e ~/openstack-helm-infra ] |
| 44 | then |
| 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 |
| 52 | fi |
| 53 | |
| 54 | if [ ! -e ~/openstack-helm ] |
| 55 | then |
| 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 |
| 64 | fi |
Andy Bavier | 188aff1 | 2018-05-18 05:43:55 -0700 | [diff] [blame] | 65 | |
| 66 | # Customizations for CORD |
| 67 | cat <<EOF > /tmp/glance-cord.yaml |
| 68 | --- |
| 69 | network: |
| 70 | api: |
| 71 | ingress: |
| 72 | annotations: |
| 73 | nginx.ingress.kubernetes.io/proxy-body-size: "0" |
| 74 | EOF |
| 75 | export OSH_EXTRA_HELM_ARGS_GLANCE="-f /tmp/glance-cord.yaml" |
| 76 | |
Andy Bavier | ead6be6 | 2018-07-03 09:05:42 -0700 | [diff] [blame] | 77 | cat <<EOF > /tmp/libvirt-cord.yaml |
| 78 | --- |
| 79 | network: |
| 80 | backend: [] |
| 81 | EOF |
| 82 | export OSH_EXTRA_HELM_ARGS_LIBVIRT="-f /tmp/libvirt-cord.yaml" |
| 83 | |
Andy Bavier | 188aff1 | 2018-05-18 05:43:55 -0700 | [diff] [blame] | 84 | cat <<EOF > /tmp/nova-cord.yaml |
| 85 | --- |
| 86 | labels: |
| 87 | api_metadata: |
| 88 | node_selector_key: openstack-helm-node-class |
| 89 | node_selector_value: primary |
| 90 | network: |
| 91 | backend: [] |
| 92 | pod: |
| 93 | replicas: |
| 94 | api_metadata: 1 |
| 95 | placement: 1 |
| 96 | osapi: 1 |
| 97 | conductor: 1 |
| 98 | consoleauth: 1 |
| 99 | scheduler: 1 |
| 100 | novncproxy: 1 |
| 101 | EOF |
| 102 | export OSH_EXTRA_HELM_ARGS_NOVA="-f /tmp/nova-cord.yaml" |
| 103 | |
| 104 | cat <<EOF > /tmp/neutron-cord.yaml |
| 105 | --- |
| 106 | images: |
| 107 | tags: |
| 108 | neutron_server: xosproject/neutron-onos:newton |
| 109 | manifests: |
| 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 |
| 116 | network: |
| 117 | backend: [] |
| 118 | interface: |
| 119 | tunnel: "eth0" |
| 120 | pod: |
| 121 | replicas: |
| 122 | server: 1 |
| 123 | conf: |
| 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 |
| 136 | EOF |
| 137 | export OSH_EXTRA_HELM_ARGS_NEUTRON="-f /tmp/neutron-cord.yaml" |
| 138 | |
| 139 | cd ~/openstack-helm |
| 140 | for STEP in $STEPS |
| 141 | do |
| 142 | ./tools/deployment/developer/ceph/"$STEP".sh |
| 143 | done |