-
Notifications
You must be signed in to change notification settings - Fork 89
Noobaa on Kubernetes Hands On
nb-ohad edited this page Apr 14, 2019
·
6 revisions
- Start minikube:
minikube start
- 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 all kind of k8s images
docker images
- build noobaa server image - first download rpm from jenkins and copy to
noobaa.rpmundernoobaa-core, then run docker build
docker build -f ./src/deploy/NVA_build/Server.Dockerfile -t nbserver --rm --no-cache ./
- tag the image
docker tag nbserver nbserver:1
- update noobaa_core.yaml to point to the image we just built
image: nbserver:1
- deploy noobaa yaml file in kubernetes
kubectl apply -f src/deploy/NVA_build/noobaa_core.yaml
- check that statefulset\service\pods are created
kubectl get statefulset
kubectl get pod
kubectl get service
- getting into the noobaa server
kubectl exec -it noobaa-server-0 /bin/bash
- 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 ports80and8080from kuberentes to local host
sudo kubectl port-forward noobaa-server-0 80:80 8080:8080
- creating agents - copy agents yaml from the UI to a file and use
kubectl apply -f [agents.yaml]
- build the operator. you must have
goanddepinstalled. this will build anoobaa-operatorimage
./src/deploy/build_operator.sh
- tag the operator image
docker tag noobaa-operator noobaa-operator:1
- deploy the operator yaml in the cluster
kubectl create -f ./gocode/src/noobaa-operator/deploy/noobaa-operator.yaml
- deploy a
noobaaresource in kuberentes
kubectl create -f src/deploy/NVA_build/noobaa.yaml
- 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
You can use aws-cli easily from another pod using the service internal dns name:
<service>.<namespace>.svc.cluster.local which is in minikube case noobaa-services.default.svc.cluster.local.
For example you could run the following:
kubectl run aws-cli -it --rm \
--generator=run-pod/v1 \
--image=mesosphere/aws-cli \
--env="AWS_ACCESS_KEY_ID=123" \
--env="AWS_SECRET_ACCESS_KEY=abc" \
-- --endpoint-url http://noobaa-services.default.svc.cluster.local \
s3api list-buckets