ipvs-operator

module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2018 License: Apache-2.0

README

Kubernetes operator for setting IPVS weights on Kubernetes ClusterIP services.

The operator provides a new Kubernetes resource called a WeightedService.

build status image version image size

This operator is in very early alpha and should be used with care.

Note that the service weights will not apply for anything that routes directly to endpoint IPs (e.g., ingress-nginx), but will work for the service IP.

Installation

Follow the IPVS guide to configure your Kubernetes cluster to use IPVS instead of iptables.

To install the operator, simply apply the manifest:

kubectl apply -f https://raw.githubusercontent.com/justinbarrick/ipvs-operator/master/deploy/operator.yaml

This will install the IPVS operator as a DaemonSet on all of your nodes.

WeightedServices

You can use a WeightedService to apply IPVS load balancing weights to pods matching certain labels.

A WeightService can enable canary deployments by setting different weights for your canary and production deployments. See the IPVS weighted round-robin documentation for more information. If a scheduler is not set, it defaults to "wrr".

For example, to send 10% of traffic to your canary deployment:

apiVersion: codesink.net/v1alpha1
kind: WeightedService
metadata:
  name: example
spec:
  selector:
    app: nginx
  ports:
  - protocol: TCP
    port: 80
    targetPort: www
  scheduler: wlc
  weights:
  - weight: 10
    selector:
      env: prod
  - weight: 1
    selector:
      env: canary

The WeightedService will create a Service matching the provided ServiceSpec and assign weights to pods that match the specified labels.

See test/example.yaml for a full example.

Directories

Path Synopsis
cmd
pkg
apis/codesink/v1alpha1
+k8s:deepcopy-gen=package +groupName=codesink.net
+k8s:deepcopy-gen=package +groupName=codesink.net

Jump to

Keyboard shortcuts

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