{"id":19359180,"url":"https://github.com/opslevel/opslevel-k8s-controller","last_synced_at":"2025-02-24T12:16:05.666Z","repository":{"id":204999358,"uuid":"713043337","full_name":"OpsLevel/opslevel-k8s-controller","owner":"OpsLevel","description":"A utility library for easily making and running k8s controllers","archived":false,"fork":false,"pushed_at":"2025-02-17T20:43:46.000Z","size":159,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T21:32:41.421Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpsLevel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"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}},"created_at":"2023-11-01T18:11:31.000Z","updated_at":"2025-01-06T20:42:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"55a4d9cb-2111-4280-be03-d217e0db03a1","html_url":"https://github.com/OpsLevel/opslevel-k8s-controller","commit_stats":null,"previous_names":["opslevel/opslevel-k8s-controller"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpsLevel%2Fopslevel-k8s-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpsLevel%2Fopslevel-k8s-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpsLevel%2Fopslevel-k8s-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpsLevel%2Fopslevel-k8s-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpsLevel","download_url":"https://codeload.github.com/OpsLevel/opslevel-k8s-controller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240475234,"owners_count":19807292,"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-10T07:14:19.470Z","updated_at":"2025-02-24T12:16:05.631Z","avatar_url":"https://github.com/OpsLevel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/OpsLevel/opslevel-k8s-controller/blob/main/LICENSE\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/OpsLevel/opslevel-k8s-controller.svg\" alt=\"License\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://go.dev\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/go-mod/go-version/OpsLevel/opslevel-k8s-controller\" alt=\"Made With Go\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://GitHub.com/OpsLevel/opslevel-k8s-controller/releases/\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/release/OpsLevel/opslevel-k8s-controller?include_prereleases\" alt=\"Release\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://GitHub.com/OpsLevel/opslevel-k8s-controller/issues/\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/issues/OpsLevel/opslevel-k8s-controller.svg\" alt=\"Issues\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/OpsLevel/opslevel-k8s-controller/graphs/contributors\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/contributors/OpsLevel/opslevel-k8s-controller\" alt=\"Contributors\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/OpsLevel/opslevel-k8s-controller/pulse\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/commit-activity/m/OpsLevel/opslevel-k8s-controller\" alt=\"Activity\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/OpsLevel/opslevel-k8s-controller\"\u003e\n        \u003cimg src=\"https://codecov.io/gh/OpsLevel/opslevel-k8s-controller/branch/main/graph/badge.svg?token=GHQHRIJ9UW\" alt=\"CodeCov\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://dependabot.com/\"\u003e\n        \u003cimg src=\"https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot\" alt=\"Dependabot\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://pkg.go.dev/github.com/opslevel/opslevel-k8s-controller/v2024\"\u003e\n        \u003cimg src=\"https://pkg.go.dev/badge/github.com/opslevel/opslevel.svg\" alt=\"Go Reference\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n[![Overall](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fapp.opslevel.com%2Fapi%2Fservice_level%2FDEmrX2bjoPualtC4Pri1YvjydDrza6V1V5srMvcZNbQ)](https://app.opslevel.com/services/opslevel-k8s-controller/maturity-report)\n\n# opslevel-k8s-controller\nA utility library for easily making and running k8s controllers\n\n# Installation\n\n```bash\ngo get github.com/opslevel/opslevel-k8s-controller/v2024\n```\n\nThen to create a k8s controller you can simply do\n\n```go\nselector := opslevel_k8s_controller.K8SSelector{\n    ApiVersion: \"apps/v1\",\n    Kind: \"Deployment\",\n    Excludes: []string{`.metadata.namespace == \"kube-system\"`}\n}\nresync := time.Hour*24\nbatch := 500\nrunOnce := false\ncontroller, err := opslevel_k8s_controller.NewK8SController(selector, resync, batch, runOnce)\nif err != nil {\n    //... Handle error ...\n}\ncallback := func(items []interface{}) {\n    for _, item := range items {\n        // ... Process K8S Resource ...\n    }\n}\ncontroller.OnAdd = callback\ncontroller.OnUpdate = callback\ncontroller.Start()\n```\n\nBecause of the way the selector works you can easily target any k8s resource in your cluster and you have the power of JQ\nto exclude resources that might match the expression.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopslevel%2Fopslevel-k8s-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopslevel%2Fopslevel-k8s-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopslevel%2Fopslevel-k8s-controller/lists"}