Documentation ¶
Index ¶
- Variables
- type ChartLoader
- type Component
- type Components
- type Configuration
- type Configurations
- type Environment
- type Executor
- type LocalCharts
- type Metadata
- type Release
- type SecretNames
- type SecretValues
- type SecretsReadWriteDeleter
- type SecretsReader
- type SecretsWriteDeleter
- type StateProvider
- type Version
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNonLandscapeComponent is an error to indicate a release is not controlled by landscaper ErrNonLandscapeComponent = errors.New("release is not controlled by landscaper") // ErrInvalidLandscapeMetadata is an error to indicate a release contains invalid landscaper metadata ErrInvalidLandscapeMetadata = errors.New("release contains invalid landscaper metadata") )
var ( SemVer = "-" GitCommit = "-" GitTag = "-" )
plugged in during build
Functions ¶
This section is empty.
Types ¶
type ChartLoader ¶
ChartLoader allows one to load Charts by name
type Component ¶
type Component struct { Name string `json:"name" validate:"nonzero,max=51"` Namespace string `json:"namespace"` Release *Release `json:"release" validate:"nonzero"` Configuration Configuration `json:"configuration"` Environments Configurations `json:"environments"` SecretsRaw interface{} `json:"secrets"` SecretNames SecretNames `json:"-"` SecretValues SecretValues `json:"-"` }
Component contains information about the release, configuration and secrets of a component
func NewComponent ¶
func NewComponent(name string, namespace string, release *Release, cfg Configuration, envs Configurations, secretNames SecretNames) *Component
NewComponent creates a Component and adds Name to the configuration
func (*Component) FullChartRef ¶
FullChartRef provides a chart references like "myRepo/chartName"
type Components ¶
Components is a collection of uniquely named Component objects
type Configuration ¶
type Configuration map[string]interface{}
Configuration contains all the values that should be applied to the component's helm package release
func (Configuration) GetMetadata ¶
func (cfg Configuration) GetMetadata() (*Metadata, error)
GetMetadata returns a Metadata if present
func (Configuration) HasMetadata ¶
func (cfg Configuration) HasMetadata() bool
HasMetadata returns true if the config contains a landscaper metadata structure
func (Configuration) Merge ¶
func (cfg Configuration) Merge(src Configuration) Configuration
Merge two configurations
func (Configuration) SetMetadata ¶
func (cfg Configuration) SetMetadata(m *Metadata)
SetMetadata sets the provided Metadata
func (Configuration) YAML ¶
func (cfg Configuration) YAML() (string, error)
YAML encodes the Values into a YAML string.
type Configurations ¶
type Configurations map[string]Configuration
Configurations are a list of environment specific configuration overrides
type Environment ¶
type Environment struct { HelmHome string // Helm's home directory DryRun bool // If true, don't modify anything Wait bool // Wait until all resources become ready WaitTimeout time.Duration // Wait for helm ChartLoader ChartLoader // ChartLoader loads charts ReleaseNamePrefix string // Prepend this string to release names ComponentFiles []string // Landscaper component file names LandscapeDir string // deprecated: ComponentFiles is leading; LandscapeDir merely fills it Namespace string // Default namespace releases are put into; components can override it though Verbose bool // Reduce log level Context string // Kubernetes context to use Loop bool // Keep looping LoopInterval time.Duration // Loop every duration TillerNamespace string // where to install / use tiller AzureKeyVault string // Azure keyvault to use for secrets if provided Environment string // Environment selections ConfigurationOverrideFile string // Global configuration overrides file DisabledStages stringSlice // stages to disable during landscaper apply // contains filtered or unexported fields }
Environment contains all the information about the k8s cluster and local configuration
func (*Environment) HelmClient ¶
func (e *Environment) HelmClient() helm.Interface
HelmClient makes sure the environment has a HelmClient initialized and returns it
func (*Environment) KubeClient ¶
func (e *Environment) KubeClient() internalversion.CoreInterface
KubeClient makes sure the environment has a KubeClient initialized
type Executor ¶
type Executor interface { Apply(Components, Components) (map[string][]string, error) CreateComponent(*Component) error UpdateComponent(*Component) error DeleteComponent(*Component) error }
Executor is responsible for applying a desired landscape to the actual landscape
func NewExecutor ¶
func NewExecutor(helmClient helm.Interface, chartLoader ChartLoader, kubeSecrets SecretsWriteDeleter, dryRun bool, wait bool, waitTimeout int64, disabledStages []string) Executor
NewExecutor is a factory method to create a new Executor
type LocalCharts ¶
type LocalCharts struct {
HomePath string
}
LocalCharts allows one to load Charts from a local path
func NewLocalCharts ¶
func NewLocalCharts(homePath string) *LocalCharts
NewLocalCharts creates a LocalCharts ChartLoader
type Metadata ¶
Metadata holds landscaper metadata that is attached to a component/release through its Configuration
type Release ¶
type Release struct { Chart string `json:"chart" validate:"nonzero"` // TODO: write a regexp validation for the chart Version string `json:"version"` }
Release contains the information of a component release
type SecretNames ¶ added in v1.0.16
SecretNames is a map containing the name of the secrets and a reference to get their value from the secrets provider.
type SecretValues ¶
SecretValues is a map containing the actual values of the secrets. Note that this should not be written to kubernetes or anywhere else persistent!
type SecretsReadWriteDeleter ¶
type SecretsReadWriteDeleter interface { SecretsReader SecretsWriteDeleter }
SecretsReadWriteDeleter allows reading, writing and deleting secrets
func NewKubeSecretsReadWriteDeleter ¶
func NewKubeSecretsReadWriteDeleter(kubeClient internalversion.CoreInterface) SecretsReadWriteDeleter
NewKubeSecretsReadWriteDeleter create a new SecretsReadWriteDeleter for kubernetes secrets
type SecretsReader ¶
type SecretsReader interface {
Read(componentName, namespace string, secretNames SecretNames) (SecretValues, error)
}
SecretsReader allows reading secrets
func NewAzureSecretsReader ¶
func NewAzureSecretsReader(keyVault string) (SecretsReader, error)
NewAzureSecretsReader creates a SecretsReader that fetches secrets from an Azure KeyVault
func NewEnvironmentSecretsReader ¶
func NewEnvironmentSecretsReader() SecretsReader
NewEnvironmentSecretsReader creates a SecretsReader for secrets provided via environment variables
type SecretsWriteDeleter ¶
type SecretsWriteDeleter interface { Write(componentName, namespace string, secretValues SecretValues) error Delete(componentName, namespace string) error }
SecretsWriteDeleter allows writing and deleting secrets
type StateProvider ¶
type StateProvider interface {
Components() (Components, error)
}
StateProvider can be used to obtain a state, actual (from Helm) or desired (e.g. from files)
func NewFileStateProvider ¶
func NewFileStateProvider(fileNames []string, secrets SecretsReader, chartLoader ChartLoader, releaseNamePrefix, namespace string, environment string, configurationOverrideFile string) StateProvider
NewFileStateProvider creates a StateProvider that sources Files
func NewHelmStateProvider ¶
func NewHelmStateProvider(helmClient helm.Interface, secrets SecretsReader, releaseNamePrefix string) StateProvider
NewHelmStateProvider creates a StateProvider that sources Helm (actual state)