kube

package
v0.0.0-...-5984036 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(kubeClient kubernetes.Interface, restConfig *rest.Config, namespace, pod string,
	execOpts corev1.PodExecOptions, streamOpts remotecommand.StreamOptions) error

Exec runs a command in a Kubernetes pod.

func Parse

func Parse(doc []byte) (*unstructured.Unstructured, error)

Parse parses the Kubernetes object in `doc` into an Unstructured object. It assumes that `doc` contains exactly one object. It is the caller's responsibility to split files with multiple documents into individual documents.

func SelectPods

func SelectPods(objects []*Object, onlyRunning bool) (pods []*corev1.Pod)

SelectPods selects all the Pod objects from the tree.

Types

type Object

type Object struct {
	Object   runtime.Object
	Children []*Object
}

Object represents a Kubernetes object, and its children. For example, a Deployment object has a ReplicaSet as a child, which in turn has a pod as its child.

func (*Object) DeepCopy

func (obj *Object) DeepCopy() *Object

DeepCopy makes a copy of the Object. This is required to work with the Microservice CRD.

func (*Object) UnmarshalJSON

func (obj *Object) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON decodes the given JSON bytes into the object. This is required to work with the Microservice CRD.

type TreeBuilder

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

TreeBuilder converts the Kubernetes objects in the namespace into a tree structure based on the relationships defined by OwnerReferences.

func NewTreeBuilder

func NewTreeBuilder(podLister corelisters.PodLister,
	jobLister batchlisters.JobLister,
	deploymentLister appslisters.DeploymentLister,
	replicaSetLister appslisters.ReplicaSetLister,
	statefulSetLister appslisters.StatefulSetLister,
	daemonSetLister appslisters.DaemonSetLister) TreeBuilder

NewTreeBuilder returns a new TreeBuilder.

func (TreeBuilder) Select

func (tb TreeBuilder) Select(namespace string, msUID types.UID, specVersion int) ([]*Object, error)

Select returns the Objects (and their children) created by the given Microservice.

type Tunnel

type Tunnel struct {
	Namespace, Pod        string
	LocalPort, RemotePort int
	// contains filtered or unexported fields
}

Tunnel is a instance of a port-forward between the local machine and a microservice.

func (*Tunnel) Close

func (t *Tunnel) Close()

Close shuts down the tunnel.

func (*Tunnel) Run

func (t *Tunnel) Run(client rest.Interface, restConfig *rest.Config) error

Run activates the port-forward tunnel itself.

Jump to

Keyboard shortcuts

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