Pawel Wieczorek | 83040df | 2019-11-29 14:56:56 +0100 | [diff] [blame] | 1 | ===================================================== |
| 2 | ONAP Integration > Bootstrap > Vagrant Minimal ONAP |
| 3 | ===================================================== |
| 4 | |
| 5 | This directory contains a set of Vagrant scripts that will automatically set up: |
| 6 | |
| 7 | - Devstack, |
Pawel Wieczorek | 60e2405 | 2020-01-13 17:20:15 +0100 | [diff] [blame] | 8 | - RKE-based Kubernetes cluster (single control plane node and single worker plane node), |
Pawel Wieczorek | 83040df | 2019-11-29 14:56:56 +0100 | [diff] [blame] | 9 | - Operator's machine with configured tools (kubectl, helm). |
| 10 | |
| 11 | This is intended to show a beginning ONAP operator how to set up and configure an environment that |
| 12 | can successfully deploy minimal ONAP instance from scratch. Its main purpose are ONAP demos and |
| 13 | proofs of concepts. It is not intended to be used as a production ONAP environment. |
| 14 | |
| 15 | NOTE: the Devstack instance is NOT SECURED, with default credentials: |
| 16 | |
| 17 | +-------+----------------+ |
| 18 | | User | Password | |
| 19 | +-------+----------------+ |
| 20 | | admin | default123456! | |
| 21 | +-------+----------------+ |
| 22 | | demo | default123456! | |
| 23 | +-------+----------------+ |
Pawel Wieczorek | 8df0be5 | 2019-12-10 17:36:14 +0100 | [diff] [blame] | 24 | |
| 25 | |
Pawel Wieczorek | 4dcf613 | 2020-01-29 17:07:13 +0100 | [diff] [blame] | 26 | Quickstart |
| 27 | ---------- |
| 28 | |
| 29 | Following set of commands can be used to prepare a machine running Ubuntu 18.04 for this setup: |
| 30 | |
| 31 | .. code-block:: sh |
| 32 | sudo sed -i'.bak' 's/^#.*deb-src/deb-src/' /etc/apt/sources.list |
| 33 | sudo apt-get update |
| 34 | sudo apt-get build-dep vagrant ruby-libvirt |
| 35 | sudo apt-get install qemu libvirt-bin ebtables dnsmasq-base |
| 36 | sudo apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev |
| 37 | |
| 38 | sudo apt-get install sshfs |
| 39 | |
| 40 | wget https://releases.hashicorp.com/vagrant/2.2.7/vagrant_2.2.7_x86_64.deb |
| 41 | sudo dpkg -i vagrant_2.2.7_x86_64.deb |
| 42 | |
| 43 | vagrant plugin install vagrant-libvirt |
| 44 | vagrant plugin install vagrant-sshfs |
| 45 | |
| 46 | sudo mv /etc/apt/sources.list{.bak,} |
| 47 | rm vagrant_2.2.7_x86_64.deb |
| 48 | |
| 49 | |
Pawel Wieczorek | 8df0be5 | 2019-12-10 17:36:14 +0100 | [diff] [blame] | 50 | Requirements |
| 51 | ------------ |
| 52 | |
Pawel Wieczorek | 794a397 | 2020-02-03 16:20:47 +0100 | [diff] [blame] | 53 | +-------------+-----+-------+---------+ |
| 54 | | Machine | CPU | RAM | Storage | |
| 55 | +-------------+-----+-------+---------+ |
| 56 | | Operator | 1 | 1GiB | 32GiB | |
| 57 | +-------------+-----+-------+---------+ |
| 58 | | Devstack | 1 | 4GiB | 32GiB | |
| 59 | +-------------+-----+-------+---------+ |
| 60 | | K8s Control | 1 | 1GiB | 32GiB | |
| 61 | +-------------+-----+-------+---------+ |
| 62 | | K8s Worker | 8 | 64GiB | 64GiB | |
| 63 | +-------------+-----+-------+---------+ |
| 64 | | TOTAL | 11 | 70GiB | 160GiB | |
| 65 | +-------------+-----+-------+---------+ |
Pawel Wieczorek | 8df0be5 | 2019-12-10 17:36:14 +0100 | [diff] [blame] | 66 | |
| 67 | Table above is based on current experience and may be subject to change. |
| 68 | |
| 69 | |
| 70 | Prerequisites |
| 71 | ------------- |
| 72 | |
| 73 | Virtualisation provider |
| 74 | ~~~~~~~~~~~~~~~~~~~~~~~ |
| 75 | |
| 76 | Environment has been tested using libvirt_ provider with vagrant-libvirt_ plugin. Plugin |
| 77 | documentation provides detailed `installation instructions`_ that will guide through the process. |
| 78 | |
| 79 | .. note:: |
| 80 | Remember to uncomment `deb-src` repositories for `apt-get build-dep` step on Debian/Ubuntu. |
| 81 | |
| 82 | .. _libvirt: https://libvirt.org |
| 83 | .. _vagrant-libvirt: https://github.com/vagrant-libvirt/vagrant-libvirt |
| 84 | .. _`installation instructions`: https://github.com/vagrant-libvirt/vagrant-libvirt#installation |
| 85 | |
| 86 | Virtual machine manager |
| 87 | ~~~~~~~~~~~~~~~~~~~~~~~ |
| 88 | |
| 89 | Environment has been tested using latest Vagrant_ as of writing this documentation (`v2.2.6`_). Some |
| 90 | features (e.g. triggers_) might not be supported on older versions. |
| 91 | |
| 92 | .. _Vagrant: https://www.vagrantup.com/downloads.html |
| 93 | .. _`v2.2.6`: https://github.com/hashicorp/vagrant/blob/v2.2.6/CHANGELOG.md#226-october-14-2019 |
| 94 | .. _triggers: https://www.vagrantup.com/docs/triggers/ |
| 95 | |
Pawel Wieczorek | 228c62e | 2020-01-23 17:20:49 +0100 | [diff] [blame] | 96 | Synced Folders |
| 97 | ~~~~~~~~~~~~~~ |
| 98 | |
| 99 | Environment uses reverse-SSHFS-based file synchronization for applying non-upstream changes. This |
| 100 | requires installing vagrant-sshfs_ plugin and presence of `sshfs` package on the host system. |
| 101 | |
| 102 | .. _vagrant-sshfs: https://github.com/dustymabe/vagrant-sshfs#install-plugin |
| 103 | |
Pawel Wieczorek | 8df0be5 | 2019-12-10 17:36:14 +0100 | [diff] [blame] | 104 | |
| 105 | Running |
| 106 | ------- |
| 107 | |
| 108 | Additional `--provider` flag or setting `VAGRANT_DEFAULT_PROVIDER` environmental variable might be |
| 109 | useful in case there are multiple providers available. |
| 110 | |
| 111 | .. note:: |
| 112 | Following command should be executed within the directory where `Vagrantfile` is stored |
| 113 | (`integration/bootstrap/vagrant-minimal-onap`). |
| 114 | |
| 115 | .. code-block:: sh |
| 116 | vagrant up --provider=libvirt |
Pawel Wieczorek | 60e2405 | 2020-01-13 17:20:15 +0100 | [diff] [blame] | 117 | |
| 118 | |
| 119 | Usage |
| 120 | ----- |
| 121 | |
| 122 | Once ready (bringing up machines might initially take some time), tools for cluster management will |
| 123 | be available on Operator's machine. It can be accessed by executing: |
| 124 | |
| 125 | .. code-block:: sh |
| 126 | vagrant ssh operator |
| 127 | |
| 128 | Although appropriate context is set for `kubectl` on login, when interacting with the cluster the |
Pawel Wieczorek | 794a397 | 2020-02-03 16:20:47 +0100 | [diff] [blame] | 129 | `onap` namespace has to be explicitly specified. Example: |
| 130 | |
| 131 | .. code-block:: sh |
| 132 | # Operator's machine shell |
| 133 | kubectl -nonap get pods |