nodepools

package
v0.9.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, clusterId, nodepoolId string) error

Delete will permanently delete a particular node pool based on its unique ID and cluster ID.

Types

type AutoscalingSpec

type AutoscalingSpec struct {
	// Whether to enable auto scaling
	Enable bool `json:"enable"`
	// Minimum number of nodes allowed if auto scaling is enabled
	MinNodeCount int `json:"minNodeCount"`
	// This value must be greater than or equal to the value of minNodeCount
	MaxNodeCount int `json:"maxNodeCount"`
	// Interval between two scaling operations, in minutes
	ScaleDownCooldownTime int `json:"scaleDownCooldownTime"`
	// Weight of a node pool
	Priority int `json:"priority"`
}

type CreateMetaData

type CreateMetaData struct {
	// Name of the node pool.
	Name string `json:"name" required:"true"`
}

CreateMetaData required to create a Node Pool

type CreateOpts

type CreateOpts struct {
	// API type, fixed value Node
	Kind string `json:"kind" required:"true"`
	// API version, fixed value v3
	ApiVersion string `json:"apiversion" required:"true"`
	// Metadata required to create a Node Pool
	Metadata CreateMetaData `json:"metadata" required:"true"`
	// specifications to create a Node Pool
	Spec CreateSpec `json:"spec" required:"true"`
}

CreateOpts allows extensions to add additional parameters to the Create request.

type CreateSpec

type CreateSpec struct {
	// Node pool type. Currently, only `vm`(ECSs) are supported.
	Type string `json:"type" required:"true"`
	// Node template
	NodeTemplate nodes.Spec `json:"nodeTemplate" required:"true"`
	// Initial number of expected nodes
	InitialNodeCount int `json:"initialNodeCount"`
	// Auto scaling parameters
	Autoscaling AutoscalingSpec `json:"autoscaling,omitempty"`
	// Node management parameters
	NodeManagement NodeManagementSpec `json:"nodeManagement,omitempty"`
	// Custom security group settings for a node pool
	CustomSecurityGroupIds []string `json:"customSecurityGroups,omitempty"`
}

CreateSpec describes Node pools specification

type ListNodePool

type ListNodePool struct {
	// API type, fixed value "List"
	Kind string `json:"kind"`
	// API version, fixed value "v3"
	Apiversion string `json:"apiVersion"`
	// all Node Pools
	NodePools []NodePool `json:"items"`
}

ListNodePool - Describes the Node Pool Structure of cluster

type ListOpts

type ListOpts struct {
	Name  string `json:"name"`
	Uid   string `json:"uid"`
	Phase string `json:"phase"`
}

ListOpts allows the filtering of list data using given parameters.

type Metadata

type Metadata struct {
	// Node Pool name
	Name string `json:"name"`
	// Node Pool ID
	Id string `json:"uid"`
}

Metadata of the node pool

type NodeManagementSpec

type NodeManagementSpec struct {
	// ECS group ID
	ServerGroupReference string `json:"serverGroupReference"`
}

type NodePool

type NodePool struct {
	// Node pool type
	Type string `json:"type" required:"true"`
	//  API type, fixed value " Host "
	Kind string `json:"kind"`
	// API version, fixed value v3
	Apiversion string `json:"apiVersion"`
	// Node Pool metadata
	Metadata Metadata `json:"metadata"`
	// Node Pool detailed parameters
	Spec Spec `json:"spec"`
	// Node Pool status information
	Status Status `json:"status"`
}

NodePool - Individual node pools of the cluster

func Create

func Create(client *golangsdk.ServiceClient, clusterId string, opts CreateOpts) (*NodePool, error)

Create accepts a CreateOpts struct and uses the values to create a new logical node pool.

func FilterNodePools

func FilterNodePools(nodepools []NodePool, opts ListOpts) []NodePool

FilterNodes filters a list of Nodes based on the given ListOpts.

func Get

func Get(client *golangsdk.ServiceClient, clusterId, nodepoolId string) (*NodePool, error)

Get retrieves a particular node pool based on its unique ID and cluster ID.

func List

func List(client *golangsdk.ServiceClient, clusterID string, opts ListOpts) ([]NodePool, error)

List returns collection of node pools.

func Update

func Update(client *golangsdk.ServiceClient, clusterId, nodepoolId string, opts UpdateOpts) (*NodePool, error)

Update allows node pools to be updated.

type Spec

type Spec struct {
	// Node type. Currently, only VM nodes are supported.
	Type string `json:"type" required:"true"`
	// Node Pool template
	NodeTemplate nodes.Spec `json:"nodeTemplate" required:"true"`
	// Initial number of expected node pools
	InitialNodeCount int `json:"initialNodeCount" required:"true"`
	// Auto scaling parameters
	Autoscaling AutoscalingSpec `json:"autoscaling"`
	// Node pool management parameters
	NodeManagement NodeManagementSpec `json:"nodeManagement"`
	// Custom security group settings for a node pool
	CustomSecurityGroupIds []string `json:"customSecurityGroups,omitempty"`
}

Spec describes Node pools specification

type Status

type Status struct {
	// The state of the node pool
	Phase string `json:"phase"`
	// Number of nodes in the node pool
	CurrentNode int `json:"currentNode"`
}

Status - Gives the current status of the node pool

type UpdateAutoscalingSpec added in v0.9.4

type UpdateAutoscalingSpec struct {
	// Whether to enable auto scaling
	Enable bool `json:"enable,omitempty"`
	// Minimum number of nodes allowed if auto scaling is enabled
	MinNodeCount int `json:"minNodeCount,omitempty"`
	// This value must be greater than or equal to the value of minNodeCount
	MaxNodeCount int `json:"maxNodeCount,omitempty"`
	// Interval between two scaling operations, in minutes
	ScaleDownCooldownTime int `json:"scaleDownCooldownTime,omitempty"`
	// Weight of a node pool
	Priority int `json:"priority,omitempty"`
}

type UpdateMetaData

type UpdateMetaData struct {
	// Name of the node pool.
	Name string `json:"name" required:"true"`
}

UpdateMetaData required to update a Node Pool

type UpdateNodeTemplate added in v0.2.7

type UpdateNodeTemplate struct {
	// Tag of a Kubernetes node, key value pair format
	K8sTags map[string]string `json:"k8sTags,omitempty"`
	// taints to created nodes to configure anti-affinity
	Taints []nodes.TaintSpec `json:"taints,omitempty"`
}

type UpdateOpts

type UpdateOpts struct {
	// Metadata required to update a Node Pool
	Metadata UpdateMetaData `json:"metadata" required:"true"`
	// specifications to update a Node Pool
	Spec UpdateSpec `json:"spec,omitempty" required:"true"`
}

UpdateOpts contains all the values needed to update a new node pool

type UpdateSpec

type UpdateSpec struct {
	// Node template
	NodeTemplate UpdateNodeTemplate `json:"nodeTemplate" required:"true"`
	// Initial number of expected nodes
	InitialNodeCount int `json:"initialNodeCount" required:"true"`
	// Auto scaling parameters
	Autoscaling UpdateAutoscalingSpec `json:"autoscaling,omitempty"`
}

UpdateSpec describes Node pools update specification

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL