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}" |
| 26 | |
| 27 | # openstack-helm steps to execute |
| 28 | 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" |
| 29 | |
| 30 | |
| 31 | # Set up extra disk space if running on CloudLab |
| 32 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 33 | if [ -d /usr/local/etc/emulab ] |
| 34 | then |
| 35 | sudo delgroup docker || true |
| 36 | "$DIR"/cloudlab-disk-setup.sh |
| 37 | fi |
| 38 | |
| 39 | cd ~ |
| 40 | [ ! -e openstack-helm-infra ] && git clone https://git.openstack.org/openstack/openstack-helm-infra.git -b "${OPENSTACK_HELM_BRANCH}" |
| 41 | [ ! -e openstack-helm ] && git clone https://git.openstack.org/openstack/openstack-helm.git -b "${OPENSTACK_HELM_BRANCH}" |
| 42 | |
| 43 | # Customizations for CORD |
| 44 | cat <<EOF > /tmp/glance-cord.yaml |
| 45 | --- |
| 46 | network: |
| 47 | api: |
| 48 | ingress: |
| 49 | annotations: |
| 50 | nginx.ingress.kubernetes.io/proxy-body-size: "0" |
| 51 | EOF |
| 52 | export OSH_EXTRA_HELM_ARGS_GLANCE="-f /tmp/glance-cord.yaml" |
| 53 | |
| 54 | cat <<EOF > /tmp/nova-cord.yaml |
| 55 | --- |
| 56 | labels: |
| 57 | api_metadata: |
| 58 | node_selector_key: openstack-helm-node-class |
| 59 | node_selector_value: primary |
| 60 | network: |
| 61 | backend: [] |
| 62 | pod: |
| 63 | replicas: |
| 64 | api_metadata: 1 |
| 65 | placement: 1 |
| 66 | osapi: 1 |
| 67 | conductor: 1 |
| 68 | consoleauth: 1 |
| 69 | scheduler: 1 |
| 70 | novncproxy: 1 |
| 71 | EOF |
| 72 | export OSH_EXTRA_HELM_ARGS_NOVA="-f /tmp/nova-cord.yaml" |
| 73 | |
| 74 | cat <<EOF > /tmp/neutron-cord.yaml |
| 75 | --- |
| 76 | images: |
| 77 | tags: |
| 78 | neutron_server: xosproject/neutron-onos:newton |
| 79 | manifests: |
| 80 | daemonset_dhcp_agent: false |
| 81 | daemonset_l3_agent: false |
| 82 | daemonset_lb_agent: false |
| 83 | daemonset_metadata_agent: false |
| 84 | daemonset_ovs_agent: false |
| 85 | daemonset_sriov_agent: false |
| 86 | network: |
| 87 | backend: [] |
| 88 | interface: |
| 89 | tunnel: "eth0" |
| 90 | pod: |
| 91 | replicas: |
| 92 | server: 1 |
| 93 | conf: |
| 94 | plugins: |
| 95 | ml2_conf: |
| 96 | ml2: |
| 97 | type_drivers: vxlan |
| 98 | tenant_network_types: vxlan |
| 99 | mechanism_drivers: onos_ml2 |
| 100 | ml2_type_vxlan: |
| 101 | vni_ranges: 1001:2000 |
| 102 | onos: |
| 103 | url_path: http://onos-cord-ui.default.svc.cluster.local:8181/onos/cordvtn |
| 104 | username: onos |
| 105 | password: rocks |
| 106 | EOF |
| 107 | export OSH_EXTRA_HELM_ARGS_NEUTRON="-f /tmp/neutron-cord.yaml" |
| 108 | |
| 109 | cd ~/openstack-helm |
| 110 | for STEP in $STEPS |
| 111 | do |
| 112 | ./tools/deployment/developer/ceph/"$STEP".sh |
| 113 | done |