{"id":15645137,"url":"https://github.com/trstringer/k8s-controller-custom-resource","last_synced_at":"2025-04-09T14:15:54.956Z","repository":{"id":147740089,"uuid":"129989833","full_name":"trstringer/k8s-controller-custom-resource","owner":"trstringer","description":"Base sample for a custom controller in Kubernetes working with custom resources","archived":false,"fork":false,"pushed_at":"2018-05-21T11:35:12.000Z","size":30,"stargazers_count":64,"open_issues_count":3,"forks_count":355,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T13:04:46.861Z","etag":null,"topics":["kubernetes","kubernetes-controllers"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trstringer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2018-04-18T02:08:28.000Z","updated_at":"2025-02-24T12:37:52.000Z","dependencies_parsed_at":"2023-05-27T09:15:15.713Z","dependency_job_id":null,"html_url":"https://github.com/trstringer/k8s-controller-custom-resource","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/trstringer%2Fk8s-controller-custom-resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fk8s-controller-custom-resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fk8s-controller-custom-resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fk8s-controller-custom-resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trstringer","download_url":"https://codeload.github.com/trstringer/k8s-controller-custom-resource/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054194,"owners_count":21039952,"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-controllers"],"created_at":"2024-10-03T12:04:44.656Z","updated_at":"2025-04-09T14:15:54.934Z","avatar_url":"https://github.com/trstringer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes Custom Controller - Custom Resource Handling\n\n**Note**: the source code is _verbosely_ commented, so the source is meant to be read and to teach\n\n## What is this?\n\nAn example of a custom Kubernetes controller that's only purpose is to watch for the creation, updating, or deletion of all custom resource of type `MyResource` (in the all namespaces). This was created as an exercise to understand how Kubernetes controllers work and interact with the cluster and resources.\n\n## Running\n\n```\n$ git clone https://github.com/trstringer/k8s-controller-custom-resource\n$ cd k8s-controller-custom-resource\n$ go run *.go\n```\n\n## Inspecting resources in the handler\n\nYou are welcome to dump the resources themselves in handler but logging would be extremely verbose (and not interactive). I recommend you use a debugger...\n\n```\n$ dlv debug\n(dlv) b main.ObjectCreated\n(dlv) c\n```\n\nYou can then trigger an event by creating a deployment of nginx...\n\n```\n$ kubectl apply -f example/example-myresource.yaml\n```\n\nThe breakpoint should be hit and you can analyze in the debugger the object...\n\n```\n(dlv) p obj\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrstringer%2Fk8s-controller-custom-resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrstringer%2Fk8s-controller-custom-resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrstringer%2Fk8s-controller-custom-resource/lists"}