kubectl

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0 Imports: 25 Imported by: 3

Documentation

Index

Constants

View Source
const (
	KubectlVersion112 = `{"clientVersion":{"major":"1","minor":"12"}}`
	KubectlVersion118 = `{"clientVersion":{"major":"1","minor":"18"}}`
)
View Source
const DeploymentAppYAML = `apiVersion: v1
kind: Pod
metadata:
  name: leeroy-app
spec:
  containers:
  - name: leeroy-app
    image: leeroy-app`
View Source
const DeploymentAppYAMLv1 = `apiVersion: v1
kind: Pod
metadata:
  name: leeroy-app
spec:
  containers:
  - image: leeroy-app:v1
    name: leeroy-app`
View Source
const DeploymentAppYAMLv2 = `apiVersion: v1
kind: Pod
metadata:
  name: leeroy-app
spec:
  containers:
  - image: leeroy-app:v2
    name: leeroy-app`
View Source
const DeploymentWebYAML = `apiVersion: v1
kind: Pod
metadata:
  name: leeroy-web
spec:
  containers:
  - name: leeroy-web
    image: leeroy-web`
View Source
const DeploymentWebYAMLv1 = `apiVersion: v1
kind: Pod
metadata:
  name: leeroy-web
spec:
  containers:
  - image: leeroy-web:v1
    name: leeroy-web`

Variables

View Source
var TestKubeConfig = "kubeconfig"
View Source
var TestKubeContext = "kubecontext"
View Source
var TestNamespace = "testNamespace"
View Source
var TestNamespace2 = "testNamespace2"
View Source
var TestNamespace2FromEnvTemplate = "test{{.MYENV}}ace2" // needs `MYENV=Namesp` environment variable

Functions

This section is empty.

Types

type CLI

type CLI struct {
	*kubectl.CLI
	Flags latest.KubectlFlags
	// contains filtered or unexported fields
}

CLI holds parameters to run kubectl.

func NewCLI added in v1.7.1

func NewCLI(cfg Config, flags latest.KubectlFlags, defaultNameSpace string) CLI

func (*CLI) Apply added in v0.13.0

func (c *CLI) Apply(ctx context.Context, out io.Writer, manifests manifest.ManifestList) error

Apply runs `kubectl apply` on a list of manifests.

func (*CLI) Delete added in v0.13.0

func (c *CLI) Delete(ctx context.Context, out io.Writer, manifests manifest.ManifestList) error

Delete runs `kubectl delete` on a list of manifests.

func (*CLI) Kustomize added in v1.7.1

func (c *CLI) Kustomize(ctx context.Context, args []string) ([]byte, error)

Kustomize runs `kubectl kustomize` with the provided args

func (*CLI) ReadManifests added in v0.22.0

func (c *CLI) ReadManifests(ctx context.Context, manifests []string) (manifest.ManifestList, error)

ReadManifests reads a list of manifests in yaml format.

func (*CLI) WaitForDeletions added in v1.7.1

func (c *CLI) WaitForDeletions(ctx context.Context, out io.Writer, manifests manifest.ManifestList) error

WaitForDeletions waits for resource marked for deletion to complete their deletion.

type Config added in v1.7.1

type Config interface {
	kubectl.Config
	deploy.Config
	ForceDeploy() bool
	WaitForDeletions() config.WaitForDeletions
	Mode() config.RunMode
}

type Deployer added in v1.7.1

type Deployer struct {
	*latest.KubectlDeploy
	// contains filtered or unexported fields
}

Deployer deploys workflows using kubectl CLI.

func NewDeployer added in v1.7.1

func NewDeployer(cfg Config, labels map[string]string) (*Deployer, error)

NewDeployer returns a new Deployer for a DeployConfig filled with the needed configuration for `kubectl apply`

func (*Deployer) Cleanup added in v1.7.1

func (k *Deployer) Cleanup(ctx context.Context, out io.Writer) error

Cleanup deletes what was deployed by calling Deploy.

func (*Deployer) Dependencies added in v1.7.1

func (k *Deployer) Dependencies() ([]string, error)

Dependencies lists all the files that describe what needs to be deployed.

func (*Deployer) Deploy added in v1.7.1

func (k *Deployer) Deploy(ctx context.Context, out io.Writer, builds []build.Artifact) ([]string, error)

Deploy templates the provided manifests with a simple `find and replace` and runs `kubectl apply` on those manifests

func (*Deployer) Render added in v1.7.1

func (k *Deployer) Render(ctx context.Context, out io.Writer, builds []build.Artifact, offline bool, filepath string) error

Jump to

Keyboard shortcuts

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