项目作者: costela

项目描述 :
k8s controller for Hetzner Cloud floating IPs
高级语言: Go
项目地址: git://github.com/costela/hcloud-ip-floater.git
创建时间: 2019-11-03T13:05:09Z
项目社区:https://github.com/costela/hcloud-ip-floater

开源协议:GNU General Public License v3.0

下载


Go Report Card
Build Status

Hetzner Cloud™ IP Floater

This small kubernetes controller manages the attachment of
hetzner cloud (“hcloud”) floating IPs to kubernetes nodes.

It watches for changes to kubernetes LoadBalancer services, chooses one of the nodes where its pods are scheduled and
attaches its assigned floating IP to the selected node.

The service IP assignment is left to a separate component, like MetalLB.

Installation

The controller can be installed to a cluster using e.g. kustomize. Simply kubectl apply -k the
following kustomization.yaml:

  1. namespace: hcloud-ip-floater
  2. bases:
  3. - github.com/costela/hcloud-ip-floater/deploy?ref=v0.1.6
  4. secretGenerator:
  5. - name: hcloud-ip-floater-secret-env
  6. literals:
  7. - HCLOUD_IP_FLOATER_HCLOUD_TOKEN=<YOUR HCLOUD API TOKEN HERE>

The provided deployment manifest expects a secret named hcloud-ip-floater-secret-env to exist, which is the
recommended location for storing the hcloud API token.

It’s also possible to provide a configMapGenerator called hcloud-ip-floater-config-env with the non-secret options
listed in the configuration options section below.

⚠ in order for the controller to attach IPs to the hcloud nodes, the k8s nodes must use the same names as in
hcloud.

Configuration options

Either as command line arguments or environment variables.

--hcloud-token or HCLOUD_IP_FLOATER_HCLOUD_TOKEN (required)

API token for hetzner cloud access.

--service-label-selector or HCLOUD_IP_FLOATER_SERVICE_LABEL_SELECTOR

Service label selector to use when watching for kubernetes services. Any services that do not match this selector will be ignored by the controller.

Default: hcloud-ip-floater.cstl.dev/ignore!=true

--floating-label-selector or HCLOUD_IP_FLOATER_FLOATING_LABEL_SELECTOR

Label selector for hcloud floating IPs. Floating IPs that do not match this selector will be ignored by the controller.

Default: hcloud-ip-floater.cstl.dev/ignore!=true

--log-level or HCLOUD_IP_FLOATER_LOG_LEVEL

Log output verbosity (debug/info/warn/error)

Default: warn