kubeapi

package
v4.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLabelToDeployment

func AddLabelToDeployment(clientset kubernetes.Interface, origDeployment *v1.Deployment, key, value, namespace string) error

func AddLabelToPod

func AddLabelToPod(clientset kubernetes.Interface, origPod *v1.Pod, key, value, namespace string) error

func ExecToPodThroughAPI

func ExecToPodThroughAPI(config *rest.Config, clientset kubernetes.Interface, command []string, containerName, podName, namespace string, stdin io.Reader) (string, string, error)

ExecToPodThroughAPI uninterractively exec to the pod with the command specified. :param string command: list of the str which specify the command. :param string pod_name: Pod name :param string namespace: namespace of the Pod. :param io.Reader stdin: Standerd Input if necessary, otherwise `nil` :return: string: Output of the command. (STDOUT)

string: Errors. (STDERR)
 error: If any error has occurred otherwise `nil`

func FindOrAppendVolume

func FindOrAppendVolume(volumes *[]v1.Volume, name string) *v1.Volume

FindOrAppendVolume returns a pointer to the Volume in volumes named name. If no such Volume exists, it creates one with that name and returns it.

func FindOrAppendVolumeMount

func FindOrAppendVolumeMount(mounts *[]v1.VolumeMount, name string) *v1.VolumeMount

FindOrAppendVolumeMount returns a pointer to the VolumeMount in mounts named name. If no such VolumeMount exists, it creates one with that name and returns it.

func IsAlreadyExists

func IsAlreadyExists(err error) bool

IsAlreadyExists returns true if the err indicates that a resource already exists.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if err indicates that a resource was not found.

Types

type Client

type Client struct {
	*rest.Config
	*kubernetes.Clientset
	// contains filtered or unexported fields
}

Client provides methods for interacting with Kubernetes resources. It implements both kubernetes and crunchydata clientset Interfaces.

func NewClient

func NewClient() (*Client, error)

NewClient returns a kubernetes.Clientset and its underlying configuration.

func (*Client) CrunchydataV1

func (c *Client) CrunchydataV1() crunchydatav1.CrunchydataV1Interface

CrunchydataV1 retrieves the CrunchydataV1Client

type GetEndpointRequest

type GetEndpointRequest struct {
	Clientset kubernetes.Interface // Kubernetes Clientset that interfaces with the Kubernetes cluster
	Name      string               // Name of the endpoint that is being queried
	Namespace string               // Namespace the endpoint being queried resides in
}

GetEndpointRequest is used for the GetEndpoint function, which includes the current Kubernetes request context, as well as the namespace / endpoint name being requested

type GetEndpointResponse

type GetEndpointResponse struct {
	Endpoint  *v1.Endpoints // Kubernetes Endpoint object that specifics about the endpoint
	Name      string        // Name of the endpoint
	Namespace string        // Namespace that the endpoint is in
}

GetEndpointResponse contains the results from a successful request to the endpoint API, including the Kubernetes Endpoint as well as the original request data

func GetEndpoint

func GetEndpoint(request *GetEndpointRequest) (*GetEndpointResponse, error)

GetEndpoint tries to find an individual endpoint in a namespace. Returns the endpoint object if it can be IsNotFound If no endpoint can be found, then an error is returned

type Interface

type Interface interface {
	kubernetes.Interface
	CrunchydataV1() crunchydatav1.CrunchydataV1Interface
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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