Documentation ¶
Index ¶
- Constants
- Variables
- func BootstrapAdditionalMasterNode(kubeCl *client.KubernetesClient, cfg *config.MetaConfig, index int, ...) (*terraform.PipelineOutputs, error)
- func BootstrapAdditionalNode(kubeCl *client.KubernetesClient, cfg *config.MetaConfig, index int, ...) error
- func CreateNodeGroup(kubeCl *client.KubernetesClient, nodeGroupName string, ...) error
- func CreateNodeTerraformState(kubeCl *client.KubernetesClient, nodeName, nodeGroup string, settings []byte) error
- func DeleteNode(kubeCl *client.KubernetesClient, nodeName string) error
- func DeleteNodeGroup(kubeCl *client.KubernetesClient, nodeGroupName string) error
- func DeleteTerraformState(kubeCl *client.KubernetesClient, secretName string) error
- func GetCloudConfig(kubeCl *client.KubernetesClient, nodeGroupName string, showDeckhouseLogs bool) (string, error)
- func GetClusterStateFromCluster(kubeCl *client.KubernetesClient) ([]byte, error)
- func GetClusterUUID(kubeCl *client.KubernetesClient) (string, error)
- func GetLockLeaseConfig(identity string) *client.LeaseLockConfig
- func GetMetaConfig(kubeCl *client.KubernetesClient) (*config.MetaConfig, error)
- func GetNodeGroup(kubeCl *client.KubernetesClient, nodeGroupName string) (*unstructured.Unstructured, error)
- func GetNodeGroupDirect(kubeCl *client.KubernetesClient, nodeGroupName string) (*unstructured.Unstructured, error)
- func GetNodeGroupTemplates(kubeCl *client.KubernetesClient) (map[string]map[string]interface{}, error)
- func GetNodeGroups(kubeCl *client.KubernetesClient) ([]unstructured.Unstructured, error)
- func GetNodesStateFromCluster(kubeCl *client.KubernetesClient) (map[string]NodeGroupTerraformState, error)
- func IsNodeExistsInCluster(kubeCl *client.KubernetesClient, nodeName string) (bool, error)
- func LockConvergeFromLocal(kubeCl *client.KubernetesClient, identity string) (func(bool), error)
- func NodeName(cfg *config.MetaConfig, nodeGroupName string, index int) string
- func SaveClusterTerraformState(kubeCl *client.KubernetesClient, outputs *terraform.PipelineOutputs) error
- func SaveMasterNodeTerraformState(kubeCl *client.KubernetesClient, nodeName string, tfState, devicePath []byte) error
- func SaveNodeTerraformState(kubeCl *client.KubernetesClient, nodeName, nodeGroup string, ...) error
- func UpdateNodeGroup(kubeCl *client.KubernetesClient, nodeGroupName string, ...) error
- func WaitForNodesBecomeReady(kubeCl *client.KubernetesClient, nodeGroupName string, desiredReadyNodes int) error
- func WaitForNodesListBecomeReady(kubeCl *client.KubernetesClient, nodes []string, checker hook.NodeChecker) error
- func WaitForSingleNodeBecomeReady(kubeCl *client.KubernetesClient, nodeName string) error
- type ClusterCheckResult
- type ClusterStateSaver
- type InLockRunner
- type NodeCheckResult
- type NodeGroupCheckResult
- type NodeGroupController
- func (c *NodeGroupController) Run() error
- func (c *NodeGroupController) WithChangeSettings(changeSettings *terraform.ChangeActionSettings) *NodeGroupController
- func (c *NodeGroupController) WithCommanderMode(commanderMode bool) *NodeGroupController
- func (c *NodeGroupController) WithExcludedNodes(nodesMap map[string]bool) *NodeGroupController
- type NodeGroupGroupOptions
- type NodeGroupTerraformState
- type NodeStateSaver
- type Phase
- type Runner
- func (r *Runner) RunConverge() error
- func (r *Runner) WithChangeSettings(changeSettings *terraform.ChangeActionSettings) *Runner
- func (r *Runner) WithCommanderMode(commanderMode bool) *Runner
- func (r *Runner) WithCommanderModeParams(params *commander.CommanderModeParams) *Runner
- func (r *Runner) WithExcludedNodes(nodes []string) *Runner
- func (r *Runner) WithPhasedExecutionContext(pec *phases.PhasedExecutionContext) *Runner
- func (r *Runner) WithSkipPhases(phases []Phase) *Runner
- type Statistics
Constants ¶
View Source
const ( OKStatus = "ok" ChangedStatus = "changed" DestructiveStatus = "destructively_changed" AbandonedStatus = "abandoned" AbsentStatus = "absent" ErrorStatus = "error" )
View Source
const ( MasterNodeGroupName = "master" AutoConvergerIdentity = "terraform-auto-converger" )
View Source
const ( PhaseBaseInfra = Phase("base-infrastructure") PhaseAllNodes = Phase("all-nodes") )
View Source
const HideDeckhouseLogs = false
View Source
const ShowDeckhouseLogs = true
Variables ¶
View Source
var (
ErrConvergeInterrupted = errors.New("Interrupted.")
)
View Source
var ErrNoTerraformState = errors.New("Terraform state is not found in outputs.")
View Source
var (
ErrNodeGroupChanged = fmt.Errorf("Node group was changed during accept diff.")
)
Functions ¶
func BootstrapAdditionalMasterNode ¶
func BootstrapAdditionalMasterNode(kubeCl *client.KubernetesClient, cfg *config.MetaConfig, index int, cloudConfig string, isConverge bool) (*terraform.PipelineOutputs, error)
func BootstrapAdditionalNode ¶
func BootstrapAdditionalNode(kubeCl *client.KubernetesClient, cfg *config.MetaConfig, index int, step, nodeGroupName, cloudConfig string, isConverge bool) error
func CreateNodeGroup ¶
func CreateNodeGroup(kubeCl *client.KubernetesClient, nodeGroupName string, data map[string]interface{}) error
func CreateNodeTerraformState ¶
func CreateNodeTerraformState(kubeCl *client.KubernetesClient, nodeName, nodeGroup string, settings []byte) error
Create secret for node with group settings only.
func DeleteNode ¶
func DeleteNode(kubeCl *client.KubernetesClient, nodeName string) error
func DeleteNodeGroup ¶
func DeleteNodeGroup(kubeCl *client.KubernetesClient, nodeGroupName string) error
func DeleteTerraformState ¶
func DeleteTerraformState(kubeCl *client.KubernetesClient, secretName string) error
func GetCloudConfig ¶
func GetClusterStateFromCluster ¶
func GetClusterStateFromCluster(kubeCl *client.KubernetesClient) ([]byte, error)
func GetClusterUUID ¶
func GetClusterUUID(kubeCl *client.KubernetesClient) (string, error)
func GetLockLeaseConfig ¶
func GetLockLeaseConfig(identity string) *client.LeaseLockConfig
func GetMetaConfig ¶
func GetMetaConfig(kubeCl *client.KubernetesClient) (*config.MetaConfig, error)
func GetNodeGroup ¶
func GetNodeGroup(kubeCl *client.KubernetesClient, nodeGroupName string) (*unstructured.Unstructured, error)
func GetNodeGroupDirect ¶
func GetNodeGroupDirect(kubeCl *client.KubernetesClient, nodeGroupName string) (*unstructured.Unstructured, error)
func GetNodeGroupTemplates ¶
func GetNodeGroupTemplates(kubeCl *client.KubernetesClient) (map[string]map[string]interface{}, error)
func GetNodeGroups ¶
func GetNodeGroups(kubeCl *client.KubernetesClient) ([]unstructured.Unstructured, error)
func GetNodesStateFromCluster ¶
func GetNodesStateFromCluster(kubeCl *client.KubernetesClient) (map[string]NodeGroupTerraformState, error)
func IsNodeExistsInCluster ¶
func IsNodeExistsInCluster(kubeCl *client.KubernetesClient, nodeName string) (bool, error)
func LockConvergeFromLocal ¶
func LockConvergeFromLocal(kubeCl *client.KubernetesClient, identity string) (func(bool), error)
func SaveClusterTerraformState ¶
func SaveClusterTerraformState(kubeCl *client.KubernetesClient, outputs *terraform.PipelineOutputs) error
func SaveMasterNodeTerraformState ¶
func SaveMasterNodeTerraformState(kubeCl *client.KubernetesClient, nodeName string, tfState, devicePath []byte) error
func SaveNodeTerraformState ¶
func SaveNodeTerraformState(kubeCl *client.KubernetesClient, nodeName, nodeGroup string, tfState, settings []byte) error
func UpdateNodeGroup ¶
func UpdateNodeGroup(kubeCl *client.KubernetesClient, nodeGroupName string, ng *unstructured.Unstructured) error
func WaitForNodesBecomeReady ¶
func WaitForNodesBecomeReady(kubeCl *client.KubernetesClient, nodeGroupName string, desiredReadyNodes int) error
func WaitForNodesListBecomeReady ¶
func WaitForNodesListBecomeReady(kubeCl *client.KubernetesClient, nodes []string, checker hook.NodeChecker) error
func WaitForSingleNodeBecomeReady ¶
func WaitForSingleNodeBecomeReady(kubeCl *client.KubernetesClient, nodeName string) error
Types ¶
type ClusterCheckResult ¶
type ClusterCheckResult struct {
Status string `json:"status,omitempty"`
}
type ClusterStateSaver ¶
type ClusterStateSaver struct {
// contains filtered or unexported fields
}
func NewClusterStateSaver ¶
func NewClusterStateSaver(kubeCl *client.KubernetesClient) *ClusterStateSaver
func (*ClusterStateSaver) SaveState ¶
func (s *ClusterStateSaver) SaveState(outputs *terraform.PipelineOutputs) error
type InLockRunner ¶
type InLockRunner struct {
// contains filtered or unexported fields
}
func NewInLockLocalRunner ¶
func NewInLockLocalRunner(kubeCl *client.KubernetesClient, identity string) *InLockRunner
func NewInLockRunner ¶
func NewInLockRunner(kubeCl *client.KubernetesClient, identity string) *InLockRunner
func (*InLockRunner) Run ¶
func (r *InLockRunner) Run(action func() error) error
func (*InLockRunner) WithForceLock ¶
func (r *InLockRunner) WithForceLock(f bool) *InLockRunner
func (*InLockRunner) WithFullUnlock ¶
func (r *InLockRunner) WithFullUnlock(f bool) *InLockRunner
type NodeCheckResult ¶
type NodeGroupCheckResult ¶
type NodeGroupController ¶
type NodeGroupController struct {
// contains filtered or unexported fields
}
func NewConvergeController ¶
func NewConvergeController(kubeCl *client.KubernetesClient, metaConfig *config.MetaConfig, name string, state NodeGroupTerraformState, stateCache dstate.Cache) *NodeGroupController
func (*NodeGroupController) Run ¶
func (c *NodeGroupController) Run() error
func (*NodeGroupController) WithChangeSettings ¶
func (c *NodeGroupController) WithChangeSettings(changeSettings *terraform.ChangeActionSettings) *NodeGroupController
func (*NodeGroupController) WithCommanderMode ¶
func (c *NodeGroupController) WithCommanderMode(commanderMode bool) *NodeGroupController
func (*NodeGroupController) WithExcludedNodes ¶
func (c *NodeGroupController) WithExcludedNodes(nodesMap map[string]bool) *NodeGroupController
type NodeGroupGroupOptions ¶
type NodeGroupGroupOptions struct { Name string Step string CloudConfig string DesiredReplicas int State map[string][]byte }
func (*NodeGroupGroupOptions) CurReplicas ¶
func (n *NodeGroupGroupOptions) CurReplicas() int
type NodeGroupTerraformState ¶
type NodeStateSaver ¶
type NodeStateSaver struct {
// contains filtered or unexported fields
}
func NewNodeStateSaver ¶
func NewNodeStateSaver(kubeCl *client.KubernetesClient, nodeName, nodeGroup string, nodeGroupSettings []byte) *NodeStateSaver
func (*NodeStateSaver) SaveState ¶
func (s *NodeStateSaver) SaveState(outputs *terraform.PipelineOutputs) error
SaveState is a method to patch Secret with node state. It patches a "node-tf-state" key with terraform state or create a new secret if new node is created.
settings can be nil for master node.
The difference between master node and static node: master node has no key "node-group-settings.json" with group settings.
type Runner ¶
type Runner struct { *phases.PhasedExecutionContext // contains filtered or unexported fields }
func NewRunner ¶
func NewRunner(kubeCl *client.KubernetesClient, lockRunner *InLockRunner, stateCache dstate.Cache) *Runner
func (*Runner) RunConverge ¶
func (*Runner) WithChangeSettings ¶
func (r *Runner) WithChangeSettings(changeSettings *terraform.ChangeActionSettings) *Runner
func (*Runner) WithCommanderMode ¶
func (*Runner) WithCommanderModeParams ¶
func (r *Runner) WithCommanderModeParams(params *commander.CommanderModeParams) *Runner
func (*Runner) WithExcludedNodes ¶
func (*Runner) WithPhasedExecutionContext ¶
func (r *Runner) WithPhasedExecutionContext(pec *phases.PhasedExecutionContext) *Runner
func (*Runner) WithSkipPhases ¶
type Statistics ¶
type Statistics struct { Node []NodeCheckResult `json:"nodes,omitempty"` NodeTemplates []NodeGroupCheckResult `json:"node_templates,omitempty"` Cluster ClusterCheckResult `json:"cluster,omitempty"` }
func CheckState ¶
func CheckState(kubeCl *client.KubernetesClient, metaConfig *config.MetaConfig) (*Statistics, error)
Click to show internal directories.
Click to hide internal directories.