Documentation ¶
Overview ¶
Package operations provides methods to perform kubernetes-specific IaaS operations like cordon & drain, cluster upgrades, remote SSH, and scaling of agentpools.
Index ¶
- Constants
- func CleanDeleteVirtualMachine(az armhelpers.AKSEngineClient, logger *log.Entry, ...) error
- func GetNodes(az armhelpers.AKSEngineClient, logger *log.Entry, ...) ([]v1.Node, error)
- func PrintNodes(nodes []v1.Node)
- func RemoteRun(user string, addr string, port int, sshKey []byte, cmd string) (string, error)
- func SafelyDrainNode(az armhelpers.AKSEngineClient, logger *log.Entry, ...) error
- func SafelyDrainNodeWithClient(client kubernetes.Client, logger *log.Entry, nodeName string, ...) error
- func ScaleDownVMs(az armhelpers.AKSEngineClient, logger *log.Entry, subscriptionID string, ...) *list.List
- type VMScalingErrorDetails
Examples ¶
Constants ¶
const (
// AADRoleResourceGroupScopeTemplate is a template for a roleDefinition scope
AADRoleResourceGroupScopeTemplate = "/subscriptions/%s/resourceGroups/%s"
)
Variables ¶
This section is empty.
Functions ¶
func CleanDeleteVirtualMachine ¶
func CleanDeleteVirtualMachine(az armhelpers.AKSEngineClient, logger *log.Entry, subscriptionID, resourceGroup, name string) error
CleanDeleteVirtualMachine deletes a VM and any associated OS disk
func GetNodes ¶ added in v0.40.0
func GetNodes(az armhelpers.AKSEngineClient, logger *log.Entry, apiserverURL, kubeConfig string, timeout time.Duration, pool string, waitForNumNodes int) ([]v1.Node, error)
GetNodes is a thin wrapper around the k8s api list nodes interface Pass in a pool string to filter only node objects in that AKS Engine-deployed node pool Pass in a waitForNumNodes int to wait for an explicit target node count before returning
func PrintNodes ¶ added in v0.40.0
PrintNodes outputs nodes to stdout
Example ¶
var nodes []v1.Node node := v1.Node{} node.Name = fmt.Sprintf("%s-1234", common.LegacyControlPlaneVMPrefix) node.Status.Conditions = append(node.Status.Conditions, v1.NodeCondition{Type: v1.NodeReady, Status: v1.ConditionTrue}) node.Status.NodeInfo.KubeletVersion = "1.10.0" node.Status.NodeInfo.OSImage = "my-os" node.Status.NodeInfo.KernelVersion = "3.1.4" nodes = append(nodes, node) PrintNodes(nodes)
Output: NODE STATUS VERSION OS KERNEL k8s-master-1234 Ready 1.10.0 my-os 3.1.4
func SafelyDrainNode ¶
func SafelyDrainNode(az armhelpers.AKSEngineClient, logger *log.Entry, apiserverURL, kubeConfig, nodeName string, timeout time.Duration) error
SafelyDrainNode safely drains a node so that it can be deleted from the cluster
func SafelyDrainNodeWithClient ¶
func SafelyDrainNodeWithClient(client kubernetes.Client, logger *log.Entry, nodeName string, timeout time.Duration) error
SafelyDrainNodeWithClient safely drains a node so that it can be deleted from the cluster
func ScaleDownVMs ¶
func ScaleDownVMs(az armhelpers.AKSEngineClient, logger *log.Entry, subscriptionID string, resourceGroup string, vmNames ...string) *list.List
ScaleDownVMs removes the vms in the provided list. Returns a list with details on each failure. all items in the list will always be of type *VMScalingErrorDetails
Types ¶
type VMScalingErrorDetails ¶
VMScalingErrorDetails give the index in the agent pool that failed and the accompanying error
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package kubernetesupgrade allows upgrading of Kubernetes clusters.
|
Package kubernetesupgrade allows upgrading of Kubernetes clusters. |