{"id":18754727,"url":"https://github.com/oam-dev/trait-injector","last_synced_at":"2025-04-13T00:32:22.166Z","repository":{"id":52912010,"uuid":"238759900","full_name":"oam-dev/trait-injector","owner":"oam-dev","description":"Injector trait as a webhook to inject data into Workload.","archived":false,"fork":false,"pushed_at":"2021-04-14T07:09:09.000Z","size":270,"stargazers_count":15,"open_issues_count":1,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-26T19:03:38.868Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oam-dev.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":"2020-02-06T18:48:24.000Z","updated_at":"2021-04-14T09:15:28.000Z","dependencies_parsed_at":"2022-08-23T11:50:18.026Z","dependency_job_id":null,"html_url":"https://github.com/oam-dev/trait-injector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oam-dev%2Ftrait-injector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oam-dev%2Ftrait-injector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oam-dev%2Ftrait-injector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oam-dev%2Ftrait-injector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oam-dev","download_url":"https://codeload.github.com/oam-dev/trait-injector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650562,"owners_count":21139670,"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":"2024-11-07T17:29:50.210Z","updated_at":"2025-04-13T00:32:18.982Z","avatar_url":"https://github.com/oam-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Trait Injector\n\nTrait injector is a k8s admission webhook to inject data into workload.\n\nHow it works with AppConfig controller:\n\n![alt text](./doc/img/appconfig-interact.jpg)\n\n## Build\n\n```bash\nmake generate\nmake manifests\nmake\n```\n\n## Test\n\n```bash\nmake test\n```\n\n## SSL\n\nthe `ssl/` dir contains a script to create a self-signed certificate, not sure this will even work when running in k8s but that's part of figuring this out I guess\n\n_NOTE: the app expects the cert/key to be in `ssl/` dir relative to where the app is running/started and currently is hardcoded to `mutateme.{key,pem}`_\n\n```bash\npushd ssl/\nmake\npopd\n```\n\n## Docker\n\n```bash\nmake docker-build\n```\n\n## Quickstart\n\nGererate SSL certs if haven't done yet:\n\n```bash\npushd ssl/\nmake\npopd\n```\n\nReplace `caBundle` field value in `example/manager.yaml` with the data from below:\n\n```bash\nkubectl config view --raw --minify --flatten -o jsonpath='{.clusters[].cluster.certificate-authority-data}'\n```\n\nDeploy to Minikube:\n\n```bash\nmake minikube\n```\n\n\n## Inject Deployment\n\nCreate ServiceBinding:\n\n```bash\nkubectl create -f ./example/servicebinding.yaml\n```\n\nCreate the Deployment whose env to inject secret to, and also the Secret:\n```bash\nkubectl create -f ./example/test-deploy.yaml\n```\n\nVerify the `envFrom` field of the Deployment updated:\n\n```bash\nkubectl get deploy busybox1 -o json | jq -r '.spec.template.spec.containers[0]'\n```\n\n![alt text](./doc/img/envFrom.png)\n\n## Inject StatefulSet\n\nCreate ServiceBinding for StatefulSet example:\n\n```bash\nkubectl create -f ./example/statefulSet/binding.yaml\n```\n\nCreate the StatefulSet whose env to inject secret to, and also the Secret:\n```bash\nkubectl create -f ./example/statefulSet/statefulset.yaml\n```\n\nVerify the `envFrom` field of the Deployment updated:\n\n```bash\nkubectl get statefulset busybox1 -o json | jq -r '.spec.template.spec.containers[0]'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foam-dev%2Ftrait-injector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foam-dev%2Ftrait-injector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foam-dev%2Ftrait-injector/lists"}