From 4c6fe2cf6e1bbb279dcf5698cff315740ea6d8e8 Mon Sep 17 00:00:00 2001 From: Rihab Banday Date: Wed, 8 Sep 2021 12:25:00 +0200 Subject: [PATCH] Add documentation to deploy Kuberef on VM's This change adds the steps to deploy Kuberef on VM's and minor changes in functions.sh. Signed-off-by: Rihab Banday Change-Id: I9a0a2df6f452a456935cd119c5d78ffd147369ab Reviewed-on: https://gerrit.opnfv.org/gerrit/c/kuberef/+/72895 Tested-by: jenkins-ci Reviewed-by: Georg Kunz Reviewed-by: Michael Pedersen --- docs/release/installation/deployment-guide.rst | 21 +++++++++++++++++---- functions.sh | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/docs/release/installation/deployment-guide.rst b/docs/release/installation/deployment-guide.rst index 0390589..3123598 100644 --- a/docs/release/installation/deployment-guide.rst +++ b/docs/release/installation/deployment-guide.rst @@ -35,7 +35,7 @@ Additionally, please make note of the following: 3. Add user to the sudo and libvirt group and have passwordless sudo enabled. -4. Install Ansible (tested with 2.9.14) and yq. +4. Install Ansible (tested with 2.9.14), yq (v3.4.1), jq and virtual-env. Installing and configuring the prerequisites will depend on the operating system installed on the jump server. Below are additional details for setting up some of the more popular distributions. @@ -104,13 +104,26 @@ Generate SSH keypair * ``ssh-keygen -t rsa -b 4096`` -Deployment -============================= +Deployment on Baremetal and Provider Infrastructure +=================================================== Please refer to Chapter 4 of `CNTT RI-2 Documentation `_ for instructions to get started with the deployment. -Once the deployment is successful, you will have a fully functional RI-2 setup! +Deployment on Virtualized Infrastructure +======================================== + +Following are the steps to spin up a minimalistic Kuberef deployment on VMs aimed for development and testing use-cases: + +* Set ``VENDOR=libvirt-vms``, ``DISTRO=ubuntu1804`` in ``deploy.env``. Additionally, ensure that other environmental variables defined in this file match your setup. +* The hardware and network configurations for the VMs are defined under ``hw_config/libvirt-vms``. Currently, the configuration for one master and one worker VM is defined, but additional VM's can be added as desired. Additionally, the default values of hardware storage, CPU information, etc. can be adapted as per need. +* Once ready, initiate the deployment by running ``dev/deploy_on_vms.sh`. + +After the successful completion of the deployment, you can do ``virsh list`` to list the provisioned VM's and connect to them over SSH using user ``root``. The SSH public key of the user is already added by the installer in the VM's. The IP of the VMs can be found under ``hw_config/libvirt-vms/pdf.yaml``. + +Verify that all services in the VM's are running by ``kubectl get all --all-namespaces``. + +Note that this feature is currently only supported on Ubuntu 18.04. For other OS, additional configuration might be needed. Validation of the Reference Implementation =========================================== diff --git a/functions.sh b/functions.sh index f10f2e5..69a3de7 100755 --- a/functions.sh +++ b/functions.sh @@ -163,7 +163,7 @@ provision_hosts_baremetal() { # shellcheck disable=SC2087 ssh -o StrictHostKeyChecking=no -tT "$USERNAME"@"$(get_vm_ip)" << EOF # Install and run cloud-infra -if [ ! -d "${PROJECT_ROOT}"/engine" ]; then +if [ ! -d "${PROJECT_ROOT}/engine" ]; then ssh-keygen -t rsa -N "" -f "${PROJECT_ROOT}"/.ssh/id_rsa git clone https://gerrit.nordix.org/infra/engine.git cp "${PROJECT_ROOT}"/"${VENDOR}"/{pdf.yaml,idf.yaml} \ @@ -226,7 +226,7 @@ if ! command -v docker; then sleep 2 done fi -if [ ! -d "${PROJECT_ROOT}"/container-experience-kits" ]; then +if [ ! -d "${PROJECT_ROOT}/container-experience-kits" ]; then git clone --recurse-submodules --depth 1 https://github.com/intel/container-experience-kits.git -b v21.03 "${PROJECT_ROOT}"/container-experience-kits/ cp -r "${PROJECT_ROOT}"/container-experience-kits/examples/"${BMRA_PROFILE}"/group_vars "${PROJECT_ROOT}"/container-experience-kits/ fi -- 2.16.6