kubernetes

package
v0.0.0-...-5f60744 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResourceBuilder

func NewResourceBuilder(kubeOpts config.KubernetesOptions) *resource.Builder

Types

type Client

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

func NewClient

func NewClient(kubeOpts config.KubernetesOptions) (*Client, error)

func (*Client) CreateOrUpdate

func (c *Client) CreateOrUpdate(ctx context.Context, info *resource.Info) (err error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, info *resource.Info) error

func (*Client) Dynamic

func (c *Client) Dynamic() dynamic.Interface

func (*Client) Static

func (c *Client) Static() kubernetes.Interface

type Kubectl

type Kubectl interface {
	CpFrom(ctx context.Context, namespace, pod, container, srcPath, dstPath string) ([]byte, error)
	CpTo(ctx context.Context, namespace, pod, container, srcPath, dstPath string) ([]byte, error)
	Exec(ctx context.Context, namespace, pod, container, cmd string, args ...string) ([]byte, error)
	PortForward(ctx context.Context, namespace, pod, address, hostPort, podPort string) (*exec.Cmd, string, error)
}

func NewKubectl

func NewKubectl(opts config.KubernetesOptions) Kubectl

type Manifests

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

func ManifestsFromFiles

func ManifestsFromFiles(
	opts config.KubernetesOptions,
	client *Client,
	resourceBuilderFn ResourceBuilderFunc,
) (*Manifests, error)

func (*Manifests) Apply

func (ms *Manifests) Apply(ctx context.Context, predicate func(info *resource.Info) bool) error

func (*Manifests) Delete

func (ms *Manifests) Delete(ctx context.Context) error

func (*Manifests) Find

func (ms *Manifests) Find(target config.KubernetesTarget) (*resource.Info, error)

type ResourceBuilderFunc

type ResourceBuilderFunc func() *resource.Builder

ResourceBuilderFunc is a helper function to avoid passing KuberneteOptions through unrelated code.

func NewResourceBuilderFunc

func NewResourceBuilderFunc(kubeOpts config.KubernetesOptions) ResourceBuilderFunc

type Workload

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

func (*Workload) AddEmptyDirVolume

func (w *Workload) AddEmptyDirVolume(name string)

func (*Workload) AddInitContainer

func (w *Workload) AddInitContainer(cont corev1.Container)

func (*Workload) Container

func (w *Workload) Container(name string) *corev1.Container

func (*Workload) DefaultContainer

func (w *Workload) DefaultContainer() *corev1.Container

func (*Workload) Info

func (w *Workload) Info() *resource.Info

func (*Workload) Name

func (w *Workload) Name() string

func (*Workload) Namespace

func (w *Workload) Namespace() string

func (*Workload) ResetChanges

func (w *Workload) ResetChanges()

func (*Workload) SetReplicasIfApplicable

func (w *Workload) SetReplicasIfApplicable(n int32) bool

func (*Workload) TargetContainer

func (w *Workload) TargetContainer() *corev1.Container

func (*Workload) Template

func (w *Workload) Template() *corev1.PodTemplateSpec

type WorkloadFinder

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

WorkloadFinder searches for the workload object in:

  • supplied manifest files (if any)
  • default cluster

func NewWorkloadFinder

func NewWorkloadFinder(manifests *Manifests, resourceBuilderFn ResourceBuilderFunc) *WorkloadFinder

func (*WorkloadFinder) Find

func (f *WorkloadFinder) Find(target config.KubernetesTarget) (*Workload, error)

Jump to

Keyboard shortcuts

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