virtualcluster

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNodepool

func CreateNodepool(ctx context.Context, kubeCfgPath string, nodepoolName string, opts ...NodepoolOpt) (retErr error)

CreateNodepool creates a new node pool.

TODO: 1. create a new package to define ErrNotFound, ErrAlreadyExists, ... errors. 2. support configurable timeout.

FIXME:

Some cloud providers will delete unknown or not-ready nodes. If we render both nodes and controllers in one helm release, helm won't wait for controller ready before creating nodes. The nodes will be deleted by cloud providers. The helm's post-install or post-upgrade hook can ensure that it won't deploy nodes until controllers ready. However, resources created by helm hook aren't part of helm release. We need extra step to cleanup nodes resources when we delete nodepool's helm release. Based on this fact, we separate one helm release into two. One is for controllers and other one is for nodes.

However, it's not a guarantee. When controller was deleted and it takes long time to restart, the node will be marked NotReady and deleted by cloud providers. Maybe we can consider to contribute to difference cloud providers with workaround. For example, if node.Spec.ProviderID contains `?ignore=virtual`, the cloud providers should ignore this kind of nodes.

func DeleteNodepool added in v0.0.2

func DeleteNodepool(_ context.Context, kubeconfigPath string, nodepoolName string) error

DeleteNodepool deletes a node pool with a given name.

func ListNodepools added in v0.0.2

func ListNodepools(_ context.Context, kubeconfigPath string) ([]*release.Release, error)

ListNodeppol lists nodepools added by the vc nodeppool add command.

Types

type NodepoolOpt

type NodepoolOpt func(*nodepoolConfig)

NodepoolOpt is used to update default node pool's setting.

func WithNodepoolCPUOpt

func WithNodepoolCPUOpt(cpu int) NodepoolOpt

WithNodepoolCPUOpt updates CPU resource.

func WithNodepoolCountOpt

func WithNodepoolCountOpt(count int) NodepoolOpt

WithNodepoolCountOpt updates node count.

func WithNodepoolLabelsOpt

func WithNodepoolLabelsOpt(labels map[string]string) NodepoolOpt

WithNodepoolLabelsOpt updates node's labels.

func WithNodepoolMaxPodsOpt added in v0.0.2

func WithNodepoolMaxPodsOpt(maxPods int) NodepoolOpt

WithNodepoolMaxPodsOpt updates max pods.

func WithNodepoolMemoryOpt

func WithNodepoolMemoryOpt(memory int) NodepoolOpt

WithNodepoolMemoryOpt updates Memory resource.

func WithNodepoolNodeControllerAffinity

func WithNodepoolNodeControllerAffinity(nodeSelectors map[string][]string) NodepoolOpt

WithNodepoolNodeControllerAffinity forces virtual node's controller to nodes with that specific labels.

func WithNodepoolSharedProviderID added in v0.0.7

func WithNodepoolSharedProviderID(providerID string) NodepoolOpt

WithNodepoolSharedProviderID forces virtual nodes to share unique providerID.

Jump to

Keyboard shortcuts

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