tool

package
v0.0.0-...-9752d8c Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package tool provides tools for operator communicating with K8S cluster

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHeadlessSvcResourceName

func BuildHeadlessSvcResourceName(name string) string

func BuildSvcResourceName

func BuildSvcResourceName(name string) string

Types

type K8sClient

type K8sClient struct {
	// kubernetes.Interface should be used instead of kubernets.Inteface for unit test (mocking)
	ClientSet kubernetes.Interface
	Config    *rest.Config
}

K8sClient is a struct which contains the kubernetes.Interface and *rest.Config.

func NewK8sClient

func NewK8sClient() (*K8sClient, error)

NewK8sClient is to generate a K8s client for interacting with the K8S cluster.

func (*K8sClient) Exec

func (client *K8sClient) Exec(namespace, podName, containerName string, command []string, stdin io.Reader) (*bytes.Buffer, *bytes.Buffer, error)

Exec enables operator to execute command in the pod's container in the K8S cluster. It returns the standard output and the standard error output.

Jump to

Keyboard shortcuts

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