addon

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package addon deploys Kubernetes resources to a cluster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addon

type Addon struct {
}

Addon provisions Kubernetes resources using kubectl-tmplt cli.

func (*Addon) Start

func (a *Addon) Start(ctx context.Context, env []string, dir, jobPath, valuesPath, kubeconfigPath, masterVaultPath string) (*exec.Cmd, chan KTResult, error)

Start implements Addonr.

type AddonFake added in v0.1.0

type AddonFake struct {
	// Tally is the number of times Start has been called.
	StartTally int

	// Result that is played back by the fake implementation of Start.
	StartResult []KTResult
}

AddonFake provides an Addonr for testing.

func (*AddonFake) SetupFakeResult added in v0.1.0

func (a *AddonFake) SetupFakeResult()

SetupFakeResultsForCreate sets-up the receiver with data that is returned during testing.

func (*AddonFake) Start added in v0.1.0

func (a *AddonFake) Start(ctx context.Context, env []string, dir, jobPath, valuesPath, kubeconfigPath, masterVaultPath string) (*exec.Cmd, chan KTResult, error)

type Addonr

type Addonr interface {
	// Start runs kubectl-tmplt concurrently in dir and returns a cmd and a channel of KTResults.
	// The jobPath refers to a yaml file with resources to apply.
	// The valuesPath refers to yaml file with values that parameterize the job resources.
	// The kubeconfigPath refers to a kube config file with current-context referring to the target cluster.
	// The masterVaultPath refers to a directory containing the config of the Vault to use for {{ vault }}.
	// The channel will be closed when kubectl-tmplt exits.
	// cmd.Wait() must be called to clean-up.
	Start(ctx context.Context, env []string, dir, jobPath, valuesPath, kubeconfigPath, masterVaultPath string) (*exec.Cmd, chan KTResult, error)
}

Addonr is able to provision Kubernetes resources.

type KTResult

type KTResult struct {
	// Running count of the number of resources that have been created, updated and deleted.
	Added, Changed, Deleted int

	// Errors is a list of error messages.
	Errors []string

	// Most recently logged kubernetes resource name.
	Object string
	// The sequence number of the object.
	ObjectID string
	// Most recently logged action being performed; creating (creation), modifying (modification), destroying (destruction).
	// *ing means in-progress, *tion means completed.
	Action string
}

KTResult

Jump to

Keyboard shortcuts

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