# Kubernetes
Quick introduce into Kubernetes and Helm

## Prerequisites

1. Minikube v0.26.1
2. [VirtualBox 5.0.2]()
3. Docker 18.03.1-ce
4. [helm v2.9.0](https://docs.helm.sh/using_helm/#installing-helm)
5. [xhyve](https://github.com/machine-drivers/docker-machine-driver-xhyve) 

### Install VirtualBox 

```bash
$ brew cask install virtualbox
```

### Install xhyve driver

```bash
$ brew update
$ brew install --HEAD xhyve
$ brew install docker-machine-driver-xhyve
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
```

### Install local Kubernetes via Minikube

```bash
$ npm install
$ export PATH=./node_modules/.bin:$PATH
$ k8s_ver=$(yaml get .tool-versions.yml versions.minikube_k8s)
$ minikube start --logtostderr --kubernetes-version $k8s_ver --vm-driver=xhyve

$ # Here we go!
$ # Kubernetes cluster via Minikube was successfully configure
$ source ./scripts/k8s/deploy_helm.sh
$ deploy_helm
```

[![asciicast](https://asciinema.org/a/180765.png)](https://asciinema.org/a/180765)

### Configure Docker Registry creds addon 

Use the commands below to configure Docker Registry creds for local kubernetes. Use your DockerHub credentials.

```bash
$ minikube addons enable registry-creds
$ minikube addons configure registry-creds
```
[![asciicast](https://asciinema.org/a/180764.png)](https://asciinema.org/a/180764)

### Install Drakemall via helm 
Use the commands below to start drakemall on local kubernetes via helm

```bash
$ helm install -f charts/drakemall/values.yaml -f charts/drakemall/demovalues.yaml charts/drakemall
$ helm ls
$ helm status your_release_name
```
[![asciicast](https://asciinema.org/a/180765.png)](https://asciinema.org/a/180768)