Tools and Utilities
This section outlines the tools and utilities available in client-go. Client-go is a library for interacting with the Kubernetes API from Go applications. This documentation focuses on tools and utilities for developers.
Kubernetes Package: Contains the clientset for accessing the Kubernetes API. Source: README.md
Discovery Package: Used to discover APIs supported by a Kubernetes API server. Source: README.md
Dynamic Package: Contains a dynamic client that can perform generic operations on arbitrary Kubernetes API objects. Source: README.md
Authentication Plugins: The plugin/pkg/client/auth
packages contain optional authentication plugins for obtaining credentials from external sources. Source: README.md
Transport Package: Used to set up auth and start a connection. Source: README.md
Cache Package: The tools/cache
package is useful for writing controllers. Source: README.md
Examples: Provide practical examples for managing Kubernetes resources. Source: examples/README.md
Create, Get, Update, Delete Deployments: Examples for managing resources with the Kubernetes API. Source: examples/README.md
Dynamic Create, Update, Delete Deployments: Demonstrates fundamental operations like
Create
,List
,Update
, andDelete
using thedynamic
package. Source: examples/dynamic-create-update-delete-deployment/README.md
Error Handling:
- ErrNilObject: The
ErrNilObject
error signifies that an object is nil, which could occur during operations with Kubernetes objects. Source: tools/reference/ref.go
Metrics:
- RegisterMetrics: This function registers various metrics that track the performance and behavior of the Kubernetes API client. Source: tools/metrics/metrics.go
Events:
- EventRecorderAdapter: An adapter wrapping the
k8s.io/client-go/tools/record
.EventRecorder to implement thek8s.io/client-go/tools/events
.EventRecorder interface. Source: tools/record/event.go
Work Queue:
DoWorkPieceFunc: This function defines a function to execute work pieces in a parallel fashion. Source: util/workqueue/parallelizer.go
GlobalMetricsFactory: This variable holds a factory function for generating metrics related to the work queue. Source: util/workqueue/metrics.go
Client Command Loader:
- RecommendedHomeFile: Specifies the recommended location for the kubeconfig file. Source: tools/clientcmd/loader.go
Cache Mutation Detection:
- MutationDetectionEnabled: This variable indicates whether mutation detection is enabled in the cache. Source: tools/cache/mutation_detector.go
Top-Level Directory Explanations
applyconfigurations/ - This directory contains examples and tests for applying Kubernetes configurations using the client-go library.
discovery/ - This directory contains code related to service discovery in Kubernetes.
dynamic/ - This directory contains code for working with dynamic resources in the Kubernetes API.
examples/ - This directory contains example usage of the client-go library.
features/ - This directory contains experimental features that are not yet stable.
informers/ - This directory contains code for caching Kubernetes resources using informers.
kubernetes/ - This directory contains the main package for the client-go library, which provides types and functions for interacting with the Kubernetes API.
listers/ - This directory contains interfaces and implementations for listing Kubernetes resources.
metadata/ - This directory contains code related to metadata in Kubernetes.
openapi/ - This directory contains OpenAPI definitions for the Kubernetes API.
pkg/ - This directory contains compiled Go packages for the client-go library.
plugin/ - This directory contains code for loading plugins for the client-go library.
rest/ - This directory contains code for working with the REST API in the client-go library.
scale/ - This directory contains code for working with scale and autoscaling in Kubernetes.
tools/ - This directory contains various tools for working with the client-go library.
util/ - This directory contains utility functions for the client-go library.