Note: If you just wish to get started with trying out Cellery, you can start your journey at wso2/cellery repository.
Mesh controller is a Kubernetes implementation for the Cellery mesh (a.k.a Cell Mesh) builds using Istio. To learn more about about Cellery, check out the wso2/cellery repository.
Mesh Controller requires a Kubernetes cluster with Istio installed in order to work properly.
Clone this repository to your $GOPATH and enable go module support by setting GO111MODULE=on. Cloning into $GOPATH is only required if you want to use code-generator.
export GO111MODULE=on
cd $GOPATH/src/cellery.io/
git clone https://github.com/wso2/cellery-controller.git
cd cellery-controller
Build the controller
# The output binary can be located inside the build directory
make build.controller
Run the controller in your local machine (This requires you to provide the kubeconfig file in order to connect to the Kubernetes cluster)
./build/controller -logtostderr=true --kubeconfig=/home/<username>/.kube/config
Run the unit tests
make test.controller
Generate and view coverage report
make coverage
This will guide you on deploying the Mesh Controller inside the Kubernetes cluster
You can deploy a released version of the Mesh Controller using following steps.
Generate Kubernetes YAML’s for the controller
# Specify a released version to generate the yaml
VERSION=v0.1.0 make artifacts
Deploy the controller into Kubernetes cluster
kubectl apply -f build/mesh-controller.yaml
If you want to deploy a development version, you can to generate a Kubernetes YAML which uses docker images from your Docker repository.
Build and push the docker image
DOCKER_REPO=<your-repo> VERSION=dev make docker-push.controller artifacts
Deploy controller into the Kubernetes cluster
kubectl apply -f build/mesh-controller.yaml
You can create a sample cell using following command,
cat <<EOF | kubectl create -f -
apiVersion: mesh.cellery.io/v1alpha1
kind: Cell
metadata:
name: my-cell
spec:
gatewayTemplate:
spec:
http:
- context: time
definitions:
- path: /
method: GET
backend: server-time
global: false
- context: hello
definitions:
- path: /
method: GET
backend: node-hello
global: false
servicesTemplates:
- metadata:
name: time-us
spec:
replicas: 1
container:
image: docker.io/mirage20/time-us
ports:
- containerPort: 8080
servicePort: 80
- metadata:
name: time-uk
spec:
replicas: 1
container:
image: docker.io/mirage20/time-uk
ports:
- containerPort: 8080
servicePort: 80
- metadata:
name: server-time
spec:
replicas: 1
container:
image: docker.io/mirage20/time
ports:
- containerPort: 8080
servicePort: 80
- metadata:
name: debug
spec:
replicas: 1
container:
image: docker.io/mirage20/k8s-debug-tools
servicePort: 80
EOF
If you are interested in contributing please see CONTRIBUTING.md