Skip to content

Noobaa on Kubernetes Hands On

Danny Zaken edited this page Mar 3, 2019 · 6 revisions
  1. Start minikube:
minikube start
  1. Work with minikube's internal docker - useful for development so you don't need to constantly push\pull images
eval $(minikube docker-env)
# test by listing images - you'll see al kind of k8s images
docker images
  1. build noobaa server image - first download rpm from jenkins and copy to noobaa.rpm under noobaa-core, then run docker build
docker build -f ./src/deploy/NVA_build/Server.Dockerfile -t nbserver --rm --no-cache ./
  1. tag the image
docker tag nbserver nbserver:1
  1. update noobaa_statefulset.yaml to point to the image we just built
image: nbserver:1
  1. deploy noobaa yaml file in kubernetes
kubectl create -f src/deploy/NVA_build/noobaa_statefulset.yaml
  1. check that statefulset\service\pods are created
kubectl get statefulset
kubectl get pod
kubectl get service
  1. getting into the noobaa server
kubectl exec -it noobaa-server-0 /bin/bash
  1. connecting to the system from outside the cluster can be done by connecting to the service ip and the mapped port (can be found with kubectl get service)
    another option is to forward ports 80 and 8080 from kuberentes to local host
sudo kubectl port-forward noobaa-server-0 80:80 8080:8080
  1. creating agents - copy agents yaml from the UI to a file and use kubectl create -f [agents.yaml]

Noobaa Operator

  1. build the operator. you must have go and dep installed. this will build a noobaa-operator image
./src/deploy/build_operator.sh
  1. tag the operator image
docker tag noobaa-operator noobaa-operator:1
  1. deploy the operator yaml in the cluster
kubectl create -f ./gocode/src/noobaa-operator/deploy/noobaa-operator.yaml
  1. deploy a noobaa resource in kuberentes
kubectl create -f src/deploy/NVA_build/noobaa.yaml
  1. another way to run the operator (mainly during the development of the operator itself) is locally on the laptop, instead of building an image and deploying to kubernetes
operator-sdk up local --namespace=default
Clone this wiki locally