kubex

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildConfigFromFlags

func BuildConfigFromFlags(masterUrl, kubeconfigPath, saTokenPath string) (*rest.Config, error)

BuildConfigFromFlags modified after copied from here https://github.com/kubernetes/client-go/blob/cf830e3cb3abbcc32cc1b6bea4feb1a9a1881af3/tools/clientcmd/client_config.go#L616

func PodReady added in v1.2.0

func PodReady(podScheduledIndicator chan string, since time.Time) func(event watch.Event) (bool, error)

PodReady returns true if the Pod is ready.

func RegisterKubeconfigFlag added in v1.2.0

func RegisterKubeconfigFlag(flags *pflag.FlagSet)

RegisterKubeconfigFlag registers `--kubeconfig` flag.

func WaitForPod added in v1.2.0

func WaitForPod(ctx context.Context, clientset *kubernetes.Clientset, namespace string, name string, exitCondition watchtools.ConditionFunc) error

WaitForPod watches a given Pod until the exitCondition is true.

Types

type ConfigWithMeta added in v1.2.0

type ConfigWithMeta struct {
	K8s            *rest.Config
	CurrentContext string
}

func LoadRestConfigWithMetaInformation added in v1.2.0

func LoadRestConfigWithMetaInformation() (*ConfigWithMeta, error)

LoadRestConfigWithMetaInformation loads a REST Config. Config precedence:

* --kubeconfig flag pointing at a file

* KUBECONFIG environment variable pointing at a file

* In-cluster config if running in cluster

* $HOME/.kube/config if exists.

code inspired by sigs.k8s.io/controller-runtime@v0.13.1/pkg/client/config/config.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL