• Stars
    star
    110
  • Rank 316,713 (Top 7 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Akrobateo is a simple Kubernetes operator to expose in-cluster LoadBalancer services as node hostPorts using DaemonSets.

Akrobateo

Akrobateo is a universal load balancer service implementation for Kubernetes. Akrobateo can work in any environment which makes it suitable for many use cases. And it's super light-weight too. It is implemented as an operator that reacts when it sees type: LoadBalancer services in the cluster.

Akrobateo exposes in-cluster LoadBalancer services as node hostPorts using DaemonSets. The operator naturally also syncs the addresses for the services. This essentially makes the LoadBalancer type services behave pretty much like NodePort services. The drawback with NodePort services is that we're not able to use additional components such as ExternalDNS and others.

The node-port proxy Pods utilize iptables to do the actual traffic forwarding.

Inspiration

This operator draws heavy inspiration from K3S servicelb controller: https://github.com/rancher/k3s/blob/master/pkg/servicelb/controller.go

As K3S controller is fully and tightly integrated into K3S, with good reasons, we thought we'd separate the concept into generic operator usable in any Kubernetes cluster.

Why DaemonSets?

Running the "proxies" as DaemonSets makes the proxy not to be a single-point-of-failure. So once you've exposed the service you can safely e.g. push the services external addresses into your DNS. This does have the drawback that a given port can be exposed only in one service throughout the cluster.

Building

Use the included build.sh script. There's naturally also a Dockerfile for putting everything into an image.

Build automation takes care of building all the release artifacts. So just create a tag for the release and everything will be build. The current build also produces multiarch images for both the operator and the LB image itself.

Running locally

Either use operator-sdk to run it like so:

operator-sdk up local

Or use the locally built binary:

WATCH_NAMESPACE="default" ./output/akrobateo_darwin_amd64

LB_IMAGE env variable can be set to define a custom LB image to be used.

Deploying

To deploy to live cluster, use manifests in deploy directory. It sets up the operator in kube-system namespace with proper service-account and RBAC to allow access to only needed resources.

Future

Some ideas how to make things more configurable and/or future-proof

DaemonSet vs. Deployment

The original Klippy controller creates Deployments. Maybe user could put some annotation on the service whether he/she wants a deployment or a daemonset created. Operator SDK SHOULD be able to handle the different kinds of objects as long as there's proper owner references set.

Node selection

There should be some way for the user to select which nodes should act as LBs. So something like a node selector is needed on the services as annotation. That probably also means we'd need to support also tolerations.

More Repositories

1

kontena

The developer friendly container and micro services platform. Works on any cloud, easy to setup, simple to use.
Ruby
1,470
star
2

pharos-cluster

Pharos - The Kubernetes Distribution
Ruby
312
star
3

mortar

The manifest shooter for Kubernetes
Ruby
145
star
4

kubelet-rubber-stamp

Simple CSR approver for Kubernetes
Go
91
star
5

k8s-client

Ruby Kubernetes API client
Ruby
76
star
6

kong-client-ruby

Kong API client for Ruby
Ruby
42
star
7

pharos-host-upgrades

Kube DaemonSet for host OS upgrades
Go
41
star
8

eventsourcing-example

Example of an eventsourcing microservices application with Kafka running on Kontena
C#
38
star
9

examples

JavaScript
24
star
10

kontena-stacks

Reusable Kontena Stacks
Shell
20
star
11

rails5-demo

Ruby
19
star
12

mongo-backup

Automated backups for MongoDB
Ruby
13
star
13

kontena-loadbalancer

Kontena Load Balancer
Ruby
11
star
14

clamp-completer

Automatically generate shell autocompletion scripts for clamp based ruby CLI tools
HTML
9
star
15

dotnet-example

Example .Net Core WebAPI application running on Docker and Kontena
C#
9
star
16

state-machine-events-example

Example microservices event based application using state machines and RabbitMQ
Ruby
9
star
17

pharos-docs

Pharos documentation
HTML
8
star
18

todo-example

CSS
6
star
19

wordpress-cluster

6
star
20

docs

Kontena Platform Documentation
JavaScript
5
star
21

kontena-git-builder

Build images via git push
Ruby
5
star
22

kontena-ipam

Kontena Docker IP Address Management Plugin
Ruby
5
star
23

kontena-terraform-modules

HCL
3
star
24

kontena-client-go

Golang Kontena API client library
Go
3
star
25

chpharos

Pharos version switcher
Shell
3
star
26

kontena-haproxy

Ruby
3
star
27

k8s-node-descale

Kubernetes node descaler
Ruby
3
star
28

terraform-provider-kontena

Native terraform provider for the Kontena API
Go
2
star
29

kontena-plugin-shell

Kontena Shell plugin, also known as KOSH.
Ruby
2
star
30

kontena-plugin-vagrant

Vagrant provision plugin for Kontena
Ruby
2
star
31

kontena-websocket-client

Ruby websocket client library
Ruby
2
star
32

wordpress

2
star
33

pharos-hello-world

HTML
1
star
34

kontena-cloud-issues

Kontena Cloud issue tracker
1
star
35

net-ssh-proxy-gateway

Net::SSH::Proxy compatible SSH-tunneling built on Net::SSH::Gateway
Ruby
1
star
36

kontena-log-archiver

1
star
37

kontena-plugin-packet

Ruby
1
star
38

homebrew-lens

Homebrew cask for Lens
Ruby
1
star
39

kontena-plugin-local

Manage local Kontena Platform, optimized for development workflows
Ruby
1
star
40

kontena-jumpstarter

Ruby
1
star