{"id":48715682,"url":"https://github.com/cobaltcore-dev/labels-injector","last_synced_at":"2026-04-11T16:47:55.118Z","repository":{"id":335363317,"uuid":"931737654","full_name":"cobaltcore-dev/labels-injector","owner":"cobaltcore-dev","description":"transfers labels from node to pods","archived":false,"fork":false,"pushed_at":"2026-04-09T19:06:56.000Z","size":30018,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-04-11T16:47:53.271Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cobaltcore-dev.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-12T19:17:33.000Z","updated_at":"2026-04-09T19:04:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cobaltcore-dev/labels-injector","commit_stats":null,"previous_names":["cobaltcore-dev/labels-injector"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/cobaltcore-dev/labels-injector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobaltcore-dev%2Flabels-injector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobaltcore-dev%2Flabels-injector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobaltcore-dev%2Flabels-injector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobaltcore-dev%2Flabels-injector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cobaltcore-dev","download_url":"https://codeload.github.com/cobaltcore-dev/labels-injector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobaltcore-dev%2Flabels-injector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31687881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-04-11T16:47:54.354Z","updated_at":"2026-04-11T16:47:55.107Z","avatar_url":"https://github.com/cobaltcore-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\nSPDX-FileCopyrightText: Copyright 2025 SAP SE or an SAP affiliate company and cobaltcore-dev contributors\n\nSPDX-License-Identifier: Apache-2.0\n--\u003e\n# labels-injector [![REUSE status](https://api.reuse.software/badge/github.com/cobaltcore-dev/labels-injector)](https://api.reuse.software/info/github.com/cobaltcore-dev/labels-injector) [![Checks](https://github.com/cobaltcore-dev/labels-injector/actions/workflows/checks.yaml/badge.svg)](https://github.com/cobaltcore-dev/labels-injector/actions/workflows/checks.yaml) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n## Description\n\nKVM labels-injector is a lightweight Kubernetes controller that reconciles Pod resources and injects predefined labels taken from the Node each Pod is scheduled on.\n\nThis repository contains the controller source, Kubernetes manifests (kustomize), and a Helm chart.\n\n## Prerequisites\n\n- Go 1.23+ (for building from source)\n- Docker (if you want to build and push container images)\n- kubectl\n- Access to a Kubernetes cluster (v1.11.3+ should work; this project uses controller-runtime tooling)\n- make (GNU make recommended)\n\n## Quick developer checklist\n\n1. Build the controller binary:\n\n```sh\n    make build-all\n```\n\n   The built binary will be placed at `build/manager`.\n\n2. Install the binary locally (to /usr/local/bin by default):\n\n```sh\n    sudo make install\n```\n\n3. Generate Kubernetes manifests (deepcopy, CRDs, webhooks):\n\n```sh\n   make generate\n```\n\n   This will run `controller-gen` and place generated CRD artifacts under `config/crd`.\n\n4. Produce Helm chart from kustomize (optional):\n\n```sh\n   make helm-charts\n```\n\n   This uses `helmify` to convert the kustomize output into a Helm chart under `charts/labels-injector`.\n\n## Important make targets\n\n- `make build-all` — build the manager binary (output: `build/manager`).\n- `make install` — install `build/manager` to `$(PREFIX)/bin` (defaults to `/usr/local/bin` on macOS).\n- `make generate` — generate CRDs and deepcopy code using `controller-gen`.\n- `make helm-charts` — generate Helm chart from kustomize output with `helmify`.\n- `make check` — run unit tests, coverage and static checks (requires some tools).\n- `make tidy-deps` — run `go mod tidy` and `go mod verify`.\n- `make goimports` — run `goimports` over the repo.\n- `make clean` — remove build artifacts.\n\nSome make targets automatically install required tools if missing (see the top of the Makefile). In CI you may prefer installing tools via your package manager rather than letting the Makefile install them.\n\n## Building and publishing a container image\n\n1. Build the binary locally:\n\n```sh\n   make build-all\n```\n\n2. Build a container image (example):\n\n```sh\n   docker build -t \u003cregistry\u003e/labels-injector:\u003ctag\u003e .\n```\n\n3. Push the image:\n\n```sh\n   docker push \u003cregistry\u003e/labels-injector:\u003ctag\u003e\n```\n\n4. Update the deployment manifest or Helm values to use the pushed image and deploy to your cluster.\n\nTips: you can use `kind load docker-image` for local testing with kind clusters instead of pushing to a remote registry.\n\n## Running on Kubernetes\n\nThere are two supported deployment workflows: kustomize-based manifests (recommended for dev/test) and the Helm chart.\n\nKustomize (manifests)\n\n1. Generate code and CRDs (if you changed the API code):\n\n```sh\n   make generate\n```\n2. Apply the manifests (example using the `config/default` overlay):\n\n```sh\n   kubectl apply -k config/default\n```\n\n3. If you changed the image, update the deployment (for example):\n\n```sh\n   kubectl -n \u003cnamespace\u003e set image deployment/labels-injector manager=\u003cregistry\u003e/labels-injector:\u003ctag\u003e\n```\n\nHelm\n\n1. Generate the Helm chart (optional):\n\n```sh\n   make helm-charts\n```\n\n2. Install using Helm:\n\n```sh\n   helm install labels-injector charts/labels-injector --namespace \u003cnamespace\u003e --create-namespace\n```\n3. To upgrade after building a new image or chart:\n\n```sh\n   helm upgrade labels-injector charts/labels-injector --namespace \u003cnamespace\u003e\n```\n\nNotes on configuration\n\n- The `config/` directory contains kustomize overlays used for generating manifests. The default overlay (`config/default`) is a good starting point for a simple install.\n- RBAC, TLS/webhook configuration, metrics Service and ServiceAccount manifests are included in `config/` and in the Helm chart templates.\n\n## Local testing\n\nYou can test the controller locally against a Kubernetes API using `envtest` (used by controller-runtime) — the project Makefile knows how to install `setup-envtest` and run tests that use it. To run the unit tests and generate a coverage report:\n\n```sh\nmake build/cover.out\nmake build/cover.html\n```\n\n## Troubleshooting\n\n- `controller-gen` not found: run `make install-controller-gen` or install it manually (`go install sigs.k8s.io/controller-tools/cmd/controller-gen@latest`).\n- `helmify` missing for `make helm-charts`: install it (`go install github.com/arttor/helmify/cmd/helmify@latest`) or install Helm and use the included chart directly.\n- Image does not update in cluster: make sure you updated the deployment image or the Helm values and redeployed (see commands above). If using immutable image tags, bump the tag.\n\n## Contributing\n\nContributions are welcome. Please follow the repository conventions and run `make goimports` and `make run-golangci-lint` before opening a PR.\n\n## Support, Feedback, Contributing\n\nThis project is open to feature requests/suggestions, bug reports etc. via [GitHub issues](https://github.com/cobaltcore-dev/labels-injector/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).\n\n## Security / Disclosure\nIf you find any bug that may be a security problem, please follow our instructions at [in our security policy](https://github.com/cobaltcore-dev/labels-injector/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems.\n\n## Code of Conduct\n\nWe as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its [Code of Conduct](https://github.com/SAP/.github/blob/main/CODE_OF_CONDUCT.md) at all times.\n\n## License\n\nCopyright 2025.\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\n    http://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\nPlease see our [LICENSE](LICENSE) for copyright and license information.\nDetailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/cobaltcore-dev/kvm-node-agent).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobaltcore-dev%2Flabels-injector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobaltcore-dev%2Flabels-injector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobaltcore-dev%2Flabels-injector/lists"}