kubectl

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2017 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployment

type Deployment struct {
	Kind     string               `yaml:"kind"`
	Metadata kubeTypeMetadata     `yaml:"metadata"`
	Spec     kubeTypeResourceSpec `yaml:"spec"`
	Status   kubeTypeStatus       `yaml:"status"`
}

Deployment is k8s Deployment resource

func ToDeploymentList

func ToDeploymentList(list []KubeResourceInterface) []Deployment

ToDeploymentList is helper to convert []KubeResourceInterface to []Deployment

func (*Deployment) GetKind

func (d *Deployment) GetKind() string

GetKind interface method support, returns string "deployment"

func (*Deployment) GetName

func (d *Deployment) GetName() string

GetName return name of Deployment

type KubeCall

type KubeCall struct {
	Cmd    kubeCommandInterface
	Parser kubeResourceParserInterface
}

KubeCall is kubectl wrapper combined with parser

func CommandDeploymentList

func CommandDeploymentList(namespace string) *KubeCall

CommandDeploymentList return call which return list of deployments registered in kubernetes clusted

func CommandNamespaceList

func CommandNamespaceList() *KubeCall

CommandNamespaceList return call which will return list of namespaces registered in kubernetes cluster

func CommandReplicaSetList

func CommandReplicaSetList(namespace string) *KubeCall

CommandReplicaSetList return call which return list of replicasets registered in kubernetes cluster

func (*KubeCall) RunAndParse

func (c *KubeCall) RunAndParse() ([]KubeResourceInterface, error)

RunAndParse run command and try to parse output with provided parser

func (*KubeCall) RunAndParseFirst

func (c *KubeCall) RunAndParseFirst() (KubeResourceInterface, error)

RunAndParseFirst run command, parse output and return first element of decoded items

func (*KubeCall) RunPlain

func (c *KubeCall) RunPlain() ([]byte, error)

RunPlain run command and just return command output

type KubeResourceInterface

type KubeResourceInterface interface {
	GetKind() string
}

KubeResourceInterface is common interface to all k8s resource types

type Namespace

type Namespace struct {
	Kind     string           `yaml:"kind"`
	Metadata kubeTypeMetadata `yaml:"metadata"`
}

Namespace is k8s Namespace resource

func ToNamespaceList

func ToNamespaceList(list []KubeResourceInterface) []Namespace

ToNamespaceList is helper to convert []KubeResourceInterface type to []Namespace

func (*Namespace) GetKind

func (n *Namespace) GetKind() string

GetKind interface method support, returns string "namespace"

func (*Namespace) GetName

func (n *Namespace) GetName() string

GetName return name of Namespace

type ReplicaSet

type ReplicaSet struct {
	Kind     string               `yaml:"kind"`
	Metadata kubeTypeMetadata     `yaml:"metadata"`
	Spec     kubeTypeResourceSpec `yaml:"spec"`
	Status   kubeTypeStatus       `yaml:"status"`
}

ReplicaSet is k8s ReplicaSet resource

func ToReplicaSetList

func ToReplicaSetList(list []KubeResourceInterface) []ReplicaSet

ToReplicaSetList is helper to convert []KubeResourceInterface to []ReplicaSet

func (*ReplicaSet) GetImages

func (r *ReplicaSet) GetImages() []string

GetImages return list of docker images registered in ReplicaSet

func (*ReplicaSet) GetKind

func (r *ReplicaSet) GetKind() string

GetKind interface method support, returns string "replicaset"

func (*ReplicaSet) GetName

func (r *ReplicaSet) GetName() string

GetName return name of ReplicaSet

Jump to

Keyboard shortcuts

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