cellery-controller

module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2019 License: Apache-2.0

README

Mesh Controller

Build Status codecov.io Go Report Card GitHub (pre-)release GitHub (Pre-)Release Date GitHub last commit License

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.

Getting Started

Mesh Controller requires a Kubernetes cluster with Istio installed in order to work properly.

Prerequisites
  • Golang v1.12+
  • Kubernetes cluster and client v1.14
  • Istio v1.2.2
  • GNU Make 4.1+
  • Docker
Building and Running
  1. 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
    
  2. Build the controller

    # The output binary can be located inside the build directory
    make build.controller 
    
  3. 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
    

Running the tests

Unit tests
  1. Run the unit tests

    make test.controller
    
  2. Generate and view coverage report

    make coverage 
    

Deployment

This will guide you on deploying the Mesh Controller inside the Kubernetes cluster

Deploying a released version

You can deploy a released version of the Mesh Controller using following steps.

  1. Generate Kubernetes YAML’s for the controller

    # Specify a released version to generate the yaml
    VERSION=v0.1.0 make artifacts
    
  2. Deploy the controller into Kubernetes cluster

    kubectl apply -f build/mesh-controller.yaml
    
Deploying a development version

If you want to deploy a development version, you can to generate a Kubernetes YAML which uses docker images from your Docker repository.

  1. Build and push the docker image

    DOCKER_REPO=<your-repo> VERSION=dev make docker-push.controller artifacts
    
  2. Deploy controller into the Kubernetes cluster

    kubectl apply -f build/mesh-controller.yaml
    

Running a sample Cell

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

Contributing

If you are interested in contributing please see CONTRIBUTING.md

Directories

Path Synopsis
cmd
pkg
apis/knative/serving/v1alpha1
+k8s:deepcopy-gen=package +groupName=serving.knative.dev
+k8s:deepcopy-gen=package +groupName=serving.knative.dev
apis/knative/serving/v1beta1
+k8s:deepcopy-gen=package +groupName=serving.knative.dev
+k8s:deepcopy-gen=package +groupName=serving.knative.dev
generated/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
generated/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
generated/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
generated/clientset/versioned/typed/authentication/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/authentication/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated/clientset/versioned/typed/mesh/v1alpha2
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/mesh/v1alpha2/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated/clientset/versioned/typed/networking/v1alpha3
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/networking/v1alpha3/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated/clientset/versioned/typed/serving/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/serving/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
generated/clientset/versioned/typed/serving/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
generated/clientset/versioned/typed/serving/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
ptr

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL