kubernetes

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package kubernetes implements a convenience wrapper around Kubernetes clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNamespace

func CreateNamespace(client client.Client, name string) error

CreateNamespace creates a namespace.

func DeleteNamespace

func DeleteNamespace(client client.Client, name string) error

DeleteNamespace deletes a namespace.

Types

type PersistentVolumeClaim added in v0.2.0

type PersistentVolumeClaim struct {
	corev1.PersistentVolumeClaim
	// contains filtered or unexported fields
}

PersistentVolumeClaim wraps a Kubernetes PersistentVolumeClaim.

func GetPersistentVolumeClaim added in v0.2.0

func GetPersistentVolumeClaim(client client.Client, name string, namespace string) (PersistentVolumeClaim, error)

GetPersistentVolumeClaim gets a persistentvolumeclaim in a namespace.

func ListPersistentVolumeClaims added in v0.2.0

func ListPersistentVolumeClaims(client client.Client, namespace string) ([]PersistentVolumeClaim, error)

ListPersistentVolumeClaims lists all persistentvolumeclaims in a namespace.

func NewPersistentVolumeClaim added in v0.2.0

func NewPersistentVolumeClaim(client client.Client, persistentvolumeclaim corev1.PersistentVolumeClaim) (PersistentVolumeClaim, error)

NewPersistentVolumeClaim creates a PersistentVolumeClaim from its Kubernetes PersistentVolumeClaim.

func (PersistentVolumeClaim) Delete added in v0.2.0

func (persistentvolumeclaim PersistentVolumeClaim) Delete() error

Delete deletes a PersistentVolumeClaim from the Kubernetes cluster.

func (*PersistentVolumeClaim) Update added in v0.2.0

func (persistentvolumeclaim *PersistentVolumeClaim) Update() error

Update gets the current PersistentVolumeClaim status.

type Pod

type Pod struct {
	corev1.Pod
	// contains filtered or unexported fields
}

Pod wraps a Kubernetes Pod.

func GetPod

func GetPod(client client.Client, name string, namespace string) (Pod, error)

GetPod gets a pod in a namespace.

func ListPods

func ListPods(client client.Client, namespace string) ([]Pod, error)

ListPods lists all pods in a namespace.

func NewPod added in v0.2.0

func NewPod(client client.Client, pod corev1.Pod) (Pod, error)

NewPod creates a Pod from its Kubernetes Pod.

func (Pod) ContainerExec

func (pod Pod) ContainerExec(container string, command cmd.Builder) error

Exec runs a command in a pod's container.

func (Pod) ContainerLogs

func (pod Pod) ContainerLogs(container string) ([]byte, error)

Logs returns the (current) logs of a pod's container.

func (Pod) Delete added in v0.2.0

func (pod Pod) Delete() error

Delete deletes a Pod from the Kubernetes cluster.

func (*Pod) Update

func (pod *Pod) Update() error

Update gets the current Pod status.

type Secret added in v0.2.0

type Secret struct {
	corev1.Secret
	// contains filtered or unexported fields
}

Secret wraps a Kubernetes Secret.

func GetSecret added in v0.2.0

func GetSecret(client client.Client, name string, namespace string) (Secret, error)

GetSecret gets a secret in a namespace.

func ListSecrets added in v0.2.0

func ListSecrets(client client.Client, namespace string) ([]Secret, error)

ListSecrets lists all secrets in a namespace.

func NewSecret added in v0.2.0

func NewSecret(client client.Client, secret corev1.Secret) (Secret, error)

NewSecret creates a Secret from its Kubernetes Secret.

func (Secret) Delete added in v0.2.0

func (secret Secret) Delete() error

Delete deletes a Secret from the Kubernetes cluster.

func (*Secret) Update added in v0.2.0

func (secret *Secret) Update() error

Update gets the current Secret status.

type SecretBuilder added in v0.2.0

type SecretBuilder struct {
	Name       string
	Namespace  string
	Data       map[string][]byte
	StringData map[string]string
}

SecretBuilder tracks the options set for a secret.

func CreateSecret added in v0.2.0

func CreateSecret(name string) SecretBuilder

CreateSecret creates a secret. Additional parameters can be added to this call. The creation is started by calling 'Do'.

func (SecretBuilder) Do added in v0.2.0

func (builder SecretBuilder) Do(client client.Client) (Secret, error)

Do creates the secret in the cluster.

func (SecretBuilder) WithData added in v0.2.0

func (builder SecretBuilder) WithData(data map[string][]byte) SecretBuilder

WithData sets the data the secret should hold.

func (SecretBuilder) WithNamespace added in v0.2.0

func (builder SecretBuilder) WithNamespace(namespace string) SecretBuilder

WithNamespace sets the namespace in which the secret will be created.

func (SecretBuilder) WithStringData added in v0.2.2

func (builder SecretBuilder) WithStringData(data map[string]string) SecretBuilder

WithStringData sets the data the secret should hold as string

type Service added in v0.2.0

type Service struct {
	corev1.Service
	// contains filtered or unexported fields
}

Service wraps a Kubernetes Service.

func GetService added in v0.2.0

func GetService(client client.Client, name string, namespace string) (Service, error)

GetService gets a service in a namespace.

func ListServices added in v0.2.0

func ListServices(client client.Client, namespace string) ([]Service, error)

ListServices lists all services in a namespace.

func NewService added in v0.2.0

func NewService(client client.Client, service corev1.Service) (Service, error)

NewService creates a Service from its Kubernetes Service.

func (Service) Delete added in v0.2.0

func (service Service) Delete() error

Delete deletes a Service from the Kubernetes cluster.

func (*Service) Update added in v0.2.0

func (service *Service) Update() error

Update gets the current Service status.

type StatefulSet added in v0.2.0

type StatefulSet struct {
	appsv1.StatefulSet
	// contains filtered or unexported fields
}

StatefulSet wraps a Kubernetes StatefulSet.

func GetStatefulSet added in v0.2.0

func GetStatefulSet(client client.Client, name string, namespace string) (StatefulSet, error)

GetStatefulSet gets a statefulset in a namespace.

func ListStatefulSets added in v0.2.0

func ListStatefulSets(client client.Client, namespace string) ([]StatefulSet, error)

ListStatefulSets lists all statefulsets in a namespace.

func NewStatefulSet added in v0.2.0

func NewStatefulSet(client client.Client, statefulset appsv1.StatefulSet) (StatefulSet, error)

NewStatefulSet creates a StatefulSet from its Kubernetes StatefulSet.

func (StatefulSet) Delete added in v0.2.0

func (statefulset StatefulSet) Delete() error

Delete deletes a StatefulSet from the Kubernetes cluster.

func (*StatefulSet) Update added in v0.2.0

func (statefulset *StatefulSet) Update() error

Update gets the current StatefulSet status.

Jump to

Keyboard shortcuts

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