Documentation ¶
Index ¶
- Constants
- Variables
- type ClaudieCloudProvider
- func (c *ClaudieCloudProvider) Cleanup(_ context.Context, req *protos.CleanupRequest) (*protos.CleanupResponse, error)
- func (c *ClaudieCloudProvider) GPULabel(_ context.Context, req *protos.GPULabelRequest) (*protos.GPULabelResponse, error)
- func (c *ClaudieCloudProvider) GetAvailableGPUTypes(_ context.Context, req *protos.GetAvailableGPUTypesRequest) (*protos.GetAvailableGPUTypesResponse, error)
- func (c *ClaudieCloudProvider) NodeGroupDecreaseTargetSize(_ context.Context, req *protos.NodeGroupDecreaseTargetSizeRequest) (*protos.NodeGroupDecreaseTargetSizeResponse, error)
- func (c *ClaudieCloudProvider) NodeGroupDeleteNodes(ctx context.Context, req *protos.NodeGroupDeleteNodesRequest) (*protos.NodeGroupDeleteNodesResponse, error)
- func (c *ClaudieCloudProvider) NodeGroupForNode(_ context.Context, req *protos.NodeGroupForNodeRequest) (*protos.NodeGroupForNodeResponse, error)
- func (c *ClaudieCloudProvider) NodeGroupGetOptions(_ context.Context, req *protos.NodeGroupAutoscalingOptionsRequest) (*protos.NodeGroupAutoscalingOptionsResponse, error)
- func (c *ClaudieCloudProvider) NodeGroupIncreaseSize(ctx context.Context, req *protos.NodeGroupIncreaseSizeRequest) (*protos.NodeGroupIncreaseSizeResponse, error)
- func (c *ClaudieCloudProvider) NodeGroupNodes(_ context.Context, req *protos.NodeGroupNodesRequest) (*protos.NodeGroupNodesResponse, error)
- func (c *ClaudieCloudProvider) NodeGroupTargetSize(_ context.Context, req *protos.NodeGroupTargetSizeRequest) (*protos.NodeGroupTargetSizeResponse, error)
- func (c *ClaudieCloudProvider) NodeGroupTemplateNodeInfo(_ context.Context, req *protos.NodeGroupTemplateNodeInfoRequest) (*protos.NodeGroupTemplateNodeInfoResponse, error)
- func (c *ClaudieCloudProvider) NodeGroups(_ context.Context, req *protos.NodeGroupsRequest) (*protos.NodeGroupsResponse, error)
- func (c *ClaudieCloudProvider) PricingNodePrice(_ context.Context, req *protos.PricingNodePriceRequest) (*protos.PricingNodePriceResponse, error)
- func (c *ClaudieCloudProvider) PricingPodPrice(_ context.Context, req *protos.PricingPodPriceRequest) (*protos.PricingPodPriceResponse, error)
- func (c *ClaudieCloudProvider) Refresh(ctx context.Context, _ *protos.RefreshRequest) (*protos.RefreshResponse, error)
Constants ¶
const (
// Default GPU label.
GpuLabel = "claudie.io/gpu-node"
)
Variables ¶
var ( // ErrNotImplemented used for functions which are not implemented. ErrNotImplemented = errors.New("not implemented") // ErrConfigInDeletion returned when the desired state of the config is nil and cannot perform a refresh operation. ErrConfigInDeletion = errors.New("config is marked for deletion") )
Functions ¶
This section is empty.
Types ¶
type ClaudieCloudProvider ¶
type ClaudieCloudProvider struct { protos.UnimplementedCloudProviderServer // contains filtered or unexported fields }
func NewClaudieCloudProvider ¶
func NewClaudieCloudProvider(ctx context.Context, projectName, clusterName string) *ClaudieCloudProvider
NewClaudieCloudProvider returns a ClaudieCloudProvider with initialized caches.
func (*ClaudieCloudProvider) Cleanup ¶
func (c *ClaudieCloudProvider) Cleanup(_ context.Context, req *protos.CleanupRequest) (*protos.CleanupResponse, error)
Cleanup cleans up open resources before the cloud provider is destroyed, i.e. go routines etc.
func (*ClaudieCloudProvider) GPULabel ¶
func (c *ClaudieCloudProvider) GPULabel(_ context.Context, req *protos.GPULabelRequest) (*protos.GPULabelResponse, error)
GPULabel returns the label added to nodes with GPU resource.
func (*ClaudieCloudProvider) GetAvailableGPUTypes ¶
func (c *ClaudieCloudProvider) GetAvailableGPUTypes(_ context.Context, req *protos.GetAvailableGPUTypesRequest) (*protos.GetAvailableGPUTypesResponse, error)
GetAvailableGPUTypes return all available GPU types cloud provider supports.
func (*ClaudieCloudProvider) NodeGroupDecreaseTargetSize ¶
func (c *ClaudieCloudProvider) NodeGroupDecreaseTargetSize(_ context.Context, req *protos.NodeGroupDecreaseTargetSizeRequest) (*protos.NodeGroupDecreaseTargetSizeResponse, error)
NodeGroupDecreaseTargetSize decreases the target size of the node group. This function doesn't permit to delete any existing node and can be used only to reduce the request for new nodes that have not been yet fulfilled. Delta should be negative. It is assumed that cloud provider will not delete the existing nodes if the size when there is an option to just decrease the target.
func (*ClaudieCloudProvider) NodeGroupDeleteNodes ¶
func (c *ClaudieCloudProvider) NodeGroupDeleteNodes(ctx context.Context, req *protos.NodeGroupDeleteNodesRequest) (*protos.NodeGroupDeleteNodesResponse, error)
NodeGroupDeleteNodes deletes nodes from this node group (and also decreasing the size of the node group with that). Error is returned either on failure or if the given node doesn't belong to this node group. This function should wait until node group size is updated.
func (*ClaudieCloudProvider) NodeGroupForNode ¶
func (c *ClaudieCloudProvider) NodeGroupForNode(_ context.Context, req *protos.NodeGroupForNodeRequest) (*protos.NodeGroupForNodeResponse, error)
NodeGroupForNode returns the node group for the given node. The node group id is an empty string if the node should not be processed by cluster autoscaler.
func (*ClaudieCloudProvider) NodeGroupGetOptions ¶
func (c *ClaudieCloudProvider) NodeGroupGetOptions(_ context.Context, req *protos.NodeGroupAutoscalingOptionsRequest) (*protos.NodeGroupAutoscalingOptionsResponse, error)
NodeGroupGetOptions returns NodeGroupAutoscalingOptions that should be used for this particular NodeGroup. Returning a grpc error will result in using default options. Implementation optional
func (*ClaudieCloudProvider) NodeGroupIncreaseSize ¶
func (c *ClaudieCloudProvider) NodeGroupIncreaseSize(ctx context.Context, req *protos.NodeGroupIncreaseSizeRequest) (*protos.NodeGroupIncreaseSizeResponse, error)
NodeGroupIncreaseSize increases the size of the node group. To delete a node you need to explicitly name it and use NodeGroupDeleteNodes. This function should wait until node group size is updated.
func (*ClaudieCloudProvider) NodeGroupNodes ¶
func (c *ClaudieCloudProvider) NodeGroupNodes(_ context.Context, req *protos.NodeGroupNodesRequest) (*protos.NodeGroupNodesResponse, error)
NodeGroupNodes returns a list of all nodes that belong to this node group.
func (*ClaudieCloudProvider) NodeGroupTargetSize ¶
func (c *ClaudieCloudProvider) NodeGroupTargetSize(_ context.Context, req *protos.NodeGroupTargetSizeRequest) (*protos.NodeGroupTargetSizeResponse, error)
NodeGroupTargetSize returns the current target size of the node group. It is possible that the number of nodes in Kubernetes is different at the moment but should be equal to the size of a node group once everything stabilizes (new nodes finish startup and registration or removed nodes are deleted completely).
func (*ClaudieCloudProvider) NodeGroupTemplateNodeInfo ¶
func (c *ClaudieCloudProvider) NodeGroupTemplateNodeInfo(_ context.Context, req *protos.NodeGroupTemplateNodeInfoRequest) (*protos.NodeGroupTemplateNodeInfoResponse, error)
NodeGroupTemplateNodeInfo returns a structure of an empty (as if just started) node, with all of the labels, capacity and allocatable information. This will be used in scale-up simulations to predict what would a new node look like if a node group was expanded. Implementation optional.
func (*ClaudieCloudProvider) NodeGroups ¶
func (c *ClaudieCloudProvider) NodeGroups(_ context.Context, req *protos.NodeGroupsRequest) (*protos.NodeGroupsResponse, error)
NodeGroups returns all node groups configured for this cloud provider.
func (*ClaudieCloudProvider) PricingNodePrice ¶
func (c *ClaudieCloudProvider) PricingNodePrice(_ context.Context, req *protos.PricingNodePriceRequest) (*protos.PricingNodePriceResponse, error)
PricingNodePrice returns a theoretical minimum price of running a node for a given period of time on a perfectly matching machine. Implementation optional.
func (*ClaudieCloudProvider) PricingPodPrice ¶
func (c *ClaudieCloudProvider) PricingPodPrice(_ context.Context, req *protos.PricingPodPriceRequest) (*protos.PricingPodPriceResponse, error)
PricingPodPrice returns a theoretical minimum price of running a pod for a given period of time on a perfectly matching machine. Implementation optional.
func (*ClaudieCloudProvider) Refresh ¶
func (c *ClaudieCloudProvider) Refresh(ctx context.Context, _ *protos.RefreshRequest) (*protos.RefreshResponse, error)
Refresh is called before every main loop and can be used to dynamically update cloud provider state.