GO111MODULE="on" go get sigs.k8s.io/[email protected]
export KIND_CLUSTER_NAME=kind
export INTERNAL_INSECURE_REGISTRY_PORT=6000
# number of intended cluster nodes, defaults to 1
export NODES=1
./create_testenv.sh
It creates Kubernetes IN Docker cluster with a docker registry. This docker registry is accessible from host at localhost:6000
and from inside the cluster at registry:5000
To run multi-node cluster you will need sufficient amount of memory (RAM) and CPU to handle multiple replicas of services e.g. 32 GB RAM
and 12 CPU
. Following steps provide an instruction for internal usage how to deploy VM on ESXI with docker installed on and Docker Daemon configured to listen on the 2375
port. If you have a dedicated machine wich fullfills requirements you can start from the step 3.
-
Create a VM which will be your docker host for kind. You can do this by using ready-to-use OVA which is available under
/root/dockerd/dockerd.ova
path onb5s5-node3
in our lab. You can deploy a VM using following command:ovftool --X:logFile=upload.log --diskMode=thin --X:logLevel=verbose --name=YOUR_VM_NAME /root/dockerd/dockerd.ova vi://root:[email protected]
-
Run your machine using default credentials by logging into ESXi UI. Afterwards, start virtual machine that you've just created and check IP address that VM received.
-
You need to set environemt variable on your local machine with address of Docker Daemon from newly created machine (docker host). To do this type following command on your local terminal:
export DOCKER_HOST=tcp://<IP OF DOCKERD VM>:2375
-
Kubectl expects k8s APIServer listening on 127.0.0.1 and some random port assigned by Docker. To change k8s
APIServer IP
andport
, you will have to modifycreate_k8s_cluster.sh
script. Change kindConfig by adding those two lines innetworking
section:apiServerAddress: "<IP OF DOCKERD VM>" apiServerPort: 6443
-
Create test env using
create_testenv.sh
(remember to set variable NODES to 3). First two variables are optional and have default values.export KIND_CLUSTER_NAME=kind export INTERNAL_INSECURE_REGISTRY_PORT=6000 # number of intended cluster nodes, defaults to 1 export NODES=3 ./create_testenv.sh
export INTERNAL_INSECURE_REGISTRY_PORT=6000
./update_local_registry.sh
NOTE: Afterwards, you may delete downloaded images with docker image rm -f $(docker image ls -q)
as they are pushed to separate registry.
export KIND_CLUSTER_NAME=kind
./apply_contrail_cluster.sh
./clear_contrail_cluster.sh
kind delete cluster
# From contrail-operator root directory
# Use operator-sdk version >= v.0.13
kubectl create namespace contrail
operator-sdk test local ./test/e2e/ --operator-namespace contrail --go-test-flags "-v -timeout=30m" --up-local