{"id":13819895,"url":"https://github.com/iximiuz/client-go-examples","last_synced_at":"2025-05-14T21:04:19.322Z","repository":{"id":37725680,"uuid":"441745156","full_name":"iximiuz/client-go-examples","owner":"iximiuz","description":"Collection of mini-programs demonstrating Kubernetes client-go usage.","archived":false,"fork":false,"pushed_at":"2025-01-03T11:50:43.000Z","size":172,"stargazers_count":1076,"open_issues_count":4,"forks_count":142,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-05-10T05:09:09.852Z","etag":null,"topics":["client-go","kubernetes","kubernetes-api","kubernetes-client"],"latest_commit_sha":null,"homepage":"https://labs.iximiuz.com/playgrounds/k8s-client-go/","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/iximiuz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-25T19:28:17.000Z","updated_at":"2025-04-19T16:12:53.000Z","dependencies_parsed_at":"2022-09-14T13:53:16.467Z","dependency_job_id":"d90e88a1-41f2-4640-9143-4754189f336b","html_url":"https://github.com/iximiuz/client-go-examples","commit_stats":{"total_commits":50,"total_committers":6,"mean_commits":8.333333333333334,"dds":"0.18000000000000005","last_synced_commit":"310076d5b05d254aed7e27d04c1e1f7d0669f4f8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iximiuz%2Fclient-go-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iximiuz%2Fclient-go-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iximiuz%2Fclient-go-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iximiuz%2Fclient-go-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iximiuz","download_url":"https://codeload.github.com/iximiuz/client-go-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254227605,"owners_count":22035668,"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":["client-go","kubernetes","kubernetes-api","kubernetes-client"],"created_at":"2024-08-04T08:00:54.586Z","updated_at":"2025-05-14T21:04:19.221Z","avatar_url":"https://github.com/iximiuz.png","language":"Go","funding_links":[],"categories":["kubernetes","Go"],"sub_categories":[],"readme":"# Kubernetes client-go examples\n\n```diff\n! Support development of this project \u003e patreon.com/iximiuz\n```\n\nA collection of mini-programs demonstrating various [client-go](https://github.com/kubernetes/client-go) use cases augmented by a [preconfigured online development environment](https://labs.iximiuz.com/playgrounds/k8s-client-go/). Inspired by [client-go/examples](https://github.com/kubernetes/client-go/tree/master/examples).\n\nThe intention is to test a (more or less) fresh version of Go and `k8s.io` packages against the [currently maintained Kubernetes release branches](https://kubernetes.io/releases/).\n\nWhat is tested at the moment:\n\n- `go 1.22.10`\n- `k8s.io/client-go 0.28.14 0.29.12 0.30.8 0.31.4` (maintained release branches)\n- `Kubernetes 1.28.9 1.29.12 1.30.8 1.31.4` (best-effort match with versions supported by `kind`)\n\n## Setup\n\nMost examples expect at least two Kubernetes clusters - `shared1` and `shared2`.\n\n```bash\ncurl -sLS https://get.arkade.dev | sudo sh\narkade get kind kubectl\n\nkind create cluster --name shared1\nkind create cluster --name shared2\n```\n\n## Run\n\nOversimplified (for now):\n\n```bash\ncd \u003cprogram\u003e\nmake test\n\n# or from the root folder:\nmake test-all\n```\n\n## TODO\n\n- Add more assertions to mini-programs\n- Examples to be covered\n  - setting API request timeout\n  - configuring API request throttling\n  - `delete`\n  - `delete collection`\n  - `list` filtration\n  - `watch` filtration\n  - `informer` filtration\n  - `patch` with different strategies\n  - `Server Side Apply` (SSA)\n  - working with subresources\n  - `ownerReference` (one and many)\n  - optimistic locking\n  - https://stackoverflow.com/questions/56115197/how-to-idiomatically-fill-empty-fields-with-default-values-for-kubernetes-api-ob\n\n\n## Contribution\n\nContributions are always welcome! Want to participate but don't know where to start? The TODO list above could give you some ideas.\nBefore jumping to the code, please create an issue describing the addition/change first. This will allow me to coordinate the effort\nand make sure multiple people don't work on the same task.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiximiuz%2Fclient-go-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiximiuz%2Fclient-go-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiximiuz%2Fclient-go-examples/lists"}