Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iximiuz/client-go-examples
Collection of mini-programs demonstrating Kubernetes client-go usage.
https://github.com/iximiuz/client-go-examples
client-go kubernetes kubernetes-api kubernetes-client
Last synced: about 1 month ago
JSON representation
Collection of mini-programs demonstrating Kubernetes client-go usage.
- Host: GitHub
- URL: https://github.com/iximiuz/client-go-examples
- Owner: iximiuz
- License: apache-2.0
- Created: 2021-12-25T19:28:17.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-04T20:17:33.000Z (2 months ago)
- Last Synced: 2024-09-26T22:02:28.133Z (about 2 months ago)
- Topics: client-go, kubernetes, kubernetes-api, kubernetes-client
- Language: Go
- Homepage: https://labs.iximiuz.com/playgrounds/k8s-client-go/
- Size: 154 KB
- Stars: 1,043
- Watchers: 23
- Forks: 135
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kubernetes client-go examples
```diff
! Support development of this project > patreon.com/iximiuz
```A 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).
The 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/).
What is tested at the moment:
- `go 1.22.3`
- `k8s.io/client-go 0.27.14 0.28.10 0.29.5 0.30.1` (maintained release branches)
- `Kubernetes 1.27.13 1.28.9 1.29.4 1.30.0` (best-effort match with versions supported by `kind`)## Setup
Most examples expect at least two Kubernetes clusters - `shared1` and `shared2`.
```bash
curl -sLS https://get.arkade.dev | sudo sh
arkade get kind kubectlkind create cluster --name shared1
kind create cluster --name shared2
```## Run
Oversimplified (for now):
```bash
cd
make test# or from the root folder:
make test-all
```## TODO
- Add more assertions to mini-programs
- Examples to be covered
- setting API request timeout
- configuring API request throttling
- `delete`
- `delete collection`
- `list` filtration
- `watch` filtration
- `informer` filtration
- `patch` with different strategies
- `Server Side Apply` (SSA)
- working with subresources
- `ownerReference` (one and many)
- optimistic locking
- https://stackoverflow.com/questions/56115197/how-to-idiomatically-fill-empty-fields-with-default-values-for-kubernetes-api-ob## Contribution
Contributions are always welcome! Want to participate but don't know where to start? The TODO list above could give you some ideas.
Before jumping to the code, please create an issue describing the addition/change first. This will allow me to coordinate the effort
and make sure multiple people don't work on the same task.