Deploy Zenko on your laptop with Minikube

Since Kubernetes is Zenko’s default choice for deployment, Minikube is the quickest way to develop Zenko locally. Minikube is described in the official docs as […] 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 […]

Written By Stefano Maffulli

On June 26, 2018
"

Read more

Solve the challenges of large-scale data, once and for all.

Since Kubernetes is Zenko’s default choice for deployment, Minikube is the quickest way to develop Zenko locally. Minikube is described in the official docs as

[…] 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.

To install Minikube you’ll need Virtualbox (or another virtualization option) and follow instructions for your operating system. The video tutorial contains an installation walk-through.

Once Minikube, kubectl, and helm are installed, start Minikube with Kubernetes version 1.9 or newer, and preferably at least 4GB of RAM.  Then enable the Minikube ingress addon for communication.

$ minikube start --kubernetes-version=v1.9.0 --memory 4096
$ minikube addons enable ingress

Once Minikube started, run the helm initialization.

$ helm init --wait

With K8s now running, clone Zenko repository and go into the Helm charts directory to retrieve all dependencies:

$ git clone https://github.com/scality/Zenko.git
$ cd ./Zenko/charts
$ helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
"incubator" has been added to your repositories

$ helm dependency build zenko/
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "incubator" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈Happy Helming!⎈
Saving 8 charts
Downloading prometheus from repo https://kubernetes-charts.storage.googleapis.com/
Downloading mongodb-replicaset from repo https://kubernetes-charts.storage.googleapis.com/
Downloading redis from repo https://kubernetes-charts.storage.googleapis.com/
Downloading kafka from repo http://storage.googleapis.com/kubernetes-charts-incubator
Downloading zookeeper from repo http://storage.googleapis.com/kubernetes-charts-incubator
Deleting outdated charts

With your dependencies built, you can run the following shell command to deploy a single node Zenko stack with Orbit enabled.

$ helm install --name zenko \
--set prometheus.rbac.create=false \
--set zenko-queue.rbac.enabled=false \
--set redis-ha.rbac.create=false \
-f single-node-values.yml zenko

To view the K8s dashboard type the following and will launch the dashboard in your default browser:

$ minikube dashboard

The endpoint can now be accessed via the K8s cluster ip (run minikube ip to display the cluster ip). Now you have a running Zenko instance in a mini-kubernetes cluster. To connect your instance to Orbit, find the instance ID

$ kubectl logs $(kubectl get pods --no-headers=true -o \
custom-columns=:metadata.name | grep cloudserver-front) | \
grep Instance | tail -n 1

The output will look something like this:

{"name":"S3","time":1529101607249,"req_id":"9089628bad40b9a255fd","level":"info","message":"this deployment's Instance ID is 6075357a-b08d-419e-9af8-cc9f391ca8e2","hostname":"zenko-cloudserver-front-f74d8c48c-dt6fc","pid":23}

The Instance ID in this case is 6075357a-b08d-419e-9af8-cc9f391ca8e2. Login into Orbit and register this instance. To test your minikube deployment, assign a hostname to the clusters ingress IP address to make things easier, then using s3cmd test

$ cat /etc/hosts
127.0.0.1   localhost
127.0.1.1   machine
192.168.99.100 minikube

By default, minikube only exposes SSL port 443, so you’ll want to ask your client/app to use SSL. However, since minikube uses a self-signed certificate, you may get security error. You can either configure minikube to use a trusted certificate, or simply ignore the certificate.

$ cat ~/.s3cfg
[default]
access_key = OZN3QAFKIS7K90YTLYP4
secret_key = 1Tix1ZbvzDtckDZLlSAr4+4AOzxRGsOtQduV297p
host_base = minikube
host_bucket = %(bucket).minikube
signature_v2 = False
use_https = True

$ s3cmd ls  --no-check-certificate
$

Head to Zenko forum to ask questions!

Simple, secure S3 object storage software for modern applications