deploy

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

Copyright © 2020 Banzai Cloud

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	LeaderElectionID        = "01d415fc.banzaicloud.io"
	LeaderElectionNamespace = "default"
)

Variables

View Source
var (
	DefaultBackoffSettings = wait.Backoff{
		Duration: time.Second * 5,
		Factor:   1,
		Jitter:   0,
		Steps:    60,
	}

	ErrIstioCRNotFound = errors.New("no Istio CR found")
	ErrIstioCRMultiple = errors.New("multiple Istio CRs found")
)

Functions

This section is empty.

Types

type BackyardsComponent

type BackyardsComponent struct {
	Enabled *bool            `json:"enabled,omitempty"`
	Options BackyardsOptions `json:"options,omitempty"`
}

type BackyardsComponentDeployer

type BackyardsComponentDeployer interface {
	SkipComponent(cp *v1alpha1.ControlPlane) error
	EnableComponent(cp *v1alpha1.ControlPlane) error
	DisableComponent(cp *v1alpha1.ControlPlane) error
	PreDeploy(cp *v1alpha1.ControlPlane) error
	PostDeploy(cp *v1alpha1.ControlPlane) error
	PreRemove(cp *v1alpha1.ControlPlane) error
	PostRemove(cp *v1alpha1.ControlPlane) error
	GetResources(obj *v1alpha1.ControlPlane) ([]runtime.Object, error)
}

type BackyardsComponentDeployers

type BackyardsComponentDeployers []BackyardsComponentDeployer

func (BackyardsComponentDeployers) PostDeploy

func (BackyardsComponentDeployers) PostRemove

func (BackyardsComponentDeployers) PreDeploy

func (BackyardsComponentDeployers) PreRemove

func (BackyardsComponentDeployers) Skip

type BackyardsDeployer

type BackyardsDeployer struct {
	Manager  manager.Manager
	Logger   logger.Logger
	Deployer *Deployer
	CD       *ControlPlaneDeployer

	Options BackyardsOptions `json:"options,omitempty"`
}

func NewBackyardsDeployer

func NewBackyardsDeployer(cd *ControlPlaneDeployer, options BackyardsOptions) *BackyardsDeployer

func (*BackyardsDeployer) BackoffReconcilerOption

func (d *BackyardsDeployer) BackoffReconcilerOption() byreconciler.Option

func (*BackyardsDeployer) Deploy

func (d *BackyardsDeployer) Deploy(obj *v1alpha1.ControlPlane) error

func (*BackyardsDeployer) DisableComponent

func (d *BackyardsDeployer) DisableComponent(cp *v1alpha1.ControlPlane) error

func (*BackyardsDeployer) EnableComponent

func (d *BackyardsDeployer) EnableComponent(cp *v1alpha1.ControlPlane) error

func (*BackyardsDeployer) GetResources

func (d *BackyardsDeployer) GetResources(obj *v1alpha1.ControlPlane) ([]runtime.Object, error)

func (*BackyardsDeployer) PostDeploy

func (d *BackyardsDeployer) PostDeploy(obj *v1alpha1.ControlPlane) error

func (*BackyardsDeployer) PostRemove

func (d *BackyardsDeployer) PostRemove(obj *v1alpha1.ControlPlane) error

func (*BackyardsDeployer) PreDeploy

func (d *BackyardsDeployer) PreDeploy(obj *v1alpha1.ControlPlane) error

func (*BackyardsDeployer) PreRemove

func (d *BackyardsDeployer) PreRemove(obj *v1alpha1.ControlPlane) error

func (*BackyardsDeployer) Remove

func (d *BackyardsDeployer) Remove(obj *v1alpha1.ControlPlane) error

func (*BackyardsDeployer) SkipComponent

func (d *BackyardsDeployer) SkipComponent(cp *v1alpha1.ControlPlane) error

type BackyardsOptions

type BackyardsOptions struct {
	Namespace   string `json:"namespace,omitempty"`
	ReleaseName string `json:"releaseName,omitempty"`
	ClusterName string `json:"clusterName,omitempty"`

	AuditSinkEnabled     bool       `json:"auditSinkEnabled,omitempty"`
	CertManagerEnabled   bool       `json:"certManagerEnabled,omitempty"`
	AuthMode             string     `json:"authMode,omitempty"`
	ImpersonationEnabled bool       `json:"impersonationEnabled,omitempty"`
	BackendImage         helm.Image `json:"backendImage,omitempty"`
	FrontendImage        helm.Image `json:"frontendImage,omitempty"`
	GoogleAnalyticsID    string     `json:"googleAnalyticsID,omitempty"`
	PeerCluster          bool       `json:"peerCluster,omitempty"`
	EnableHA             bool       `json:"enableHA,omitempty"`

	Backoff wait.Backoff `json:"backoffSettings,omitempty"`
}

type CanaryOperatorComponent

type CanaryOperatorComponent struct {
	Enabled *bool                 `json:"enabled,omitempty"`
	Options CanaryOperatorOptions `json:"options,omitempty"`
}

type CanaryOperatorDeployer

type CanaryOperatorDeployer struct {
	Manager  manager.Manager
	Logger   logger.Logger
	Deployer *Deployer
	CD       *ControlPlaneDeployer

	Options CanaryOperatorOptions `json:"options,omitempty"`
}

func (*CanaryOperatorDeployer) Deploy

func (*CanaryOperatorDeployer) DisableComponent

func (d *CanaryOperatorDeployer) DisableComponent(cp *v1alpha1.ControlPlane) error

func (*CanaryOperatorDeployer) EnableComponent

func (d *CanaryOperatorDeployer) EnableComponent(cp *v1alpha1.ControlPlane) error

func (*CanaryOperatorDeployer) GetResources

func (d *CanaryOperatorDeployer) GetResources(obj *v1alpha1.ControlPlane) ([]runtime.Object, error)

func (*CanaryOperatorDeployer) PostDeploy

func (d *CanaryOperatorDeployer) PostDeploy(obj *v1alpha1.ControlPlane) error

func (*CanaryOperatorDeployer) PostRemove

func (d *CanaryOperatorDeployer) PostRemove(obj *v1alpha1.ControlPlane) error

func (*CanaryOperatorDeployer) PreDeploy

func (*CanaryOperatorDeployer) PreRemove

func (*CanaryOperatorDeployer) Remove

func (*CanaryOperatorDeployer) SkipComponent

func (d *CanaryOperatorDeployer) SkipComponent(cp *v1alpha1.ControlPlane) error

type CanaryOperatorOptions

type CanaryOperatorOptions struct {
	Namespace     string       `json:"namespace,omitempty"`
	ReleaseName   string       `json:"releaseName,omitempty"`
	PrometheusURL string       `json:"prometheusURL,omitempty"`
	Backoff       wait.Backoff `json:"backoffSettings,omitempty"`
}

type CertManagerComponent

type CertManagerComponent struct {
	Enabled *bool              `json:"enabled,omitempty"`
	Options CertManagerOptions `json:"options,omitempty"`
}

type CertManagerDeployer

type CertManagerDeployer struct {
	Manager  manager.Manager
	Logger   logger.Logger
	Deployer *Deployer
	CD       *ControlPlaneDeployer

	Options CertManagerOptions `json:"options,omitempty"`
}

func NewCertManagerDeployer

func NewCertManagerDeployer(cd *ControlPlaneDeployer, options CertManagerOptions) *CertManagerDeployer

func (*CertManagerDeployer) Deploy

func (*CertManagerDeployer) DisableComponent

func (d *CertManagerDeployer) DisableComponent(cp *v1alpha1.ControlPlane) error

func (*CertManagerDeployer) EnableComponent

func (d *CertManagerDeployer) EnableComponent(cp *v1alpha1.ControlPlane) error

func (*CertManagerDeployer) GetResources

func (d *CertManagerDeployer) GetResources(obj *v1alpha1.ControlPlane) ([]runtime.Object, error)

func (*CertManagerDeployer) PostDeploy

func (d *CertManagerDeployer) PostDeploy(obj *v1alpha1.ControlPlane) error

func (*CertManagerDeployer) PostRemove

func (d *CertManagerDeployer) PostRemove(obj *v1alpha1.ControlPlane) error

func (*CertManagerDeployer) PreDeploy

func (d *CertManagerDeployer) PreDeploy(obj *v1alpha1.ControlPlane) error

func (*CertManagerDeployer) PreRemove

func (d *CertManagerDeployer) PreRemove(obj *v1alpha1.ControlPlane) error

func (*CertManagerDeployer) Remove

func (*CertManagerDeployer) SkipComponent

func (d *CertManagerDeployer) SkipComponent(cp *v1alpha1.ControlPlane) error

type CertManagerOptions

type CertManagerOptions struct {
	Namespace string       `json:"namespace,omitempty"`
	Backoff   wait.Backoff `json:"backoffSettings,omitempty"`
}

type ControlPlaneDeployer

type ControlPlaneDeployer struct {
	Manager  manager.Manager
	Logger   logger.Logger
	Deployer *Deployer
	Options  ControlPlaneOptions `json:"options,omitempty"`
}

func NewControlPlaneDeployer

func NewControlPlaneDeployer(mgr manager.Manager, log logger.Logger, deployer *Deployer, options ControlPlaneOptions) *ControlPlaneDeployer

func (*ControlPlaneDeployer) CreateCRD

func (d *ControlPlaneDeployer) CreateCRD() error

func (*ControlPlaneDeployer) GetBackyardsDeployer

func (d *ControlPlaneDeployer) GetBackyardsDeployer(options BackyardsOptions) *BackyardsDeployer

func (*ControlPlaneDeployer) GetCanaryOperatorDeployer

func (d *ControlPlaneDeployer) GetCanaryOperatorDeployer(options CanaryOperatorOptions) *CanaryOperatorDeployer

func (*ControlPlaneDeployer) GetCertManagerDeployer

func (d *ControlPlaneDeployer) GetCertManagerDeployer(options CertManagerOptions) *CertManagerDeployer

func (*ControlPlaneDeployer) GetIstioDeployer

func (d *ControlPlaneDeployer) GetIstioDeployer(istioCR *istio_operator_v1beta1.Istio, options IstioOptions) *IstioDeployer

func (*ControlPlaneDeployer) GetNodeExporterDeployer

func (d *ControlPlaneDeployer) GetNodeExporterDeployer(options NodeExporterOptions) *NodeExporterDeployer

func (*ControlPlaneDeployer) GetOrCreateControlPlaneResource

func (d *ControlPlaneDeployer) GetOrCreateControlPlaneResource() (*v1alpha1.ControlPlane, error)

func (*ControlPlaneDeployer) NewControlPlaneResource

func (d *ControlPlaneDeployer) NewControlPlaneResource() (*v1alpha1.ControlPlane, error)

func (*ControlPlaneDeployer) Reconcile

func (d *ControlPlaneDeployer) Reconcile(cp *v1alpha1.ControlPlane) error

func (*ControlPlaneDeployer) TurnOffDisabledComponents

func (d *ControlPlaneDeployer) TurnOffDisabledComponents(cp *v1alpha1.ControlPlane) error

func (*ControlPlaneDeployer) WaitForReconciliation

func (d *ControlPlaneDeployer) WaitForReconciliation(obj *v1alpha1.ControlPlane, backoff wait.Backoff, log logger.Logger) error

type ControlPlaneOptions

type ControlPlaneOptions struct {
	DevelopmentMode bool `json:"developmentMode"`
}

type DemoApplicationDeployer

type DemoApplicationDeployer struct {
	Manager  manager.Manager
	Logger   logger.Logger
	Deployer *Deployer
	Options  DemoApplicationOptions `json:"options,omitempty"`
}

func NewDemoApplicationDeployer

func NewDemoApplicationDeployer(mgr manager.Manager, log logger.Logger, deployer *Deployer, options DemoApplicationOptions) *DemoApplicationDeployer

func (*DemoApplicationDeployer) Deploy

func (*DemoApplicationDeployer) DisableComponent

func (d *DemoApplicationDeployer) DisableComponent(obj *v1alpha1.DemoApplication) error

func (*DemoApplicationDeployer) EnableComponent

func (d *DemoApplicationDeployer) EnableComponent(obj *v1alpha1.DemoApplication) error

func (*DemoApplicationDeployer) GetDemoApplicationResource

func (d *DemoApplicationDeployer) GetDemoApplicationResource() (*v1alpha1.DemoApplication, error)

func (*DemoApplicationDeployer) GetResources

func (*DemoApplicationDeployer) NewDemoApplicationResource

func (d *DemoApplicationDeployer) NewDemoApplicationResource(cp *v1alpha1.ControlPlane) *v1alpha1.DemoApplication

func (*DemoApplicationDeployer) PostDeploy

func (*DemoApplicationDeployer) PostRemove

func (*DemoApplicationDeployer) PreDeploy

func (*DemoApplicationDeployer) PreRemove

func (*DemoApplicationDeployer) Remove

type DemoApplicationOptions

type DemoApplicationOptions struct {
	Namespace            string       `json:"namespace,omitempty"`
	DeployIstioResources bool         `json:"deployIstioResources,omitempty"`
	DeploySLOResources   bool         `json:"deploySLOResources,omitempty"`
	IstioRevision        string       `json:"istioRevision,omitempty"`
	EnabledServices      []string     `json:"enabledServices,omitempty"`
	Replicas             uint         `json:"replicas,omitempty"`
	Backoff              wait.Backoff `json:"backoffSettings,omitempty"`
}

type Deployer

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

func New

func New(mgr manager.Manager, log logger.Logger, labelManager k8s.LabelManager) *Deployer

func (*Deployer) ApplyResources

func (d *Deployer) ApplyResources(resources []runtime.Object, log logger.Logger, shouldWait bool, labelManager ...k8s.LabelManager) error

func (*Deployer) DeleteResources

func (d *Deployer) DeleteResources(resources []runtime.Object, log logger.Logger, shouldWait bool, labelManager k8s.LabelManager) error

func (*Deployer) GetControlPlaneDeployer

func (d *Deployer) GetControlPlaneDeployer(options ControlPlaneOptions) *ControlPlaneDeployer

func (*Deployer) GetDemoApplicationDeployer

func (d *Deployer) GetDemoApplicationDeployer(options DemoApplicationOptions) *DemoApplicationDeployer

func (*Deployer) IsOperatorRunning

func (d *Deployer) IsOperatorRunning() (bool, error)

func (*Deployer) Reconcile

func (d *Deployer) Reconcile(directModeFunc func() error, operatorModeFunc func() error) error

operatorMode func(object runtime.Object) error

type IstioComponent

type IstioComponent struct {
	Enabled    *bool        `json:"enabled,omitempty"`
	Options    IstioOptions `json:"options,omitempty"`
	CRFilename string       `json:"crFilename,omitempty"`
}

type IstioDeployer

type IstioDeployer struct {
	Manager  manager.Manager
	Logger   logger.Logger
	Deployer *Deployer
	CD       *ControlPlaneDeployer

	Options IstioOptions `json:"options,omitempty"`
	// contains filtered or unexported fields
}

func NewIstioDeployer

func NewIstioDeployer(cd *ControlPlaneDeployer, istioCR *istio_operator_v1beta1.Istio, options IstioOptions) *IstioDeployer

func (*IstioDeployer) BackoffReconcilerOption

func (d *IstioDeployer) BackoffReconcilerOption() byreconciler.Option

func (*IstioDeployer) Deploy

func (d *IstioDeployer) Deploy(obj *v1alpha1.ControlPlane) error

func (*IstioDeployer) DisableComponent

func (d *IstioDeployer) DisableComponent(cp *v1alpha1.ControlPlane) error

func (*IstioDeployer) EnableComponent

func (d *IstioDeployer) EnableComponent(cp *v1alpha1.ControlPlane) error

func (*IstioDeployer) GetResources

func (d *IstioDeployer) GetResources(obj *v1alpha1.ControlPlane) ([]runtime.Object, error)

func (*IstioDeployer) PostDeploy

func (d *IstioDeployer) PostDeploy(obj *v1alpha1.ControlPlane) error

func (*IstioDeployer) PostRemove

func (d *IstioDeployer) PostRemove(obj *v1alpha1.ControlPlane) error

func (*IstioDeployer) PreDeploy

func (d *IstioDeployer) PreDeploy(obj *v1alpha1.ControlPlane) error

func (*IstioDeployer) PreRemove

func (d *IstioDeployer) PreRemove(obj *v1alpha1.ControlPlane) error

func (*IstioDeployer) Remove

func (d *IstioDeployer) Remove(obj *v1alpha1.ControlPlane) error

func (*IstioDeployer) SkipComponent

func (d *IstioDeployer) SkipComponent(cp *v1alpha1.ControlPlane) error

type IstioOptions

type IstioOptions struct {
	Namespace   string       `json:"namespace,omitempty"`
	ReleaseName string       `json:"releaseName,omitempty"`
	Backoff     wait.Backoff `json:"backoffSettings,omitempty"`
}

type IstioResourceManager

type IstioResourceManager struct {
	Manager manager.Manager
	Options IstioResourceManagerOptions `json:"options,omitempty"`
}

func (*IstioResourceManager) GetControlPlane

func (d *IstioResourceManager) GetControlPlane(name, namespace string) (*istio_operator_v1beta1.Istio, error)

func (*IstioResourceManager) GetControlPlanes

func (d *IstioResourceManager) GetControlPlanes() (items []*istio_operator_v1beta1.Istio, err error)

func (*IstioResourceManager) InitIstioOperatorCR

func (d *IstioResourceManager) InitIstioOperatorCR(existing *istio_operator_v1beta1.Istio, overwrite bool, global bool) (*istio_operator_v1beta1.Istio, error)

type IstioResourceManagerOptions

type IstioResourceManagerOptions struct {
	IstioCRFilename string `json:"istioCRFilename,omitempty"`
}

type NodeExporterDeployer

type NodeExporterDeployer struct {
	Manager  manager.Manager
	Logger   logger.Logger
	Deployer *Deployer
	CD       *ControlPlaneDeployer

	Options NodeExporterOptions `json:"options,omitempty"`
}

func (*NodeExporterDeployer) Deploy

func (*NodeExporterDeployer) DisableComponent

func (d *NodeExporterDeployer) DisableComponent(cp *v1alpha1.ControlPlane) error

func (*NodeExporterDeployer) EnableComponent

func (d *NodeExporterDeployer) EnableComponent(cp *v1alpha1.ControlPlane) error

func (*NodeExporterDeployer) GetResources

func (d *NodeExporterDeployer) GetResources(obj *v1alpha1.ControlPlane) ([]runtime.Object, error)

func (*NodeExporterDeployer) PostDeploy

func (d *NodeExporterDeployer) PostDeploy(obj *v1alpha1.ControlPlane) error

func (*NodeExporterDeployer) PostRemove

func (d *NodeExporterDeployer) PostRemove(obj *v1alpha1.ControlPlane) error

func (*NodeExporterDeployer) PreDeploy

func (d *NodeExporterDeployer) PreDeploy(obj *v1alpha1.ControlPlane) error

func (*NodeExporterDeployer) PreRemove

func (d *NodeExporterDeployer) PreRemove(obj *v1alpha1.ControlPlane) error

func (*NodeExporterDeployer) Remove

func (*NodeExporterDeployer) SkipComponent

func (d *NodeExporterDeployer) SkipComponent(cp *v1alpha1.ControlPlane) error

type NodeExporterOptions

type NodeExporterOptions struct {
	Namespace   string       `json:"namespace,omitempty"`
	ReleaseName string       `json:"releaseName,omitempty"`
	Backoff     wait.Backoff `json:"backoffSettings,omitempty"`
}

type NodeManagerComponent

type NodeManagerComponent struct {
	Enabled *bool               `json:"enabled,omitempty"`
	Options NodeExporterOptions `json:"options,omitempty"`
}

Jump to

Keyboard shortcuts

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