Documentation
¶
Overview ¶
Package client provides runtime configuration options for a Kubernetes client, making it easier to consistently have the same configuration options and flags across GitOps Toolkit components.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfigOrDie ¶
GetConfigOrDie wraps ctrl.GetConfigOrDie and sets the configured Options, returning the modified rest.Config.
Types ¶
type Options ¶
type Options struct {
// QPS indicates the maximum queries-per-second of requests sent to to the Kubernetes API, defaults to 20.
QPS float32
// Burst indicates the maximum burst queries-per-second of requests sent to the Kubernetes API, defaults to 50.
Burst int
}
Options contains the runtime configuration for a Kubernetes client.
The struct can be used in the main.go file of your controller by binding it to the main flag set, and then utilizing the configured options later:
func main() {
var (
// other controller specific configuration variables
clientOptions client.Options
)
// Bind the options to the main flag set, and parse it
clientOptions.BindFlags(flag.CommandLine)
flag.Parse()
// Get a runtime Kubernetes client configuration with the options set
restConfig := client.GetConfigOrDie(clientOptions)
}
Click to show internal directories.
Click to hide internal directories.