{"id":28578172,"url":"https://github.com/digitalocean/netbox-ip-controller","last_synced_at":"2025-06-11T01:09:04.898Z","repository":{"id":46881756,"uuid":"504646640","full_name":"digitalocean/netbox-ip-controller","owner":"digitalocean","description":"A Kubernetes controller to import the IP addresses and metadata of pods and services into NetBox.","archived":false,"fork":false,"pushed_at":"2025-06-10T17:16:07.000Z","size":14217,"stargazers_count":29,"open_issues_count":8,"forks_count":3,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-10T18:44:32.492Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalocean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-06-17T19:12:55.000Z","updated_at":"2025-06-09T16:38:39.000Z","dependencies_parsed_at":"2024-05-31T16:44:22.749Z","dependency_job_id":"2584248b-7dd9-4214-b966-0ae040d1f962","html_url":"https://github.com/digitalocean/netbox-ip-controller","commit_stats":{"total_commits":140,"total_committers":5,"mean_commits":28.0,"dds":0.3142857142857143,"last_synced_commit":"7fd52fa446fa2e09e53a1c576ddd3981636b0e9e"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fnetbox-ip-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fnetbox-ip-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fnetbox-ip-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fnetbox-ip-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalocean","download_url":"https://codeload.github.com/digitalocean/netbox-ip-controller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalocean%2Fnetbox-ip-controller/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259178519,"owners_count":22817388,"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":[],"created_at":"2025-06-11T01:09:04.197Z","updated_at":"2025-06-11T01:09:04.877Z","avatar_url":"https://github.com/digitalocean.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetBox IP Controller\n\nThis controller watches Kubernetes pods and services and imports their IPs,\nalong with some metadata such as domain names and Kubernetes labels, into NetBox.\n\n## Configuration\n\nController configuration may be specified with either flags or environment variables, with\nflags taking precedence.\nFor each of the flags listed below, the corresponding environment variable is all-uppercase\nwith dashes (`-`) replaced with underscores (`_`).\n\n Flag | Default | Description\n------|---------|------------\n`netbox-api-url` | | The URL of the NetBox API to connect to: `scheme://host:port/path`. Required.\n`netbox-token` | | NetBox API token to use for authentication. Required.\n`kube-config` | | Path to the kubeconfig file containing the address of the kube-apiserver to connect to and authentication info. The cluster you want the controller to connect to should be set as current context in the kubeconfig. Leave empty if the controller is running in-cluster. Optional.\n`netbox-ca-cert-path` | | Absolute path to a file containing a PEM-encoded root certificate to verify NetBox server's certificate \n`kube-qps` | `20` | Maximum number of requests per second to the kube-apiserver. Optional.\n`kube-burst` | `30` | Maximum number of requests to the kube-apiserver allowed to accumulate before throttling begins. Optional.\n`netbox-qps` | `100` | Average allowable requests per second to NetBox API, i.e., the rate limiter's token bucket refill rate per second\n`netbox-burst` | `1` | Maximum allowable burst of requests to NetBox API, i.e. the rate limiter's token bucket size\n`metrics-addr` | `:8001` | Sets the address that the controller will bind to for serving metrics. Can be a full TCP address or only a port (e.g. `:8081`). Optional.\n`cluster-domain` | `cluster.local` | Domain name of the cluster. Optional.\n`pod-ip-tags` | `kubernetes,k8s-pod` | Comma-separated list of tags to add to pod IPs in NetBox. Any tags that don't yet exist will be created. Optional.\n`service-ip-tags` | `kubernetes,k8s-service` | Comma-separated list of tags to add to service IPs in NetBox. Any tags that don't yet exist will be created. Optional.\n`pod-publish-labels` | `app` | Comma-separated list of kubernetes pod labels to be added to the IP description in NetBox in `label: label_value` format. Only the IPs of the pods that have at least one of these labels set will be exported. Set to an empty list if you do not want pod IPs exported. Optional. \n`service-publish-labels` | `app` | Comma-separated list of kubernetes service labels to be added to the IP description in NetBox in `label: label_value` format. Only the IPs of the services that have at least one of these labels set will be exported. Set to an empty list if you do not want service IPs exported. Optional. \n`dual-stack-ip` | `false` | Enables registering both IPv4 and IPv6 addresses of pods and services where applicable in dual stack clusters. Optional.\n`ready-check-addr` | `:5001` | Sets the address that the controller manager will bind to for serving the ready check endpoint. Can be a full TCP address or only a port (e.g. `:5001`). Optional. \n`debug` | `false` | Turns on debug logging. Optional.\n\n## Running locally\n\nThe most basic setup includes a NetBox and Kubernetes apiserver to connect to. The controller will be using `current-context` from the specified kubeconfig:\n\n```\ngo get github.com/digitalocean/netbox-ip-controller/cmd/netbox-ip-controller\nnetbox-ip-controller --kube-config=/.kube/config --netbox-api-url=https://some-netbox.example.com/api --netbox-token=\u003cyour-token\u003e \\\n  \n```\n\n## Running integration tests locally\n\nIntegration tests can be run locally by using the `integration-test` make target.\nThis sets up, executes, and cleans up the integration test. Alternatively, you can use the `setup`, `execute`, and `cleanup`\ntargets individually, which can be helpful for leaving the netbox environment up after executing tests for debugging.\n\n## Install\n\nA sample deployment for running in-cluster can be found at [docs/example-deployment.yml](docs/example-deployment.yml).\n**Note** that the controller will only export the IPs of the pods and services that have at least one of `--pod-publish-labels` or\n`--service-publish-labels` respectively set.\n\nIf you have RBAC enabled in the cluster, you will also need [docs/rbac.yml](/docs/rbac.yml).\n\nDocker images are automatically built and distributed for each release and can be found at `digitalocean/netbox-ip-controller:\u003ctag\u003e`.\nImage tags will always correspond to a release's version number. \n\nAlternatively, you can build and host the image yourself. After cloning the repo, build and push the docker image:\n```\ndocker build -t \u003cusername\u003e/netbox-ip-controller:\u003ctag\u003e ./cmd/netbox-ip-controller/\ndocker push \u003cusername\u003e/netbox-ip-controller:\u003ctag\u003e\n```\nand use `\u003cusername\u003e/netbox-ip-controller:\u003ctag\u003e` in your deployment manifest. \n\n## Uninstall\n\nAfter stopping netbox-ip-controller, the IP addresses published to NetBox by the controller will remain.\nYou can perform cleanup by running `netbox-ip-controller clean`, which will delete the IPs from NetBox\nand remove `NetBoxIP` custom resource objects from the cluster.\nMake sure to supply the same `netbox-api-url`, `netbox-token`, and `kube-config` (if any) as those used\nby the running controller.\n\n## Contributing\n\nContributions are welcome and appreciated. To help us review code and resolve issues faster,\nplease follow the [guidelines](CONTRIBUTING.md).\n\n## License\n\nCopyright 2022 DigitalOcean\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at:\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalocean%2Fnetbox-ip-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalocean%2Fnetbox-ip-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalocean%2Fnetbox-ip-controller/lists"}