update link to upper-constraints.txt
[integration.git] / bootstrap / vagrant-minimal-onap / README.rst
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,
8 - RKE-based Kubernetes cluster (single control plane node and single worker plane node),
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 +-------+----------------+
24
25
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
33    sudo sed -i'.bak' 's/^#.*deb-src/deb-src/' /etc/apt/sources.list
34    sudo apt-get update
35    sudo apt-get build-dep vagrant ruby-libvirt
36    sudo apt-get install qemu libvirt-bin ebtables dnsmasq-base
37    sudo apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
38
39    sudo apt-get install sshfs
40
41    wget https://releases.hashicorp.com/vagrant/2.2.7/vagrant_2.2.7_x86_64.deb
42    sudo dpkg -i vagrant_2.2.7_x86_64.deb
43
44    vagrant plugin install vagrant-libvirt
45    vagrant plugin install vagrant-sshfs
46
47    sudo mv /etc/apt/sources.list{.bak,}
48    rm vagrant_2.2.7_x86_64.deb
49
50
51 Requirements
52 ------------
53
54 +-------------+-----+-------+---------+
55 | Machine     | CPU |  RAM  | Storage |
56 +-------------+-----+-------+---------+
57 | Operator    |  1  | 1GiB  |  32GiB  |
58 +-------------+-----+-------+---------+
59 | Devstack    |  1  | 4GiB  |  32GiB  |
60 +-------------+-----+-------+---------+
61 | K8s Control |  1  | 1GiB  |  32GiB  |
62 +-------------+-----+-------+---------+
63 | K8s Worker  |  8  | 64GiB |  64GiB  |
64 +-------------+-----+-------+---------+
65 | TOTAL       | 11  | 70GiB |  160GiB |
66 +-------------+-----+-------+---------+
67
68 Table above is based on current experience and may be subject to change.
69
70
71 Prerequisites
72 -------------
73
74 Virtualisation provider
75 ~~~~~~~~~~~~~~~~~~~~~~~
76
77 Environment has been tested using libvirt_ provider with vagrant-libvirt_ plugin. Plugin
78 documentation provides detailed `installation instructions`_ that will guide through the process.
79
80 .. note::
81    Remember to uncomment `deb-src` repositories for `apt-get build-dep` step on Debian/Ubuntu.
82
83 .. _libvirt: https://libvirt.org
84 .. _vagrant-libvirt: https://github.com/vagrant-libvirt/vagrant-libvirt
85 .. _`installation instructions`: https://github.com/vagrant-libvirt/vagrant-libvirt#installation
86
87 Virtual machine manager
88 ~~~~~~~~~~~~~~~~~~~~~~~
89
90 Environment has been tested using latest Vagrant_ as of writing this documentation (`v2.2.6`_). Some
91 features (e.g. triggers_) might not be supported on older versions.
92
93 .. _Vagrant: https://www.vagrantup.com/downloads.html
94 .. _`v2.2.6`: https://github.com/hashicorp/vagrant/blob/v2.2.6/CHANGELOG.md#226-october-14-2019
95 .. _triggers: https://www.vagrantup.com/docs/triggers/
96
97 Synced Folders
98 ~~~~~~~~~~~~~~
99
100 Environment uses reverse-SSHFS-based file synchronization for applying non-upstream changes. This
101 requires installing vagrant-sshfs_ plugin and presence of `sshfs` package on the host system.
102
103 .. _vagrant-sshfs: https://github.com/dustymabe/vagrant-sshfs#install-plugin
104
105
106 Running
107 -------
108
109 Additional `--provider` flag or setting `VAGRANT_DEFAULT_PROVIDER` environmental variable might be
110 useful in case there are multiple providers available.
111
112 .. note::
113    Following command should be executed within the directory where `Vagrantfile` is stored
114    (`integration/bootstrap/vagrant-minimal-onap`).
115
116 .. code-block:: sh
117
118    vagrant up --provider=libvirt
119
120
121 Usage
122 -----
123
124 Once ready (bringing up machines might initially take some time), tools for cluster management will
125 be available on Operator's machine. It can be accessed by executing:
126
127 .. code-block:: sh
128
129    vagrant ssh operator
130
131 Although appropriate context is set for `kubectl` on login, when interacting with the cluster the
132 `onap` namespace has to be explicitly specified. Example:
133
134 .. code-block:: sh
135
136    # Operator's machine shell
137    kubectl -nonap get pods