Skip to content

Latest commit

 

History

History
249 lines (165 loc) · 5.51 KB

README.md

File metadata and controls

249 lines (165 loc) · 5.51 KB

Orb local k8s cluster

The following steps must be performed at the root of the Orb project to set up a local k8s cluster and deploy Orb.

🧱 Requirements

💡 Note: If you have those installed, please skip to Deploy Orb on Kind.

⚠️ You may need to permit ports 80 and 443 (ingress) because of kubernetes.

🐳 Docker Environment (Requirement)

Quick install a Docker executing:

make install-docker

Check if you have a Docker running by executing:

docker version

If you need help to set up a Docker Environment, follow the steps from here.

⚓ Helm 3 (Requirement)

Helm is a package manager for Kubernetes. A Helm Chart is a package that allows you to customize your deployment on Kubernetes.

Quick install a Helm 3 executing:

make install-helm

Check if you have Helm 3 installed by executing:

helm version

If you need help to install Helm 3, follow the steps from here.

🚨 Warning: Make sure you have version 3 installed, orb helm charts doesn't officially support helm 2.

🐋 Kubectl (Requirement)

Quick install a Kubectl executing:

make install-kubectl

Check if you have Kubectl cmd installed by executing:

kubectl version --client

If you need help to install Kubectl, follow the steps from here.

🚢 Install Kind (Requirement)

Kind is a tool for running local k8s clusters using docker container as nodes.

Quick install a Kind on Linux executing:

make install-kind

If you have go 1.17 or later installed:

go install sigs.k8s.io/kind@v0.14.0

macOS users can also use brew:

brew install kind

🚨 Windows WSL users: WSL is also supported, but for some reason the Orb stack mess up the WSL internal DNS. You can fix that by editing your /etc/wsl.conf and adding the following:

[network]
generateResolvConf = false

Restart WSL by executing the following on CMD:

wsl --shutdown

Open WSL terminal again and remove the symbolic link from /etc/resolv.conf:

sudo unlink /etc/resolv.conf

Create a new /etc/resolv.conf file and add the following:

nameserver 8.8.8.8

save the file and you are done.

🐋 k9s (Optional)

Quick install a k9s to manage your cluster executing:

make install-k9s

🚀 Deploy Orb on Kind

Add kubernetes.docker.internal host as 127.0.0.1 address in your hosts file:

echo "127.0.0.1 kubernetes.docker.internal" | sudo tee -a /etc/hosts

💡 Note: This is needed just once

Setup Orb Charts dependencies repositories:

make prepare-helm

💡 Note: You just need to run those steps until here once, even if you delete the cluster afterwards.

Use the following command to create the cluster and deploy Orb:

make run

Access the Orb UI by accessing: https://kubernetes.docker.internal/. The following users are created during the mainflux bootstrap:

E-mail Password Role
admin@kind.com pass123456 Admin

Have fun! 🎉 When you are done, you can delete the cluster by running:

make kind-delete-cluster

Development flow with Kind

Use the following command to create the empty cluster:

make kind-create-cluster

💡 Note: Now you have and empty kind cluster with minimum necessary to spin up pods

Let's add helm charts for orb:

make prepare-helm

💡 Note: Now your dependencies are configured

Building all orb images:

make dockers

💡 Note: This can take some time

Loading all images into the kind cluster:

make kind-load-images

💡 Note: Your are loading from your local docker registry to kind cluster registry

Load just one image to the kind cluster

kind load docker-image orbcommunity/orb-maestro:0.22.0-088bee14

💡 Note: Do not forget to change kind/values.yaml manifest to use your image tag

Install orb application:

make kind-install-orb

💡 Note: Now orb was installed properly

If you have any problem to load your new deployment use:

kubectl rollout restart deployment -n orb

Updating inflight service with recent development

If you want to change a service, lets say you added some logs to the fleet service, before committing the changes, add this

SERVICE=fleet make build_docker

This will build only the docker image of the new service. After changing you can simply execute

make kind-upgrade-all

Also you can load image using kind command individually, and upgrade your deployment with helm command. You can use redis-commander and adminer to interact with databases on kind environment


❌ Is it not working correctly? Found a bug? Come talk to us [live on Slack](https://netdev.chat/) in the `#orb` channel, or [file a GitHub issue here](https://github.com/orb-community/orb/issues/new/choose).