nativekubernetes

package
v0.435.0 Latest Latest
Warning

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

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

README

nativekubernetes package

Non object oriented implementation using the official client-go library to interact with kubernetes.

For the object oriented implmenetation see nativekubernetesoo.

Examples

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOnlyCombinedStreamAvailable = errors.New("specify the stream is not supported. Only combinded stream is availalbe by the kubernetes API, feature flag seems deactivated")

Functions

func DeletePod added in v0.361.0

func DeletePod(ctx context.Context, clientset *kubernetes.Clientset, podName string, namespace string) error

func GetClientSet

func GetClientSet(ctx context.Context, clusterName string) (*kubernetes.Clientset, error)

Get the kubernetes.Clientset to communicate with the kubernetes cluster.

If in cluster authentication is available (e.g. running in a pod in the cluster) the returned clientset uses this method.

Otherwise a clientset based on ~/.kube/config is returned.

clusterName is optional. If not specified the default cluster is taken.

func GetConfig added in v0.341.0

func GetConfig(ctx context.Context, clusterName string) (*rest.Config, error)

Get the rest.Config to communicate with the kubernetes cluster.

If in cluster authentication is available (e.g. running in a pod in the cluster) the returned config uses this method.

Otherwise a config based on ~/.kube/config is returned.

clusterName is optional. If not specified the default cluster is taken.

func GetConfigFromKubeconfig added in v0.341.0

func GetConfigFromKubeconfig(ctx context.Context, clusterName string) (*rest.Config, error)

func GetContainerAllLogs added in v0.361.0

func GetContainerAllLogs(ctx context.Context, clientset *kubernetes.Clientset, namespace string, podName string, containerName string) ([]byte, error)

'All' combines stdout and stderr.

func GetContainerLogs added in v0.361.0

func GetContainerLogs(ctx context.Context, clientset *kubernetes.Clientset, namespace string, podName string, containerName string) (stdout []byte, stderr []byte, err error)

func GetContainerStderrLogs added in v0.361.0

func GetContainerStderrLogs(ctx context.Context, clientset *kubernetes.Clientset, namespace string, podName string, containerName string) ([]byte, error)

func GetContainerStdoutLogs added in v0.361.0

func GetContainerStdoutLogs(ctx context.Context, clientset *kubernetes.Clientset, namespace string, podName string, containerName string) ([]byte, error)

func GetInClusterConfig added in v0.341.0

func GetInClusterConfig(ctx context.Context) (*rest.Config, error)

func RunCommandInTemporaryPod added in v0.361.0

func RunCommandInTemporaryPod(ctx context.Context, config *rest.Config, options *kubernetesparameteroptions.RunCommandOptions) (*commandoutput.CommandOutput, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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