kanary

module
v0.0.0-...-7d7ad2d Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: Apache-2.0

README

Kanary : Canary Release Operator for Kubernetes

toto codecov Go Report Master GitHub release License

This Kubernetes operator aims to manage canary release deployment using HAProxy container as L4 (TCP) loadbalancer

Operator installation

kubectl apply -f https://raw.githubusercontent.com/etiennecoutaud/kanary/master/manifests/kanary.yml

CustomRessourceDefinitions

Kanary Operator manipulate kanary custom ressource, short name is ky

kubectl get kanary
NAME                 AGE
simple-kanary-rule   9s
apiVersion: kanary.pyxida.io/v1alpha1
kind: Kanary
metadata:
  name: simple-kanary-rule
spec:
  destination: myapp
  routes:
  - backend:
     serviceName: "myapp-v1"
     servicePort: "http"
    weight: 80
  - backend:
      serviceName: "myapp-v2"
      servicePort: 9090
    weight: 20

In this example:

  • HAProxy will be exposed by myapp service, indicated in destination field
  • Canary release is loadbalancing to myapp-v1 and myapp-v2 services previously created by the user
  • HAProxy referenced to service backend port with servicePort fiels, it can be port name or port value
  • Loadbalancing is performed based on weight field
  • Multiple backends can be set, sum of weight must be equal to 100

How it works

Kanary Operator will act on kanary CRD and will perform:

  • HAProxy loabalancer generation
  • Manage configuration and update based on weight loadbalancing
  • Reference pod endpoint directly for more efficiency
  • Trigger automatic HAProxy rolling update when configuration changed for no service outage
  • Manage route as Kubernetes service to access to HAProxy

Kanary Operator is manipulating Kubernetes ressources:

  • Deployment
  • Endpoint
  • ConfigMap
  • Service

A RBAC dedicated role is needed to provide the ability to perform all operation on theses ressources

Architecture and example

Diagrams done with Kubernetes icons

Initial state: 2 version of the same application are running, each pods is exposed with a service initial

Kanary ressource is apply to the namespace to loadbalance pods depend on weight ky

This stack can be deployed in your cluster:

kubectl apply -f https://raw.githubusercontent.com/etiennecoutaud/kanary/master/examples/simple-stack.yml

License

The work done has been licensed under Apache License 2.0. The license file can be found here. You can find out more about the license at www.apache.org/licenses/LICENSE-2.0.

Directories

Path Synopsis
cmd
pkg
apis/kanary/v1
Package v1 is the v1 version of the API.
Package v1 is the v1 version of the API.
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/kanary/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/kanary/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

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