Documentation ¶
Index ¶
Constants ¶
const DefaultTimeout = 5 * time.Second
DefaultTimeout is the default REST config timeout.
Variables ¶
var CurrentContextName = currentContextNameFromConfig
CurrentContextName returns the name of the currently active k8s context as a string Can be changed in tests by reassigning this pointer.
Functions ¶
func AllKubectlConfigs ¶
AllKubectlConfigs creates a config for every context available in the kubeconfig. The configs are mapped by context name. There is no way to detect unhealthy clusters specified by a context, so timeout can be used to prevent calls to those clusters from hanging for long periods of time.
func NewConfigFlags ¶
func NewConfigFlags(config *rest.Config) (*genericclioptions.ConfigFlags, error)
NewConfigFlags builds ConfigFlags based on an existing rest config. Burst QPS is increased by 3x for discovery. CacheDir is populated from the KUBECACHEDIR env var, if set.
func NewRestConfig ¶
NewRestConfig will attempt to create a new rest config from all configured options and return the first successfully created configuration. The flag restConfigSource, if specified, will change the behavior to attempt to create from only the configured source.
func UpdateQPS ¶
UpdateQPS modifies a rest.Config to update the client-side throttling QPS and Burst QPS.
If Flow Control is enabled on the apiserver, client-side throttling is disabled!
If Flow Control is disabled or undetected on the apiserver, client-side throttling QPS will be increased to at least 30 (burst: 60).
Flow Control is enabled by default on Kubernetes v1.20+. https://kubernetes.io/docs/concepts/cluster-administration/flow-control/
Types ¶
This section is empty.