Add microk8s installation documentation
[policy/parent.git] / docs / development / devtools / installation / microk8s-installation.rst
1 .. _local-policy-label:
2
3 .. toctree::
4    :maxdepth: 2
5
6 Policy Framework Component Microk8s Installation
7 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
9 This page will explain how to install the policy in a microk8s environment.
10 The intention of this page is to outline the process to spin up a kubernetes cluster using microk8s.
11
12 These instructions are for development purposes only.
13
14 Process
15 *******
16
17 In the latest release of the Policy Framework, the  ability to run the Policy Framework CSITs in a kubernetes environment was introduced.
18 As part of this work, a script has been added to the policy/docker repo to bring up a kubernetes environment and deploy the Policy Framework helm charts.
19 This makes installation of the Policy Framework easier for developers.
20
21 Steps
22 -----
23
24 1. Clone the policy/docker repo.
25
26     .. code-block:: bash
27
28         git clone https://github.com/onap/policy-docker
29
30 2. Invoke the microk8s installation script (docker/csit/run-k8s-csit.sh)
31
32     .. code-block:: bash
33
34         docker/csit/run-k8s-csit.sh {install} {project_name}
35
36     When the project name is not specified, the script only installs the policy helm charts and will not execute the robot tests. Alternatively, if you want to run the csit tests for a particular project, you can supply the name here.
37
38     This script verifies the microk8s kubernetes cluster is running, deploys the policy helm charts under the default namespace, builds the docker image for the robot framework and deploys the robot framework helm chart
39     in the default namespace, and invokes the robot test(s) for the project supplied by the user. The test results can be viewed from the logs of the policy-csit-robot pod.
40
41 3. Teardown the cluster
42
43     .. code-block:: bash
44
45         docker/csit/run-k8s-csit.sh {uninstall}
46
47     To teardown the cluster, the same script can be invoked with the {uninstall} argument. No project name is required.