k8s.io/client-go@v0.22.2/examples/README.md (about) 1 # client-go Examples 2 3 This directory contains examples that cover various use cases and functionality 4 for client-go. 5 6 ### Auth plugins 7 8 Client configuration is typically loaded from kubeconfig files containing server and credential configuration. 9 Several plugins for obtaining credentials from external sources are available, but are not loaded by default. 10 To enable these plugins in your program, import them in your main package. 11 12 You can load all auth plugins: 13 ```go 14 import _ "k8s.io/client-go/plugin/pkg/client/auth" 15 ``` 16 17 Or you can load specific auth plugins: 18 ```go 19 import _ "k8s.io/client-go/plugin/pkg/client/auth/azure" 20 import _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" 21 import _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" 22 import _ "k8s.io/client-go/plugin/pkg/client/auth/openstack" 23 ``` 24 25 ### Configuration 26 27 - [**Authenticate in cluster**](./in-cluster-client-configuration): Configure a 28 client while running inside the Kubernetes cluster. 29 - [**Authenticate out of cluster**](./out-of-cluster-client-configuration): 30 Configure a client to access a Kubernetes cluster from outside. 31 32 ### Basics 33 34 - [**Managing resources with API**](./create-update-delete-deployment): Create, 35 get, update, delete a Deployment resource. 36 37 ### Advanced Concepts 38 39 - [**Work queues**](./workqueue): Create a hotloop-free controller with the 40 rate-limited workqueue and the [informer framework][informer]. 41 - [**Custom Resource Definition (successor of TPR)**](https://git.k8s.io/apiextensions-apiserver/examples/client-go): 42 Register a custom resource type with the API, create/update/query this custom 43 type, and write a controller that drives the cluster state based on the changes to 44 the custom resources. 45 - [**Leader election**](./leader-election): Demonstrates the use of the leader election package, which can be used to implement HA controllers. 46 47 [informer]: https://godoc.org/k8s.io/client-go/tools/cache#NewInformer 48 49 ### Testing 50 51 - [**Fake Client**](./fake-client): Use a fake client in tests.