GithubHelp home page GithubHelp logo

pfault / hcloud-private-fip-controller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rwunderer/hcloud-private-fip-controller

0.0 0.0 0.0 37 KB

small k8s controller to simulate a floating ip on hetzner cloud's private network.

License: Apache License 2.0

Makefile 4.97% Dockerfile 4.71% Go 90.32%

hcloud-private-fip-controller's Introduction

GitHub license

hcloud-private-fip-controller

small k8s controller to simulate a floating ip on hetzner cloud's private network.

The configuration of the ip on the node's interface is expected to be done by some external means. The controller runs on each possible target node and waits for the "floating" ip to be assigned locally. As soon as it detects the ip on a local interface it configures a corresponding route via hcloud API.

My personal use case for this feature is Talos' virtual IP on the control-plane of my cluster.

Usage

  • Define a private network with a large IP range (eg. 10.0.0.0/8) and a smaller subnet to place your nodes in (eg. 10.0.0.0/16). Choose an ip outside the subnet but from within the network range as the "floating" ip (eg. 10.255.255.1).

  • Configure some kind of vip handling for the ip (eg. Talos' virtual IP).

  • Configure and launch private-fip-controller on each node.

Configuration

The controller needs the following environment variables set:

  • HOST_IP - the IP address to use as destination for the route
  • HCLOUD_TOKEN - the API token for Hetzner Cloud.
  • HCLOUD_NETWORK - name or ID of the hetzner cloud private network
  • IP_ADDRESS - the actual "floating" ip

See deploy/daemonset.yaml for details.

Alternatively a yaml configuration file can be mounted into the container. Then only the environment variable CONFIG_FILE needs to be set to the full path of the configuration file:

hcloudToken: ABCDD....
hostIP: 1.2.3.4
ipAddress: 10.255.255.1
networkName: MyNet

Acknowledgements

As this is my first attempt at both go programming and a kubernetes controller. So I copied lots of code from various places in order to try and follow best practices.

Among others:

hcloud-private-fip-controller's People

Contributors

rwunderer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.