All Projects → MOZGIII → port-map-operator

MOZGIII / port-map-operator

Licence: MIT License
LoadBalancer Service type implementation for home Kubernetes clusters via Port Control Protocol.

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to port-map-operator

Captain
A Helm 3 Controller
Stars: ✭ 129 (+416%)
Mutual labels:  kubernetes-operator, kubernetes-controller
wordpress-operator
Bitpoke Kubernetes operator for WordPress
Stars: ✭ 159 (+536%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Cronjobber
Cronjobber is a cronjob controller for Kubernetes with support for time zones
Stars: ✭ 169 (+576%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Spark On K8s Operator
Kubernetes operator for managing the lifecycle of Apache Spark applications on Kubernetes.
Stars: ✭ 1,780 (+7020%)
Mutual labels:  kubernetes-operator, kubernetes-controller
mysql-operator
Asynchronous MySQL Replication on Kubernetes using Percona Server and Openark's Orchestrator.
Stars: ✭ 810 (+3140%)
Mutual labels:  kubernetes-operator, kubernetes-controller
K8gb
A cloud native Kubernetes Global Balancer
Stars: ✭ 113 (+352%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Bonny
The Elixir based Kubernetes Development Framework
Stars: ✭ 190 (+660%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Airflow Operator
Kubernetes custom controller and CRDs to managing Airflow
Stars: ✭ 278 (+1012%)
Mutual labels:  kubernetes-operator, kubernetes-controller
kotary
Managing Kubernetes Quota with confidence
Stars: ✭ 85 (+240%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Strimzi Kafka Operator
Apache Kafka running on Kubernetes
Stars: ✭ 2,833 (+11232%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Sens8
Kubernetes controller for Sensu checks
Stars: ✭ 42 (+68%)
Mutual labels:  kubernetes-operator, kubernetes-controller
cdap-operator
CDAP Kubernetes Operator
Stars: ✭ 17 (-32%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Kudo
Kubernetes Universal Declarative Operator (KUDO)
Stars: ✭ 849 (+3296%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Wordpress Operator
WordPress operator for Kubernetes
Stars: ✭ 127 (+408%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Mysql Operator
Bulletproof MySQL on Kubernetes using Percona Server
Stars: ✭ 527 (+2008%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Operators
Collection of Kubernetes Operators built with KUDO.
Stars: ✭ 175 (+600%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Operator Kit
A library for creating a Kubernetes Operator
Stars: ✭ 275 (+1000%)
Mutual labels:  kubernetes-operator, kubernetes-controller
Rbacsync
Automatically sync groups into Kubernetes RBAC
Stars: ✭ 197 (+688%)
Mutual labels:  kubernetes-operator, kubernetes-controller
kubereplay
Seamless integration of goReplay and Kubernetes
Stars: ✭ 30 (+20%)
Mutual labels:  kubernetes-operator, kubernetes-controller
aws-iam-operator
AWS IAM Operator for Kubernetes
Stars: ✭ 23 (-8%)
Mutual labels:  kubernetes-operator, kubernetes-controller

port-map-operator

A LoadBalancer Service type implementation for small home clusters.

Maps the ports from your router to a Kubernetes cluster node via the Port Control Protocol.

It does not perform real load balancing of any kind, but just takes care of the port forwarding so traffic can reach the cluster node. Kubernetes still does its internal service-level load balancing.

Requirements

  • Kubernetes cluster that can run Pods with hostNetwork: true
  • Router that supports PCP for port mapping
  • No other controllers implementing LoadBalancer Service type running in the cluster (to avoid conflicts)

Deployment

See the config dir.

Use the config/default as a Kustomization base, don't forget to update the image to a non-rolling docker tag (using rolling tags like latest, nightly or master is not recommended).

If you have issues with PCP server autodiscovery, you can specify the address manually. A typical value would be the address of your router with port 5351 (standard PCP server port), or 5350. To configure the address, add the argument in the form of --pcp-server=192.168.1.1:5351 to the container command.

Usage

After the operator is installed, just create a Service with type: LoadBalancer, and the operator will map the port and fill in the externalIP.

This is how it should look like:

$ kubectl get svc
NAME         TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)          AGE
podinfo      LoadBalancer   10.98.1.2      1.2.3.4         1234:31234/TCP   1h

The port map should also be visible in your router UI, for instance at the OpenWRT it can be found on the UPnP page.

If everything works, you (or anyone on the internet) should be able to reach the service via the IP and the port of the service. In the example above - the service will be available at 1.2.3.4:1234.

Caveats

Mapping ports lower than 1024

When trying to map ports in the range 0-1024, you may find that the mapping does not work. This is a security measure taken by the PCP servers to prevent abuse. You should be able to tune your PCP server (router) to allow port maps in the 0-1024 for your Kubernetes nodes if you really want to. See the documentation on your PCP server / router for more info.

Development

Testing

hack/intestenv.sh go test ./...

Updating dependencies

./go-vendor-update.sh

or just merge what dependabot proposes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].