kubernetes

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyOpts

type ApplyOpts struct {
	Force       bool
	AutoApprove bool
}

ApplyOpts allow to specify additional parameter for apply operations

type DiffOpts added in v0.4.0

type DiffOpts struct {
	Summarize bool
}

DiffOpts allow to specify additional parameters for diff operations

type Differ

type Differ func(yaml string) (*string, error)

type ErrorMissingConfig added in v0.4.0

type ErrorMissingConfig struct {
	Verb string
}

func (ErrorMissingConfig) Error added in v0.4.0

func (e ErrorMissingConfig) Error() string

type ErrorNotFound

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

func (ErrorNotFound) Error

func (e ErrorNotFound) Error() string

type ErrorPrimitiveReached

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

ErrorPrimitiveReached occurs when walkJSON reaches the end of nested dicts without finding a valid Kubernetes manifest

func (ErrorPrimitiveReached) Error

func (e ErrorPrimitiveReached) Error() string

type FilteredErr added in v0.4.0

type FilteredErr []*regexp.Regexp

FilteredErr is a filtered Stderr. If one of the regular expressions match, the current input is discarded.

func (FilteredErr) Write added in v0.4.0

func (r FilteredErr) Write(p []byte) (n int, err error)

type Kubectl

type Kubectl struct {
	APIServer string
	// contains filtered or unexported fields
}

Kubectl uses the `kubectl` command to operate on a Kubernetes cluster

func (Kubectl) Apply

func (k Kubectl) Apply(yaml, namespace string, opts ApplyOpts) error

Apply applies the given yaml to the cluster

func (Kubectl) Diff

func (k Kubectl) Diff(yaml string) (*string, error)

Diff takes a desired state as yaml and returns the differences to the system in common diff format

func (Kubectl) Get

func (k Kubectl) Get(namespace, kind, name string) (map[string]interface{}, error)

Get retrieves an Kubernetes object from the API

func (Kubectl) SubsetDiff

func (k Kubectl) SubsetDiff(y string) (*string, error)

func (Kubectl) Version

func (k Kubectl) Version() (client, server semver.Version, err error)

Version returns the version of kubectl and the Kubernetes api server

type Kubernetes

type Kubernetes struct {
	Spec v1alpha1.Spec
	// contains filtered or unexported fields
}

Kubernetes bridges tanka to the Kubernetse orchestrator.

func New

func New(s v1alpha1.Spec) *Kubernetes

New creates a new Kubernetes

func (*Kubernetes) Apply

func (k *Kubernetes) Apply(state []Manifest, opts ApplyOpts) error

Apply receives a state object generated using `Reconcile()` and may apply it to the target system

func (*Kubernetes) Diff

func (k *Kubernetes) Diff(state []Manifest, opts DiffOpts) (*string, error)

Diff takes the desired state and returns the differences from the cluster

func (*Kubernetes) Fmt

func (k *Kubernetes) Fmt(state []Manifest) (string, error)

Fmt receives the state and reformats it to YAML Documents

func (*Kubernetes) Reconcile

func (k *Kubernetes) Reconcile(raw map[string]interface{}, objectspecs ...*regexp.Regexp) (state []Manifest, err error)

Reconcile receives the raw evaluated jsonnet as a marshaled json dict and shall return it reconciled as a state object of the target system

type Manifest

type Manifest map[string]interface{}

Manifest describes a single Kubernetes manifest

func (Manifest) Kind

func (m Manifest) Kind() string

func (Manifest) Name

func (m Manifest) Name() string

func (Manifest) Namespace

func (m Manifest) Namespace() string

Jump to

Keyboard shortcuts

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