A kubernetes controller that watches for services of type LoadBalancer
and creates a floating IP
on cloudscale.ch for those services. The floating IP will be attached to the server where one of
the services pods in state Running
is located.
It is safe to run multiple replicas of this controller.
The following annotations on services of type LoadBalancer
are supported:
linkyard.ch/slb-controller-id
: this service must be processed by a controller with the given idlinkyard.ch/existing-floating-ip
: use the already existing floating IP on cloudscale.ch for this service; note that no additional checks (e.g. port collisions) are performedlinkyard.ch/preserve-floating-ip
: don't delete the floating IP on cloudscale.ch when the service is deleted (or otherwise changed in a way that the IP no longer belongs to it). Default isfalse
The following configuration flags are supported:
-cloudscale-token
,CLOUDSCALE_TOKEN
, no default, required: cloudscale.ch API token with write access-ip-limit
,IP_LIMIT
, default5
: maximum number of floating ips that are allowed to exist on the cloudscale.ch account; this is used as an additional guard in case this controller is out of control and would create an infinite amount of floating ips-controller-id
,CONTROLLER_ID
, no default: if set, the controller will only process services with alinkyard.ch/slb-controller-id
annotation set to this value-leader-election-configmap
,LEADER_ELECTION_CONFIGMAP
, no default: name of theConfigMap
to use for leader election-leader-election-namespace
LEADER_ELECTION_NAMESPACE
, no default: name of the namespace where theConfigMap
for leader election is located at-leader-election-node
,LEADER_ELECTION_NODE
, no default: name of the pod-leader-election-ttl
,LEADER_ELECTION_TTL
, default10s
: TTL for leader election, e.g.10s
; valid time units arens
,us
,ms
,s
,m
andh
.-log-level
,LOG_LEVEL
, defaultDebug
: log level to set; possible values are:Panic
,Fatal
,Error
,Warn
,Info
,Debug
,Trace
-kubeconfig
,KUBECONFIG
, no default, not required: path to a kubernetes kubconfig file; this is not required when running inside a kubernetes cluster-fake-cloudscale-client
,FAKE_CLOUDSCALE_CLIENT
: set totrue
to use a fake cloudscale.ch API client-chaos-chance
,CHAOS_CHANCE
, default0
: chance of a call to one of the fake components failing; range[0.0,1,0)