# client-go

> Go clients for talking to a Kubernetes cluster

Source: https://talira.ai/catalog/client-go-r1e72b66
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [infrastructure / kubernetes / client libraries](https://talira.ai/categories/infrastructure/kubernetes/client-libraries), [languages / go](https://talira.ai/categories/languages/go)
- Licence: Apache-2.0[^3]
- Pricing: Free and open source[^3]
- Free tier: yes[^3]
- Self-hostable: yes[^2]
- Plugins: yes[^2]
- Backed by: [Kubernetes SIG API Machinery](https://talira.ai/orgs/kubernetes-sig-api-machinery.md)

client-go is the official Go client library for the [Kubernetes](https://talira.ai/catalog/kubernetes-ftsegx3m.md) API, maintained by Kubernetes SIG API Machinery and published from the main Kubernetes repository. It has a typed clientset for the built-in APIs, a dynamic client for any resource, discovery, kubeconfig and in-cluster configuration, authentication plugins, and the building blocks controllers use: informers and listers (`tools/cache`), work queues, an event recorder, port forwarding and exec. Its `tools/leaderelection` package lets replicas of a service elect one leader through a Lease object in the cluster, with callbacks when a replica starts or stops leading; the package says it doesn't guarantee a single leader (no fencing) and is an alpha API. Each `v0.x.y` tag matches Kubernetes `v1.x.y`.

## Links

- GitHub: https://github.com/kubernetes/client-go
- Docs: https://pkg.go.dev/k8s.io/client-go

## Problems it solves

- call the Kubernetes API from my Go program
- only one replica of my Go service on Kubernetes should do the work at a time
- elect a leader among the pods of a deployment using a Kubernetes lease
- write a Kubernetes controller in Go that watches resources and reacts to changes
- cache Kubernetes objects locally and get notified when they change instead of polling the API
- read a kubeconfig or the in-cluster service account to connect to a cluster from Go
- work with custom resources from Go without generated types
- emit Kubernetes events from my Go operator
- port-forward or exec into a pod programmatically from Go
- test Go code that talks to Kubernetes with a fake clientset

## Features

- typed clientset for the Kubernetes API (kubernetes package)
- dynamic client for arbitrary resources, metadata client and discovery
- informers, listers and the tools/cache package for controllers
- rate-limited work queues (util/workqueue)
- leader election with Lease locks (tools/leaderelection)
- event recorder (tools/record, tools/events)
- kubeconfig loading (tools/clientcmd) and in-cluster config (rest)
- authentication plugins, including exec credential providers
- apply configurations for server-side apply
- port forwarding and remote command execution
- fake clientsets for tests
- v0.x.y tags matching each Kubernetes v1.x.y release

## Limitations

- Doesn't guarantee a single leader in its leader election package: it does no fencing, and the package is marked as an alpha API[^1]
- Doesn't promise compatible Go APIs between releases: its v0.x.y tags mean the APIs may change in incompatible ways[^2]

## Capabilities

- Takes plugins: plan not known

## Trust

Overall: 0.32 out of 1.
Signals: backing 0.30, extensibility 0.20.

- backed by Kubernetes SIG API Machinery
- has a plugin system

Warnings:

- GitHub activity not fetched yet

## Related

- Works with [Kubernetes](https://talira.ai/catalog/kubernetes-ftsegx3m.md)

## Sources

[^1]: https://github.com/kubernetes/client-go/blob/master/tools/leaderelection/leaderelection.go (checked 20 Nov 2026)
[^2]: https://github.com/kubernetes/client-go (checked 20 Nov 2026)
[^3]: https://github.com/kubernetes/client-go/blob/master/LICENSE (checked 20 Nov 2026)
