All Projects → nilebox → kanarini

nilebox / kanarini

Licence: Apache-2.0 license
Canary Deployment Controller for Kubernetes

Programming Languages

go
31211 projects - #10 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to kanarini

kubereplay
Seamless integration of goReplay and Kubernetes
Stars: ✭ 30 (-6.25%)
Mutual labels:  crd
kong-plugins-canary
The grayscale plug-in based on gateway Kong, called Canary, meets A/B testing and dynamically switches upstream agents
Stars: ✭ 31 (-3.12%)
Mutual labels:  canary
PowerShell-FeatureFlags
PowerShell module containing a Feature Flags implementation based on a local config file.
Stars: ✭ 15 (-53.12%)
Mutual labels:  canary
cert-manager
Automatically provision and manage TLS certificates in Kubernetes
Stars: ✭ 8,781 (+27340.63%)
Mutual labels:  crd
Discord-Datamining
Datamining Discord changes from the JS files
Stars: ✭ 1,441 (+4403.13%)
Mutual labels:  canary
SSHapendoes
Capture passwords of login attempts on non-existent and disabled accounts.
Stars: ✭ 31 (-3.12%)
Mutual labels:  canary
gen-crd-api-reference-docs
API Reference Docs generator for Kubernetes CRDs (used by Knative, Kubeflow and others)
Stars: ✭ 205 (+540.63%)
Mutual labels:  crd
Awesome Http Benchmark
HTTP(S) benchmark tools, testing/debugging, & restAPI (RESTful)
Stars: ✭ 2,236 (+6887.5%)
Mutual labels:  canary
transparency
Read-only mirror of https://owo.codes/whats-this/transparency
Stars: ✭ 13 (-59.37%)
Mutual labels:  canary
phx-auth-api
Authentication for Phoenix with JWT, user privileges and CI
Stars: ✭ 13 (-59.37%)
Mutual labels:  canary
samplecontroller
a demo of how to run a python custom controller with crd on kubernetes
Stars: ✭ 67 (+109.38%)
Mutual labels:  crd
Litmus
Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q
Stars: ✭ 2,377 (+7328.13%)
Mutual labels:  crd
iter8-analytics
AI-engine that powers Iter8
Stars: ✭ 16 (-50%)
Mutual labels:  canary
pykorm
A python 🐍 kubernetes ☸️ ORM 🚀. Very useful when writing operators for your CRDs with Kopf.
Stars: ✭ 56 (+75%)
Mutual labels:  crd
nginx-canary
nginx with canary release strategy
Stars: ✭ 43 (+34.38%)
Mutual labels:  canary
kaos
Kinda Chaos Monkey for Kubernetes
Stars: ✭ 18 (-43.75%)
Mutual labels:  crd
gitops-helm-workshop
Progressive Delivery for Kubernetes with Flux, Helm, Linkerd and Flagger
Stars: ✭ 59 (+84.38%)
Mutual labels:  canary
K8s Deployment Strategies
Kubernetes deployment strategies explained
Stars: ✭ 2,649 (+8178.13%)
Mutual labels:  canary
Flagger
Progressive delivery Kubernetes operator (Canary, A/B Testing and Blue/Green deployments)
Stars: ✭ 3,337 (+10328.13%)
Mutual labels:  canary
gke-demo
Demonstration of complete, fully-featured CI/CD and cloud automation for microservices, done with GCP/GKE
Stars: ✭ 47 (+46.88%)
Mutual labels:  canary

Kanarini, Canary Deployment Controller for Kubernetes Build Status

Overview

Kanarini is a CRD controller that implements canary deployment strategy by creating two Deployment objects - "canary" and "stable", and validating the healthiness of Deployments via calls to Custom Metrics API (https://github.com/kubernetes/metrics).

Kanarini introduces a new Kubernetes resource, CanaryDeployment, that reflects the structure of standard Deployment with extra configuration for canary/stable deployment tracks.

Prerequisites

Custom Metrics API

Kanarini is using Custom Metrics API to fetch metrics, and one of its implementations is required to be installed in the cluster. For example, if you are using Prometheus for metrics collection, you can install Prometheus Adapter.

Getting started

The easiest way to see Kanarini in action is to follow the Quickstart guide.

Add Kanarini to your cluster

Run:

kubectl apply -f ./deploy/crd-canarydeployment.yaml
kubectl apply -f ./deploy/namespace.yaml
kubectl apply -f ./deploy/serviceaccount.yaml
kubectl apply -f ./deploy/rbac.yaml
kubectl apply -f ./deploy/deployment.yaml

This command:

  • Registers a CanaryDeployment CustomResourceDefinition
  • Creates a new namespace kanarini with one instance of Kanarini in the namespace
  • Grants Kanarini permissions to manage Deployment objects in the cluster

Usage example

To create an instance of CanaryDeployment, run:

kubectl apply -f ./deploy/example.yaml

This command will create a CanaryDeployment in the kanarini-example namespace:

$ kubectl get canarydeployments -n kanarini-example
NAME    AGE
emoji   22s
apiVersion: kanarini.nilebox.github.com/v1alpha1
kind: CanaryDeployment
metadata:
  name: emoji
  namespace: kanarini-demo
spec:
  selector:
    matchLabels:
      app: emoji
  template:
    metadata:
      labels:
        app: emoji
    spec:
      containers:
      - name: emoji
        image: nilebox/kanarini-example:1.0
        ports:
        - containerPort: 8080
          name: http
        - containerPort: 9090
          name: metrics
  tracks:
    canary:
      replicas: 1
      labels:
        track: canary
      metricsCheckDelaySeconds: 60
      metrics:
      - type: Object
        object:
          describedObject:
            kind: "Service"
            name: "emoji-canary"
          metric:
            name: "failure_rate_1m"
          target:
            type: Value
            value: 0.1
    stable:
      replicas: 3
      labels:
        track: stable

As a result, you will have two Deployment objects created and managed by Kanarini.

Quickstart

To see Kanarini in action, run a "Quickstart" script that bootstraps a local Kubernetes cluster (https://github.com/kubernetes-sigs/kind), installs additional components (Kanarini controller, Heptio Contour, Prometheus Operator, Prometheus Adapter, Grafana) and deploys a demo application with CanaryDeployment resource, services and ingress.

First, run

./demo/quickstart.sh

Once the script has successfully finished its execution, setup kubectl context:

export KUBECONFIG="$(kind get kubeconfig-path)"

To see Grafana dashboards, open in your browser http://localhost:30988/ (default username/password is admin/admin).

To see a working example, you can use curl or browser with address http://localhost:30900. Note that you need to set the header Host: example.com in order for Contour to forward requests to underlying "canary" and "stable" services. To achieve that, you can use a Firefox browser extension Header Editor.

Alternatively, you could open service URLs directly:

Note that in that case you won't get weighted load balancing, as you will be sending requests directly to services without ingress.

To test happy path scenario, change Docker image in canarydeployments.yaml to nilebox/kanarini-example:3.0. The change will be first applied to a "canary" Deployment, and after a successful metric check it will be propagated to "stable" Deployment.

To test non-happy path, change Docker image in canarydeployments.yaml to nilebox/kanarini-example:2.0. The change will be initially applied to a "canary" Deployment, but after failing metric check it will be rolled back.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].