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 | 49ec1a0 | 2018-06-18 14:03:29 -0700 | [diff] [blame^] | 26 | OPENSTACK_HELM_COMMIT="${OPENSTACK_HELM_COMMIT:-5cfa1501a2e4912860f5393e81e72f37688e919f}" |
| 27 | OPENSTACK_HELM_INFRA_BRANCH="${OPENSTACK_HELM_BRANCH:-master}" |
| 28 | OPENSTACK_HELM_INFRA_COMMIT="${OPENSTACK_HELM_INFRA_COMMIT:-b0c34c4468633af62e88a604d6e27c53343d4686}" |
| 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 | |
| 77 | cat <<EOF > /tmp/nova-cord.yaml |
| 78 | --- |
| 79 | labels: |
| 80 | api_metadata: |
| 81 | node_selector_key: openstack-helm-node-class |
| 82 | node_selector_value: primary |
| 83 | network: |
| 84 | backend: [] |
| 85 | pod: |
| 86 | replicas: |
| 87 | api_metadata: 1 |
| 88 | placement: 1 |
| 89 | osapi: 1 |
| 90 | conductor: 1 |
| 91 | consoleauth: 1 |
| 92 | scheduler: 1 |
| 93 | novncproxy: 1 |
| 94 | EOF |
| 95 | export OSH_EXTRA_HELM_ARGS_NOVA="-f /tmp/nova-cord.yaml" |
| 96 | |
| 97 | cat <<EOF > /tmp/neutron-cord.yaml |
| 98 | --- |
| 99 | images: |
| 100 | tags: |
| 101 | neutron_server: xosproject/neutron-onos:newton |
| 102 | manifests: |
| 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 |
| 109 | network: |
| 110 | backend: [] |
| 111 | interface: |
| 112 | tunnel: "eth0" |
| 113 | pod: |
| 114 | replicas: |
| 115 | server: 1 |
| 116 | conf: |
| 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 |
| 129 | EOF |
| 130 | export OSH_EXTRA_HELM_ARGS_NEUTRON="-f /tmp/neutron-cord.yaml" |
| 131 | |
| 132 | cd ~/openstack-helm |
| 133 | for STEP in $STEPS |
| 134 | do |
| 135 | ./tools/deployment/developer/ceph/"$STEP".sh |
| 136 | done |