kube

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UpboundKubeconfigKeyFmt is the format for Upbound control plane entries
	// in a kubeconfig file.
	UpboundKubeconfigKeyFmt = "upbound-%s"

	// UpboundK8sResource is appended to the end of the kubeconfig server path.
	UpboundK8sResource = "k8s"
)

Variables

This section is empty.

Functions

func BuildCloudControlPlaneKubeconfig added in v0.25.0

func BuildCloudControlPlaneKubeconfig(proxy *url.URL, id string, token string, includePrefix bool) *api.Config

BuildCloudControlPlaneKubeconfig builds a kubeconfig entry for a control plane.

func DynamicWatch added in v0.25.0

func DynamicWatch(ctx context.Context, r dynamic.NamespaceableResourceInterface, timeout *int64, done func(u *unstructured.Unstructured) (bool, error)) (chan error, error)

DynamicWatch starts a watch on the given resource type. The done callback is called on every received event until either timeout or context cancellation.

func GetKubeConfig

func GetKubeConfig(path string) (*rest.Config, error)

GetKubeConfig constructs a Kubernetes REST config from the specified kubeconfig, or falls back to same defaults as kubectl.

func MergeIntoKubeConfig added in v0.25.0

func MergeIntoKubeConfig(mcpConf *api.Config, existingFilePath string, setDefaultContext bool, preCheck ...func(cfg *api.Config) error) error

MergeIntoKubeConfig applies a control plane kubeconfig to an existing kubeconfig file and sets it as the current context.

func VerifyKubeConfig added in v0.25.0

func VerifyKubeConfig(wrapTransport transport.WrapperFunc) func(cfg *api.Config) error

Types

type ImagePullApplicator added in v0.25.0

type ImagePullApplicator struct {
	// contains filtered or unexported fields
}

ImagePullApplicator constructs and creates or updates an image pull Secret.

func NewImagePullApplicator added in v0.25.0

func NewImagePullApplicator(secret *SecretApplicator) *ImagePullApplicator

NewImagePullApplicator constructs a new ImagePullApplicator with the passed SecretApplicator. TODO(hasheddan): consider moving applicators to a common interface.

func (*ImagePullApplicator) Apply added in v0.25.0

func (i *ImagePullApplicator) Apply(ctx context.Context, name, ns, user, pass, registry string) error

Apply constructs an DockerConfig image pull Secret with the provided registry and credentials.

type SecretApplicator added in v0.5.0

type SecretApplicator struct {
	// contains filtered or unexported fields
}

SecretApplicator creates or updates Secrets. In the event that the Secret exists and must be updated, it is completely replaced, not patched.

func NewSecretApplicator added in v0.5.0

func NewSecretApplicator(client kubernetes.Interface) *SecretApplicator

NewSecretApplicator constructs a SecretApplicator with the passed Kubernetes client.

func (*SecretApplicator) Apply added in v0.5.0

func (s *SecretApplicator) Apply(ctx context.Context, ns string, secret *corev1.Secret) error

Apply creates or updates a Secret.

Jump to

Keyboard shortcuts

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