blob: 1315a00e87a9577090ddca03c8d99501d6411e02 [file] [log] [blame]
Pawel Wieczorek83040df2019-11-29 14:56:56 +01001=====================================================
2 ONAP Integration > Bootstrap > Vagrant Minimal ONAP
3=====================================================
4
5This directory contains a set of Vagrant scripts that will automatically set up:
6
7- Devstack,
Pawel Wieczorek60e24052020-01-13 17:20:15 +01008- RKE-based Kubernetes cluster (single control plane node and single worker plane node),
Pawel Wieczorek83040df2019-11-29 14:56:56 +01009- Operator's machine with configured tools (kubectl, helm).
10
11This is intended to show a beginning ONAP operator how to set up and configure an environment that
12can successfully deploy minimal ONAP instance from scratch. Its main purpose are ONAP demos and
13proofs of concepts. It is not intended to be used as a production ONAP environment.
14
15NOTE: the Devstack instance is NOT SECURED, with default credentials:
16
17+-------+----------------+
18| User | Password |
19+-------+----------------+
20| admin | default123456! |
21+-------+----------------+
22| demo | default123456! |
23+-------+----------------+
Pawel Wieczorek8df0be52019-12-10 17:36:14 +010024
25
Pawel Wieczorek4dcf6132020-01-29 17:07:13 +010026Quickstart
27----------
28
29Following 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 Wieczorek8df0be52019-12-10 17:36:14 +010050Requirements
51------------
52
Pawel Wieczorek794a3972020-02-03 16:20:47 +010053+-------------+-----+-------+---------+
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 Wieczorek8df0be52019-12-10 17:36:14 +010066
67Table above is based on current experience and may be subject to change.
68
69
70Prerequisites
71-------------
72
73Virtualisation provider
74~~~~~~~~~~~~~~~~~~~~~~~
75
76Environment has been tested using libvirt_ provider with vagrant-libvirt_ plugin. Plugin
77documentation 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
86Virtual machine manager
87~~~~~~~~~~~~~~~~~~~~~~~
88
89Environment has been tested using latest Vagrant_ as of writing this documentation (`v2.2.6`_). Some
90features (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 Wieczorek228c62e2020-01-23 17:20:49 +010096Synced Folders
97~~~~~~~~~~~~~~
98
99Environment uses reverse-SSHFS-based file synchronization for applying non-upstream changes. This
100requires 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 Wieczorek8df0be52019-12-10 17:36:14 +0100104
105Running
106-------
107
108Additional `--provider` flag or setting `VAGRANT_DEFAULT_PROVIDER` environmental variable might be
109useful 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 Wieczorek60e24052020-01-13 17:20:15 +0100117
118
119Usage
120-----
121
122Once ready (bringing up machines might initially take some time), tools for cluster management will
123be available on Operator's machine. It can be accessed by executing:
124
125.. code-block:: sh
126 vagrant ssh operator
127
128Although appropriate context is set for `kubectl` on login, when interacting with the cluster the
Pawel Wieczorek794a3972020-02-03 16:20:47 +0100129`onap` namespace has to be explicitly specified. Example:
130
131.. code-block:: sh
132 # Operator's machine shell
133 kubectl -nonap get pods