{"id":15640038,"url":"https://github.com/trstringer/k8s-controller-core-resource","last_synced_at":"2025-07-06T10:07:40.538Z","repository":{"id":43890450,"uuid":"129794298","full_name":"trstringer/k8s-controller-core-resource","owner":"trstringer","description":"Base sample for a custom controller in Kubernetes working with core resources","archived":false,"fork":false,"pushed_at":"2020-11-05T04:30:53.000Z","size":8,"stargazers_count":83,"open_issues_count":6,"forks_count":46,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T07:31:28.498Z","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}},"created_at":"2018-04-16T19:21:50.000Z","updated_at":"2025-02-22T08:39:54.000Z","dependencies_parsed_at":"2022-09-15T18:21:54.961Z","dependency_job_id":null,"html_url":"https://github.com/trstringer/k8s-controller-core-resource","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/trstringer/k8s-controller-core-resource","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fk8s-controller-core-resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fk8s-controller-core-resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fk8s-controller-core-resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fk8s-controller-core-resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trstringer","download_url":"https://codeload.github.com/trstringer/k8s-controller-core-resource/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trstringer%2Fk8s-controller-core-resource/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263882285,"owners_count":23524461,"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-03T11:30:31.183Z","updated_at":"2025-07-06T10:07:40.515Z","avatar_url":"https://github.com/trstringer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes Custom Controller - Core 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 pods (in the default namespace). 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-core-resource\n$ cd k8s-controller-core-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 run nginx --image=nginx\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-core-resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrstringer%2Fk8s-controller-core-resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrstringer%2Fk8s-controller-core-resource/lists"}