deploy

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CmdRunResultBuffer added in v0.13.0

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

func NewCmdRunResultBuffer added in v0.13.0

func NewCmdRunResultBuffer() *CmdRunResultBuffer

func (*CmdRunResultBuffer) Copy added in v0.13.0

func (*CmdRunResultBuffer) WriteStderr added in v0.13.0

func (w *CmdRunResultBuffer) WriteStderr(data []byte) (int, error)

func (*CmdRunResultBuffer) WriteStdout added in v0.13.0

func (w *CmdRunResultBuffer) WriteStdout(data []byte) (int, error)

type Deploy

type Deploy interface {
	Deploy(tplOutput string, startedApplyingFunc func(),
		changedFunc func(exec.CmdRunResult)) exec.CmdRunResult

	Delete(startedApplyingFunc func(),
		changedFunc func(exec.CmdRunResult)) exec.CmdRunResult

	Inspect() exec.CmdRunResult
}

type Factory added in v0.13.0

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

Factory allows to build various deployers. kapp deployer is standard, kapp privileged deployer should only be used for PackageRepository reconciliation.

func NewFactory added in v0.13.0

func NewFactory(coreClient kubernetes.Interface,
	kappConfig KappConfiguration, cmdRunner exec.CmdRunner, log logr.Logger) Factory

NewFactory returns deploy factory.

func (Factory) GetClusterVersion added in v0.40.0

func (f Factory) GetClusterVersion(saName string, specCluster *v1alpha1.AppCluster, objMeta *metav1.ObjectMeta, log logr.Logger) (*version.Info, error)

GetClusterVersion returns the kubernetes API version for the cluster which has been supplied to kapp-controller via a kubeconfig

func (Factory) NewKapp added in v0.13.0

func (f Factory) NewKapp(opts v1alpha1.AppDeployKapp, saName string,
	clusterOpts *v1alpha1.AppCluster, genericOpts GenericOpts, cancelCh chan struct{}) (*Kapp, error)

NewKapp configures and returns a deployer of type Kapp

func (Factory) NewKappPrivilegedForPackageRepository added in v0.39.0

func (f Factory) NewKappPrivilegedForPackageRepository(opts v1alpha1.AppDeployKapp,
	genericOpts GenericOpts, cancelCh chan struct{}) (*Kapp, error)

NewKappPrivileged is used for package repositories where users aren't required to provide a service account, so it will install resources using its own privileges.

type GenericOpts

type GenericOpts struct {
	Name      string
	Namespace string
}

type Kapp

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

func NewKapp

func NewKapp(appSuffix string, opts v1alpha1.AppDeployKapp, genericOpts ProcessedGenericOpts,
	globalDeployRawOpts []string, cancelCh chan struct{}, cmdRunner exec.CmdRunner) *Kapp

NewKapp takes the kapp yaml from spec.deploy.kapp as arg kapp, additional info from the larger app resource (e.g. service account, name, namespace) as genericOpts, and a cancel channel that gets passed through to the exec call that runs kapp.

func (*Kapp) Delete

func (a *Kapp) Delete(startedApplyingFunc func(), changedFunc func(exec.CmdRunResult)) exec.CmdRunResult

Delete takes the app name, it shells out, running kapp delete ...

func (*Kapp) Deploy

func (a *Kapp) Deploy(tplOutput string, startedApplyingFunc func(),
	changedFunc func(exec.CmdRunResult)) exec.CmdRunResult

Deploy takes the output from templating, and the app name, it shells out, running kapp deploy ...

func (*Kapp) Inspect

func (a *Kapp) Inspect() exec.CmdRunResult

Inspect takes the app name, it shells out, running kapp inspect ...

func (*Kapp) InternalAppMeta added in v0.40.0

func (a *Kapp) InternalAppMeta() (*Meta, error)

InternalAppMeta exposes the internal configmap kapp maintains on every app deploy

type KappConfiguration added in v0.37.0

type KappConfiguration interface {
	KappDeployRawOptions() []string
}

KappConfiguration provides a way to inject shared kapp settings.

type KubeconfigRestricted added in v0.20.0

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

func NewKubeconfigRestricted added in v0.20.0

func NewKubeconfigRestricted(input string) (*KubeconfigRestricted, error)

NewKubeconfigRestricted takes kubeconfig yaml as input and returns kubeconfig yaml with certain fields restricted (removed). Developers may find it informative to view their own config at ~/.kube/config

func (*KubeconfigRestricted) AsYAML added in v0.20.0

func (r *KubeconfigRestricted) AsYAML() string

type KubeconfigSecrets added in v0.13.0

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

func NewKubeconfigSecrets added in v0.13.0

func NewKubeconfigSecrets(coreClient kubernetes.Interface) *KubeconfigSecrets

func (*KubeconfigSecrets) Find added in v0.13.0

func (s *KubeconfigSecrets) Find(genericOpts GenericOpts,
	clusterOpts *v1alpha1.AppCluster) (ProcessedGenericOpts, error)

type Meta added in v0.40.0

type Meta struct {
	LabelKey   string `yaml:"labelKey"`
	LabelValue string `yaml:"labelValue"`
	LastChange struct {
		Namespaces []string `yaml:"namespaces"`
	} `yaml:"lastChange"`
	UsedGKs []struct {
		Group string `yaml:"Group"`
		Kind  string `yaml:"Kind"`
	} `yaml:"usedGKs"`
}

Meta contains app meta allowing for an AppCR to surface the associated namespaces and GKs

type ProcessedGenericOpts added in v0.20.0

type ProcessedGenericOpts struct {
	Name      string
	Namespace string

	Kubeconfig                    *KubeconfigRestricted
	DangerousUsePodServiceAccount bool
}

type ServiceAccounts added in v0.13.0

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

func NewServiceAccounts added in v0.13.0

func NewServiceAccounts(coreClient kubernetes.Interface, log logr.Logger) *ServiceAccounts

NewServiceAccounts provides access to the ServiceAccount Resource in kubernetes

func (*ServiceAccounts) Find added in v0.13.0

func (s *ServiceAccounts) Find(genericOpts GenericOpts, saName string) (ProcessedGenericOpts, error)

type WriterFunc added in v0.13.0

type WriterFunc func([]byte) (int, error)

func (WriterFunc) Write added in v0.13.0

func (f WriterFunc) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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