server

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// APIServerPort is the port to listen on
	APIServerPort int
	// BackendTemplate is the name of a secret in the controller namespace which
	// contains an optional template to use for the backend state - unless this
	// is set we use the default backend state i.e. kubernetes state
	BackendTemplate string
	// BackoffLimit is the number of times we are willing to allow a job to fail
	BackoffLimit int
	// DriftControllerInterval is the interval for the controller to check for drift
	DriftControllerInterval time.Duration
	// DriftInterval is the minimum interval between drift checks
	DriftInterval time.Duration
	// DriftThreshold is the max number of drifts we are running to run - this prevents the
	// controller from running many configurations at the same time
	DriftThreshold float64
	// EnableContextInjection indicates the controller should always inject the context
	// into the terraform variables - i.e. namespace and name under a terraform variable
	// called 'terranetes'
	EnableContextInjection bool
	// EnableRevisionUpdateProtection indicates the controller should not allow the
	// updating of revisions which are currently in use
	EnableRevisionUpdateProtection bool
	// EnableNamespaceProtection indicates the controller should protect the namespace
	// from being deleted if there are any terranetes resources in the namespace
	EnableNamespaceProtection bool
	// EnableWebhooks enables the webhooks registration
	EnableWebhooks bool
	// EnableWatchers enables the creation of watcher jobs
	EnableWatchers bool
	// EnableTerraformVersions indicates if configurations can override the default terraform version
	EnableTerraformVersions bool
	// EnableWebhookPrefix enables adding the "terranetes-controller-" prefix to webhook configuration names
	EnableWebhookPrefix bool
	// ExecutorImage is the image to use for the executor
	ExecutorImage string
	// ExecutorSecrets is a list of additional secrets to be added to the executor
	ExecutorSecrets []string
	// InfracostsSecretName is the name of the secret that contains the cost token and endpoint
	InfracostsSecretName string
	// InfracostsImage is the image to use for infracosts
	InfracostsImage string
	// JobLabels is a collection of labels which are added to all jobs
	JobLabels []string
	// JobTemplate is the name of the configmap containing a template for the jobs
	JobTemplate string
	// MetricsPort is the port to listen on
	MetricsPort int
	// Namespace is namespace the controller is running
	Namespace string
	// PolicyImage is the image to use for policy
	PolicyImage string
	// PreloadImage is the image to use for the preload job
	PreloadImage string
	// RegisterCRDs indicated we register our crds
	RegisterCRDs bool
	// ResyncPeriod is the period to resync the controller manager
	ResyncPeriod time.Duration
	// RevisionExpiration is the duration before a revision is expired
	RevisionExpiration time.Duration
	// TerraformImage is the image to use for terraform
	TerraformImage string
	// TLSDir is the directory where the TLS certificates are stored
	TLSDir string
	// TLSAuthority is the path to the ca certificate
	TLSAuthority string
	// TLSCert is the path to the certificate
	TLSCert string
	// TLSKey is the path to the key
	TLSKey string
	// WebhookPort is the port to listen on
	WebhookPort int
}

Config is the configuration for the controller

type Server

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

Server is a wrapper around the services

func New

func New(cfg *rest.Config, config Config) (*Server, error)

New returns and starts a new server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start is called to begin the service

Jump to

Keyboard shortcuts

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