Documentation
¶
Index ¶
- Variables
- func IsStateFinal(state v1.StepState) bool
- func IsStateLE(lhs, rhs v1.StepState) bool
- func TypesFromString(s string) (map[Type]struct{}, error)
- type AKSAddonPreflightStep
- type AKSPoolStep
- type AddonStep
- type DestroyStep
- type ID
- type InfraStep
- type InfraValues
- type KubeconfigStep
- type Meta
- type MetaUpdateFn
- type Metaa
- type Step
- type Type
- type Updater
Constants ¶
This section is empty.
Variables ¶
var Types = []Type{TypeInfra, TypeDestroy, TypeAKSPool, TypeKubeconfig, TypeAKSAddonPreflight, TypeAddons}
Types is an enumeration of all types.
Functions ¶
func IsStateFinal ¶
IsStateFinal returns true is state is a final state. A step in final state has stopped executing.
func IsStateLE ¶
IsStateLE returns true if lhs is less or equal to rhs assuming the ordering; "", Running, Ready | Error
func TypesFromString ¶
TypeFromString converts a comma separated list of type names to a set of Type. On empty input an empty set is returned.
Types ¶
type AKSAddonPreflightStep ¶
type AKSAddonPreflightStep struct {
Metaa
/* Parameters */
// KCPath is the path of the kube config file.
KCPath string
// Kubectl is the kubectl implementation to use.
Kubectl kubectl.Kubectrler
}
AKSAddonPreflightStep waits until all AKS specific preflight checks have been met.
type AKSPoolStep ¶
type AKSPoolStep struct {
Metaa
// ResourceGroup that contains Cluster.
ResourceGroup string
// Cluster is the name of the AKS cluster to upgrade the node pool(s) of.
// NB. This is the AKS name (which is the short name with a prefix).
Cluster string
// Version is the Kubernetes version to upgrade the node pool(s) to.
Version string
// Azure is the azure cli implementation to use.
Azure azure.AZer
}
AKSPoolStep can upgrade AKS node pools to the desired Kubernetes version.
type AddonStep ¶
type AddonStep struct {
Metaa
Addon addon.Addonr
// KCPath is the path of the kube config file.
KCPath string
// MasterVaultPath is the path to a directory containing the config of the Vault to use.
MasterVaultPath string
// SourcePath is the path to the directory containing the k8s resources.
SourcePath string
// JobPaths is collection of paths (relative to SourcePath) to job files.
// kubectl-tmplt is run for each element in the collection.
JobPaths []string
// Values are passed with -set flag to kubectl-tmplt.
Values map[string]string
// The number of resources created, modified and deleted.
Added, Changed, Deleted int
}
AddonStep performs a kubectl-tmplt apply.
type DestroyStep ¶
type DestroyStep struct {
Metaa
// Values to use for terraform input variables.
Values InfraValues
// SourcePath is the path to the directory containing terraform code.
SourcePath string
// Cloud provides generic cloud functionality.
Cloud cloud.Cloud
// Terraform is the terraform implementation to use.
Terraform terraform.Terraformer
// Azure is the azure cli implementation to use.
Azure azure.AZer
// The number of objects added, changed and deleted (destroyed) on terraform destroy completion.
Added, Changed, Deleted int
}
DestroyStep performs a terraform destroy.
type ID ¶
type ID struct {
// Type is the type of step, for example; Infra, Destroy, Addons.
Type Type
// Namespace Name identifies the plan to which the step belongs.
Namespace, Name string
// ClusterName (optional) is the name of the target cluster.
ClusterName string
}
ID uniquely identifies a Step.
type InfraStep ¶
type InfraStep struct {
Metaa
// Values to use for terraform input variables.
Values InfraValues
// SourcePath is the path to the directory containing terraform code.
SourcePath string
// Cloud provides generic cloud functionality.
Cloud cloud.Cloud
// Azure provides Azure resource manager functionality.
// (prefer to use Cloud instead of Azure)
Azure azure.AZer
// Terraform provides terraform functionality.
Terraform terraform.Terraformer
// Added, Changed, Deleted are then number of infrastructure objects affected.
Added, Changed, Deleted int
}
InfraStep performs a terraform init, plan and apply.
type InfraValues ¶
type InfraValues struct {
Infra v1.InfraSpec
Clusters []v1.ClusterSpec
}
InfraValues hold the Specs that are needed during template expansion.
type KubeconfigStep ¶
type KubeconfigStep struct {
Metaa
// TFPath is the path to the directory containing terraform code.
TFPath string
// ClusterName is the name of the k8s cluster to create a kube config for.
ClusterName string
// KCPath is the place were the kube config file is written.
KCPath string
// Access is the token access terraform state with.
Access string
// Cloud provides generic cloud functionality.
Cloud cloud.Cloud
// Terraform is the terraform implementation to use.
Terraform terraform.Terraformer
// Kubectl is the kubectl implementation to use.
Kubectl kubectl.Kubectrler
// Values are key-values like k8sEnvironment, k8sCluster, k8sDomain, k8sProvider
Values map[string]string
// Client is used to access the cluster envop is running in.
Client cluster.Client
}
KubeconfigStep reads data from terraform, creates a kubeconfig file and syncs Secrets containing kubeconfigs.
type Meta ¶
type Meta interface {
GetID() ID
GetHash() string
GetState() v1.StepState
GetMsg() string
GetLastUpdate() time.Time
GetLastError() error
SetOnUpdate(fn MetaUpdateFn)
}
Meta is behaviour that all steps have in common.
type MetaUpdateFn ¶
type MetaUpdateFn func(Meta)
type Metaa ¶
type Metaa struct {
// ID uniquely identifies a step.
ID ID
// Hash is unique for the config/parameters applied by a step.
Hash string
// State indicates if a step is running, ready or is in error.
State v1.StepState
// Msg helps explaining the state. Mandatory for StepStateError.
Msg string
// LastUpdate is the time of the last state change.
LastUpdate time.Time
// contains filtered or unexported fields
}
Metaa is the data that all steps have in common. (it is embedded in all Steps types)
func (*Metaa) GetLastError ¶
func (*Metaa) GetLastUpdate ¶
func (*Metaa) SetOnUpdate ¶
func (m *Metaa) SetOnUpdate(fn MetaUpdateFn)