k8sutil

package
v1.37.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2021 License: Apache-2.0 Imports: 32 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteKotsadm

func DeleteKotsadm(ctx context.Context, clientset *kubernetes.Clientset, namespace string, isKurl bool) error

func FindKotsadm

func FindKotsadm(clientset *kubernetes.Clientset, namespace string) (string, error)

func GetClientset

func GetClientset(kubernetesConfigFlags *genericclioptions.ConfigFlags) (*kubernetes.Clientset, error)

func GetCurrentRules

func GetCurrentRules(deployOptions kotsadmtypes.DeployOptions, clientset *kubernetes.Clientset) ([]rbacv1.PolicyRule, error)

func GetPodLogs

func GetPodLogs(ctx context.Context, clientset kubernetes.Interface, pod *corev1.Pod, follow bool, maxLines *int64) ([]byte, error)

func IsOpenShift

func IsOpenShift(clientset kubernetes.Interface) bool

IsOpenShift returns true if the cluster is positively identified as being an openshift cluster

func IsPortAvailable

func IsPortAvailable(port int) bool

func PortForward

func PortForward(kubernetesConfigFlags *genericclioptions.ConfigFlags, localPort int, remotePort int, namespace string, podName string, pollForAdditionalPorts bool, stopCh <-chan struct{}, log *logger.CLILogger) (int, <-chan error, error)

PortForward starts a local port forward to a pod in the cluster if localport is set, it will attempt to use that port locally. always check the port number returned though, because a port conflict could cause a different port to be used

func ReadKustomizationFromFile

func ReadKustomizationFromFile(file string) (*kustomizetypes.Kustomization, error)

func ScaleDownDeployment

func ScaleDownDeployment(ctx context.Context, clientset kubernetes.Interface, namespace string, deploymentName string) error

func ServiceForward

func ServiceForward(clientset *kubernetes.Clientset, cfg *rest.Config, localPort int, remotePort int, namespace string, serviceName string) (chan struct{}, error)

func WaitForDeploymentReady

func WaitForDeploymentReady(ctx context.Context, clientset kubernetes.Interface, namespace string, deploymentName string, timeout time.Duration) error

func WaitForKotsadm

func WaitForKotsadm(clientset *kubernetes.Clientset, namespace string, timeoutWaitingForWeb time.Duration) (string, error)

func WaitForPod

func WaitForPod(ctx context.Context, clientset kubernetes.Interface, namespace string, podName string, timeoutWaitingForPod time.Duration) error

func WriteKustomizationToFile

func WriteKustomizationToFile(kustomization kustomizetypes.Kustomization, file string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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