kubectl

package
v1.35.0-aplha Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 41 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 latestV1.KubectlFlags
	// contains filtered or unexported fields
}

CLI holds parameters to run kubectl.

func NewCLI added in v1.7.1

func NewCLI(cfg Config, flags latestV1.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
	kstatus.Config
	kloader.Config
	portforward.Config
	deploy.Config
	ForceDeploy() bool
	WaitForDeletions() config.WaitForDeletions
	Mode() config.RunMode
	HydratedManifests() []string
	DefaultPipeline() latestV1.Pipeline
	Tail() bool
	PipelineForImage(imageName string) (latestV1.Pipeline, bool)
}

type Deployer added in v1.7.1

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

Deployer deploys workflows using kubectl CLI.

func NewDeployer added in v1.7.1

func NewDeployer(cfg Config, labeller *label.DefaultLabeller, d *latestV1.KubectlDeploy) (*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, dryRun bool) 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 []graph.Artifact) error

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

func (*Deployer) GetAccessor added in v1.27.0

func (k *Deployer) GetAccessor() access.Accessor

func (*Deployer) GetDebugger added in v1.27.0

func (k *Deployer) GetDebugger() debug.Debugger

func (*Deployer) GetLogger added in v1.27.0

func (k *Deployer) GetLogger() log.Logger

func (*Deployer) GetStatusMonitor added in v1.27.0

func (k *Deployer) GetStatusMonitor() status.Monitor

func (*Deployer) GetSyncer added in v1.27.0

func (k *Deployer) GetSyncer() sync.Syncer

func (*Deployer) HasRunnableHooks added in v1.32.0

func (k *Deployer) HasRunnableHooks() bool

func (*Deployer) PostDeployHooks added in v1.30.0

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

func (*Deployer) PreDeployHooks added in v1.30.0

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

func (*Deployer) RegisterLocalImages added in v1.28.0

func (k *Deployer) RegisterLocalImages(images []graph.Artifact)

func (*Deployer) Render added in v1.7.1

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

func (*Deployer) TrackBuildArtifacts added in v1.27.0

func (k *Deployer) TrackBuildArtifacts(artifacts []graph.Artifact)

Jump to

Keyboard shortcuts

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