mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-16 23:28:25 +00:00
This fixes some scope isses that were introduced by shadowing vars inside anonymous functions as well as using a naked return. Fixed by using unique err names and explicitly returning errors. Additional improvement is using the HomeDir() util function provided by client-go instead of including a helper function at the bottom of this example. Signed-off-by: John Kelly <jekohk@gmail.com> Kubernetes-commit: e71c9f1b4beb06bcd3694163e6bf1764fb49edd6
client-go Examples
This directory contains examples that cover various use cases and functionality for client-go.
Configuration
- Authenticate in cluster: Configure a client while running inside the Kubernetes cluster.
- Authenticate out of cluster: Configure a client to access a Kubernetes cluster from outside.
Basics
- Managing resources with API: Create, get, update, delete a Deployment resource.
Advanced Concepts
- Work queues: Create a hotloop-free controller with the rate-limited workqueue and the informer framework.
- Custom Resource Definition (successor of TPR): Register a custom resource type with the API, create/update/query this custom type, and write a controller that drives the cluster state based on the changes to the custom resources.