For the orchestration of the Yona containers in cluster, we are using Kubernetes, an open-source system for automating deployment, scaling, and management of containerized applications. The management of the Kubernetes resources is done with Helm, a tool for managing Kubernetes charts. Charts are packages of pre-configured Kubernetes resources.This page describes how to set this environment up and how to run Yona with it.
This procedure requires Windows 10 Pro. It does not work on Windows 10 Home, as Hyper-V is not available on that edition. It might also work on Windows 8 Pro, but that has not been tested.
To run Yona on a developer laptop, we use Minikube, a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day. The below procedure uses Hyper-V as the VM provider. This is a standard Windows component, so there is one less component to install. See also this Microsoft blog for background information and to learn how to enable Hyper-V.
These are the steps to set it up:
- Install the stable version of Docker, as described here
- Download the minikube-windows-amd64.exe file, rename it to
minikube.exeand add it to your path
Determine the latest version of kubectl:
Download the latest version of
- Open Hyper-V manager and create a virtual switch named Minikube. The procedure is given in the Microsoft blog mentioned above, but we use a different name for the virtual switch.
- Open a command prompt with administrator privileges
Start the local Kubernetes cluster:
Minikube will create a HyperV instance with the above configuration, and deploy Kubernetes master node to it. It will setup your kubectl config (%HOMEDRIVE%%HOMEPATH%/.kube/config) to point to the K8S API in the virtual environment.
To verify the node is available:
You can see a quick list of all the running components on a base K8S install:
Download Helm and add it to your path
Load the Tiller component of Helm into the Kubernetes cluster:
Now you are ready to deploy Yona server
Deploy Yona server
This section describes how to deploy Yona server. After covering the preparation steps, two options are described: Deploying Yona from a checkout and deploying an existing build.
- Go to the k8s folder in the Yona check-out
Add the Yona charts repository for the dependencies:
Create the Yona namespace:
Create a persistent storage volume:
It will create a space of the defined size in the virtual machine to be used by persistent volume claims for the MariaDB and LDAP data
Deploy from checkout
Follow these steps to deploy Yona from a Git check-out:
- Go to the helm subfolder
Update the dependencies
This will download MariaDB and LDAP if not downloaded already.
Now deploy/upgrade Yona:
Deploy existing build
Follow these steps to deploy a build created by Jenkins:
Update the repositories
- Two possibilities exist:
Deploy latest build
Deploy a specific build
Verify the deployment
To see the pods being deployed:
You will see various liquibase containers failing out due to some components not being ready right away - MariaDB, LDAP, etc.
Eventually you will see a completed liquibase, and eventually the various components will be up.
You can also use the -w command to watch the changes to pod status
With the above, once you see that
liquibase-update has 'Completed' it is good to go.
To view the Logs of any container, use the following command with the full pod name from the
get pods command above
Accessing the cluster services
Once everything is up, you probably want to test it.
Get a list of the exposed services with the following:
Now you can check whether the app service is up and running, with the activity categories deployed:
To verify what build is running:
To fetch the current configuration properties:
Shutdown, for redeploy
The following commands will stop the chart, and clean up various resources that are not automatically cleaned up when a chart is stopped.