{"id":21133907,"url":"https://github.com/mozgiii/port-map-operator","last_synced_at":"2025-07-09T02:32:07.764Z","repository":{"id":37095325,"uuid":"338563831","full_name":"MOZGIII/port-map-operator","owner":"MOZGIII","description":"LoadBalancer Service type implementation for home Kubernetes clusters via Port Control Protocol.","archived":false,"fork":false,"pushed_at":"2023-01-24T10:03:19.000Z","size":20475,"stargazers_count":28,"open_issues_count":25,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-19T02:10:33.061Z","etag":null,"topics":["kubernetes","kubernetes-controller","kubernetes-loadbalancer","kubernetes-operator","port-forwarding","port-mapping"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/repository/docker/mozgiii/port-map-operator/general","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MOZGIII.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-13T11:54:52.000Z","updated_at":"2023-09-26T15:55:48.000Z","dependencies_parsed_at":"2023-02-13T20:01:58.605Z","dependency_job_id":null,"html_url":"https://github.com/MOZGIII/port-map-operator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MOZGIII%2Fport-map-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MOZGIII%2Fport-map-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MOZGIII%2Fport-map-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MOZGIII%2Fport-map-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MOZGIII","download_url":"https://codeload.github.com/MOZGIII/port-map-operator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476533,"owners_count":17480303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubernetes","kubernetes-controller","kubernetes-loadbalancer","kubernetes-operator","port-forwarding","port-mapping"],"created_at":"2024-11-20T06:19:31.813Z","updated_at":"2024-11-20T06:19:32.471Z","avatar_url":"https://github.com/MOZGIII.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# port-map-operator\n\nA `LoadBalancer` `Service` type implementation for small home clusters.\n\nMaps the ports from your router to a Kubernetes cluster node\nvia the [Port Control Protocol](https://tools.ietf.org/html/rfc6887).\n\nIt does not perform real load balancing of any kind, but just takes care of\nthe port forwarding so traffic can reach the cluster node.\nKubernetes still does its internal service-level load balancing.\n\n## Requirements\n\n- Kubernetes cluster that can run `Pod`s with `hostNetwork: true`\n- Router that supports [PCP](https://tools.ietf.org/html/rfc6887)\n  for port mapping\n- No other controllers implementing `LoadBalancer` `Service` type running in\n  the cluster (to avoid conflicts)\n\n## Deployment\n\nSee the `config` dir.\n\nUse the `config/default` as a Kustomization base, don't forget to update the\nimage to a non-rolling docker tag (using rolling tags like `latest`, `nightly`\nor `master` is not recommended).\n\nIf you have issues with PCP server autodiscovery, you can specify the address\nmanually. A typical value would be the address of your router with port `5351`\n(standard PCP server port), or `5350`.\nTo configure the address, add the argument in the form of\n`--pcp-server=192.168.1.1:5351` to the container command.\n\n## Usage\n\nAfter the operator is installed, just create a `Service` with\n`type: LoadBalancer`, and the operator will map the port and fill in the\n`externalIP`.\n\nThis is how it should look like:\n\n```shell\n$ kubectl get svc\nNAME         TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)          AGE\npodinfo      LoadBalancer   10.98.1.2      1.2.3.4         1234:31234/TCP   1h\n```\n\nThe port map should also be visible in your router UI, for instance at\nthe OpenWRT it can be found on the UPnP page.\n\nIf everything works, you (or anyone on the internet) should be able to reach\nthe service via the IP and the port of the service.\nIn the example above - the service will be available at `1.2.3.4:1234`.\n\n## Caveats\n\n### Mapping ports lower than 1024\n\nWhen trying to map ports in the range 0-1024, you may find that the mapping does\nnot work. This is a security measure taken by the PCP servers to prevent abuse.\nYou should be able to tune your PCP server (router) to allow port maps in\nthe 0-1024 for your Kubernetes nodes if you really want to.\nSee the documentation on your PCP server / router for more info.\n\n## Development\n\n### Testing\n\n```bash\nhack/intestenv.sh go test ./...\n```\n\n### Updating dependencies\n\n```bash\n./go-vendor-update.sh\n```\n\nor just merge what dependabot proposes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozgiii%2Fport-map-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmozgiii%2Fport-map-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmozgiii%2Fport-map-operator/lists"}