boshdeployment

package
v1.0.1-0...-b3ee44d Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Overview

Package boshdeployment handles the boshdeployment resource. It directs the deployment of BOSH releases on k8s.

Index

Constants

View Source
const (
	// BDPLStateDeployed is the Bosh Deployment Status spec Deployed State
	BDPLStateDeployed = "Deployed"
	// BDPLStateConverting is the Bosh Deployment Status spec State during conversion
	BDPLStateConverting = "Converting to Kube resource"
	// BDPLStateResolving is the Bosh Deployment Status spec during the resolving phase
	BDPLStateResolving = "Resolving Manifest"
)
View Source
const BDPLStateCreating = "Creating/Updating"

BDPLStateCreating is the Bosh Deployment Status spec Creating State

View Source
const ReconcileSkipDuration = 10 * time.Second

ReconcileSkipDuration is the duration of merging consecutive triggers.

Variables

This section is empty.

Functions

func AddBDPLStatusReconcilers

func AddBDPLStatusReconcilers(ctx context.Context, config *config.Config, mgr manager.Manager) error

AddBDPLStatusReconcilers creates a new BDPL Status controller to update BDPL status.

func AddBPM

func AddBPM(ctx context.Context, config *config.Config, mgr manager.Manager) error

AddBPM creates a new BPM controller to watch for BPM configs and instance group manifests. It will reconcile those into k8s resources (QuarksStatefulSet, QuarksJob), which represent BOSH instance groups and BOSH errands.

func AddDeployment

func AddDeployment(ctx context.Context, config *config.Config, mgr manager.Manager) error

AddDeployment creates a new BOSHDeployment controller to watch for BOSHDeployment manifest custom resources and start the rendering, which will finally produce the "desired manifest", the instance group manifests and the BPM configs.

func AddWithOps

func AddWithOps(ctx context.Context, config *config.Config, mgr manager.Manager) error

AddWithOps creates a new WithOps controller to watch for withops secret and starts the rendering, which will finally produce the desired manifest secret.

func NewBOSHDeploymentValidator

func NewBOSHDeploymentValidator(log *zap.SugaredLogger, config *config.Config) *wh.OperatorWebhook

NewBOSHDeploymentValidator creates a validating hook for BOSHDeployment and adds it to the Manager

func NewBPMReconciler

func NewBPMReconciler(ctx context.Context, config *config.Config, mgr manager.Manager, resolver DesiredManifest, srf setReferenceFunc, converter BPMConverter) reconcile.Reconciler

NewBPMReconciler returns a new reconcile.Reconciler

func NewDeploymentReconciler

func NewDeploymentReconciler(ctx context.Context, config *config.Config, mgr manager.Manager, withops WithOps, jobFactory JobFactory, converter VariablesConverter, srf setReferenceFunc) reconcile.Reconciler

NewDeploymentReconciler returns a new reconcile.Reconciler

func NewQJobStatusReconciler

func NewQJobStatusReconciler(ctx context.Context, config *config.Config, mgr manager.Manager) reconcile.Reconciler

NewQJobStatusReconciler returns a new reconcile.Reconciler for QuarksStatefulSets Status

func NewStatusQSTSReconciler

func NewStatusQSTSReconciler(ctx context.Context, config *config.Config, mgr manager.Manager) reconcile.Reconciler

NewStatusQSTSReconciler returns a new reconcile.Reconciler for QuarksStatefulSets Status

func NewValidator

func NewValidator(log *zap.SugaredLogger, config *config.Config) admission.Handler

NewValidator returns a new BOSHDeploymentValidator

func NewWithOpsReconciler

func NewWithOpsReconciler(ctx context.Context, config *config.Config, mgr manager.Manager, resolver InterpolateSecrets, srf setReferenceFunc, dns NewDNSFunc) reconcile.Reconciler

NewWithOpsReconciler returns a new reconcile.Reconciler

Types

type BPMConverter

type BPMConverter interface {
	Resources(manifest bdm.Manifest, namespace string, manifestName string, serviceIP string, qStsVersion string, instanceGroup *bdm.InstanceGroup, bpmConfigs bpm.Configs, igResolvedSecretVersion string) (*bpmconverter.Resources, error)
}

BPMConverter converts k8s resources from single BOSH manifest

type DesiredManifest

type DesiredManifest interface {
	DesiredManifest(ctx context.Context, namespace string) (*bdm.Manifest, error)
}

DesiredManifest unmarshals desired manifest from the manifest secret

type InterpolateSecrets

type InterpolateSecrets interface {
	InterpolateVariableFromSecrets(ctx context.Context, withOpsManifestData []byte, namespace string, boshdeploymentName string) ([]byte, error)
}

InterpolateSecrets renders manifest variables from quarkssecrets.

type JobFactory

type JobFactory interface {
	InstanceGroupManifestJob(namespace string, deploymentName string, manifest bdm.Manifest, linkInfos converter.LinkInfos, initialRollout bool) (*qjv1a1.QuarksJob, error)
}

JobFactory creates Jobs for a given manifest

type NewDNSFunc

type NewDNSFunc func(m bdm.Manifest) (boshdns.DomainNameService, error)

NewDNSFunc returns a dns client for the manifest

type ReconcileBOSHDeployment

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

ReconcileBOSHDeployment reconciles a BOSHDeployment object

func (*ReconcileBOSHDeployment) Reconcile

Reconcile starts the deployment process for a BOSHDeployment and deploys QuarksJobs to generate required properties for instance groups and rendered BPM

type ReconcileBPM

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

ReconcileBPM reconciles an Instance Group BPM versioned secret

func (*ReconcileBPM) Reconcile

func (r *ReconcileBPM) Reconcile(_ context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile reconciles an Instance Group BPM versioned secret read the corresponding desired manifest. It then applies BPM information and deploys instance groups.

type ReconcileBoshDeploymentQJobStatus

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

ReconcileBoshDeploymentQJobStatus reconciles an QuarksStatefulSet object for its status

func (*ReconcileBoshDeploymentQJobStatus) Reconcile

Reconcile reads that state of QuarksJobs and QuarksStatefulSets and updates the bosh deployment status accordingly. The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

type ReconcileBoshDeploymentQSTSStatus

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

ReconcileBoshDeploymentQSTSStatus reconciles an QuarksStatefulSet object for its status

func (*ReconcileBoshDeploymentQSTSStatus) Reconcile

Reconcile reads that state of QuarksJobs and QuarksStatefulSets and updates the bosh deployment status accordingly. and makes changes based on the state read and what is in the QuarksStatefulSet.Spec Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

type ReconcileWithOps

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

ReconcileWithOps reconciles the with ops manifest secret

func (*ReconcileWithOps) Reconcile

func (r *ReconcileWithOps) Reconcile(_ context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile reconciles an withOps secret and generates the corresponding desired manifest secret.

type Validator

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

Validator struct contains all fields for the deployment validator

func (*Validator) Handle

Handle validates a BOSHDeployment

func (*Validator) InjectClient

func (v *Validator) InjectClient(c client.Client) error

InjectClient injects the client.

func (*Validator) InjectDecoder

func (v *Validator) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder.

type VariablesConverter

type VariablesConverter interface {
	Variables(namespace string, manifestName string, variables []bdm.Variable) ([]qsv1a1.QuarksSecret, error)
}

VariablesConverter converts BOSH variables into QuarksSecrets

type WithOps

type WithOps interface {
	Manifest(ctx context.Context, bdpl *bdv1.BOSHDeployment, namespace string) (*bdm.Manifest, error)
}

WithOps interpolates BOSH manifests and operations files to create the WithOps manifest

Jump to

Keyboard shortcuts

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