Documentation
¶
Index ¶
- Constants
- func All(nodepools []*spec.NodePool) iter.Seq[*spec.NodePool]
- func AppendDynamicNodes(dst *spec.NodePool, nodes []*spec.Node)
- func Autoscaled(nodepools []*spec.NodePool) []*spec.NodePool
- func ByProviderDynamic(nps []*spec.NodePool) iter.Seq2[ProviderTemplateGroup, []*spec.NodePool]
- func ByProviderRegion(nodepools []*spec.NodePool) iter.Seq2[string, []*spec.NodePool]
- func ByProviderSpecName(nodepools []*spec.NodePool) iter.Seq2[string, []*spec.NodePool]
- func ByTemplatesPath(nps []*spec.NodePool) iter.Seq2[string, []*spec.NodePool]
- func CloneTargetNodes(n *spec.NodePool, nodes []string) []*spec.Node
- func Compute(nodepools []*spec.NodePool) iter.Seq[*spec.NodePool]
- func ContainsNode(nodepools []*spec.NodePool, nodeName string) bool
- func Control(nodepools []*spec.NodePool) iter.Seq[*spec.NodePool]
- func CopyNodes(dst, src *spec.NodePool, nodes []string)
- func DeleteByName(nodepools []*spec.NodePool, name string) []*spec.NodePool
- func DeleteNodeByName(nodepools []*spec.NodePool, nodeName string, keepNodePools map[string]struct{}) []*spec.NodePool
- func DeleteNodes(nodepool *spec.NodePool, nodes []string)
- func Dynamic(nodepools []*spec.NodePool) []*spec.NodePool
- func DynamicGenerateKeys(nodepools []*spec.NodePool, outputDir string) error
- func ExtractDynamic(nodepools []*spec.NodePool) []*spec.DynamicNodePool
- func ExtractRegions(nodepools []*spec.DynamicNodePool) []string
- func FindApiEndpoint(nodepools []*spec.NodePool) (*spec.NodePool, *spec.Node)
- func FindByName(nodePoolName string, nodePools []*spec.NodePool) *spec.NodePool
- func FindNode(nodepools []*spec.NodePool, nodeName string) (nodepool *spec.NodePool, node *spec.Node)
- func FindReferences(name string, nodePools []*spec.NodePool) []*spec.NodePool
- func FirstControlNode(nodepools []*spec.NodePool) *spec.Node
- func HasNodePoolTypeOf(nodepoolType, nodepoolName string) bool
- func IndexByName(nodePoolName string, nodepools []*spec.NodePool) int
- func IsAutoscaled(np *spec.NodePool) bool
- func MatchNameAndHashWithTemplate(nodepoolType, nodepoolName string) (t, h string)
- func MustExtractNameAndHash(pool string) (name, hash string)
- func NodeCount(nodepools []*spec.NodePool) int
- func PartialCopyWithNodeExclusion(np *spec.NodePool, nodes []string) *spec.NodePool
- func PartialCopyWithNodeFilter(np *spec.NodePool, nodes []string) *spec.NodePool
- func PartialCopyWithReplacedNodes(np *spec.NodePool, nodes []*spec.Node, nodeKeys map[string]string) *spec.NodePool
- func PublicEndpoints(nodepools []*spec.NodePool) []string
- func RandomDynamicNode(nodepools iter.Seq[*spec.NodePool]) *spec.Node
- func RandomNodePublicEndpoint(nps []*spec.NodePool) (username, endpoint, key, sshPort string)
- func SSHPort(np *spec.NodePool) int32
- func Static(nodepools []*spec.NodePool) []*spec.NodePool
- func StaticGenerateKeys(nodepools []*spec.NodePool, outputDir string) error
- type ProviderTemplateGroup
- type RegionNetwork
Constants ¶
const ( // DefaultSSHPort is the standard SSH port used by existing/legacy nodepools. DefaultSSHPort = int32(22) )
Variables ¶
This section is empty.
Functions ¶
func AppendDynamicNodes ¶ added in v0.10.0
Adds the passed in `nodes` into `dst` by also correctly increasing the count of the nodes within the nodepool. The nodes are not cloned but simply shallow copied into the nodepool. If the nodepool is not dynamic this is a noop function.
func Autoscaled ¶ added in v0.10.0
Autoscaled returns all autoscaled nodepools.
func ByProviderDynamic ¶ added in v0.9.3
ByProviderDynamic returns an iterator that groups dynamic nodepools only by provider.
func ByProviderRegion ¶
ByProviderRegion returns an iterator that groups nodepools by provider region.
func ByProviderSpecName ¶
ByProviderSpecName returns an iterator that groups nodepools by provider SpecName.
func ByTemplatesPath ¶ added in v0.10.0
ByTemplates returns an iterator that groups nodepools by provider templates path.
func CloneTargetNodes ¶ added in v0.10.0
Clones all of the nodes from spec.NodePool which have a matching name in the passed in nodes slice.
func ContainsNode ¶ added in v0.10.0
Returns true if the node is within one of the provided nodepools.
func CopyNodes ¶ added in v0.10.0
Copies the nodes from `src` into `dst` cloning the invidivual nodes, such that they do not keep any pointers or shared memory with the original. The type of the nodepool of the `src` and `dst` must be the same, otherwise no copying is done.
The affected src [NodePool] is modified with adjusted counts from the newly copied over nodes.
func DeleteByName ¶ added in v0.9.7
func DeleteNodeByName ¶ added in v0.9.7
func DeleteNodeByName( nodepools []*spec.NodePool, nodeName string, keepNodePools map[string]struct{}, ) []*spec.NodePool
DeleteNodeByName goes through each nodepool until it finds the node with the specified name. If the nodepool reaches 0 nodes the keepNodePools map is checked whether the nodepool should be removed or not.
func DeleteNodes ¶ added in v0.10.0
Deletes any matching `nodes` in the passed in `nodepool` If the passed in `nodes` contain all of the nodes of the `nodepool` then the nodepool will be modified to contain no nodes at all.
func DynamicGenerateKeys ¶
DynamicGenerateKeys creates private keys files for all nodes in the provided dynamic node pools in form of <node name>.pem.
func ExtractDynamic ¶
func ExtractDynamic(nodepools []*spec.NodePool) []*spec.DynamicNodePool
ExtractDynamic returns slice of dynamic node pools.
func ExtractRegions ¶
func ExtractRegions(nodepools []*spec.DynamicNodePool) []string
ExtractRegions will return a list of all regions used in list of nodepools
func FindApiEndpoint ¶
FindApiEndpoint searches for a nodepool that has the control node representing the Api endpoint of the cluster.
func FindByName ¶
FindByName returns the first Nodepool that will have same name as specified in parameters, nil otherwise.
func FindReferences ¶ added in v0.10.0
FindReferences return all nodepools that share the given name.
func FirstControlNode ¶
FirstControlNode returns the first control node encountered.
func HasNodePoolTypeOf ¶ added in v0.10.0
func IndexByName ¶ added in v0.10.0
IndexByName returns the position of the nodepool within the slice, if not found -1 is returned.
func IsAutoscaled ¶ added in v0.10.0
Returns true if the nodepool is autoscaled.
func MustExtractNameAndHash ¶
func PartialCopyWithNodeExclusion ¶ added in v0.10.0
Behaves exactly the same as PartialCopyWithNodeFilter just that the passed in nodes are excluded from ones in the nodepool if present.
func PartialCopyWithNodeFilter ¶ added in v0.10.0
For each node in the nodepool that is found inside the passed in nodes slice, returns a shallow copy of the nodepool, meaning that all of the memory is still shared among the original and returned nodepool, but will only have the filtered nodes.
**Caution** the Node Type itself is deep cloned as the node counts need to change to reflect the filered nodes.
func PartialCopyWithReplacedNodes ¶ added in v0.10.0
func PartialCopyWithReplacedNodes(np *spec.NodePool, nodes []*spec.Node, nodeKeys map[string]string) *spec.NodePool
All of the nodes in the nodepool are replaced with the passed in nodes slice. The function will create a shallow copy of the nodepool, meaning that all of the memory is still shared among the original and returned nodepool, but will only have the replaced nodes. If the nodes are static nodes it is expected that the passed in nodeKeys map will be filled with the required data.
**Caution** the node Type itself is deep cloned as the node counts need to change to reflect the filtered nodes.
func PublicEndpoints ¶ added in v0.10.0
Returns all Public Endpoints, for all of the nodes for the passed in nodepools.
func RandomDynamicNode ¶ added in v0.10.0
Returns a random dynamic node. Nil if there is none.
func RandomNodePublicEndpoint ¶ added in v0.10.0
Returns a random node public Endpoint, SSH key, and SSH port to connect to it. Empty strings if there is none.
func SSHPort ¶ added in v0.11.2
SSHPort returns the effective SSH port for a nodepool and normalizes the stored value in-place, replacing 0 with DefaultSSHPort.
Types ¶
type ProviderTemplateGroup ¶
type RegionNetwork ¶ added in v0.9.14
func ExtractRegionNetwork ¶ added in v0.9.14
func ExtractRegionNetwork(nodepools []*spec.DynamicNodePool) []RegionNetwork
ExtractRegionNetwork will return a unique list of all regions with networks used in list of nodepools