Documentation
¶
Index ¶
- Constants
- func NewRestyClient(url, key, ca string, level logrus.Level, ...) (*resty.Client, error)
- type AckClusterActionRequest
- type ActionChartRollback
- type ActionChartUninstall
- type ActionChartUpsert
- type ActionCheckNodeDeleted
- type ActionCheckNodeStatus
- type ActionCheckNodeStatus_Status
- type ActionCreate
- type ActionCreateEvent
- type ActionDelete
- type ActionDeleteNode
- type ActionDisconnectCluster
- type ActionDrainNode
- type ActionEvictPod
- type ActionPatch
- type ActionPatchNode
- type CastAIClient
- type ChartSource
- type Client
- type ClusterAction
- type GetClusterActionsResponse
- type GroupVersionResource
- type LogEntry
- type LogEvent
- type NodeTaint
- type ObjectID
Constants ¶
View Source
const ( LabelNodeID = "provisioner.cast.ai/node-id" LabelManagedBy = "provisioner.cast.ai/managed-by" LabelValueManagedByCASTAI = "cast.ai" // UnknownActionType is returned by ClusterAction.GetType when the action is not recognized. UnknownActionType = "Unknown" )
Variables ¶
This section is empty.
Functions ¶
func NewRestyClient ¶
func NewRestyClient(url, key, ca string, level logrus.Level, binVersion *config.ClusterControllerVersion, defaultTimeout time.Duration) (*resty.Client, error)
NewRestyClient configures a default instance of the resty.Client used to do HTTP requests.
Types ¶
type AckClusterActionRequest ¶
type AckClusterActionRequest struct {
Error *string `json:"error"`
}
type ActionChartRollback ¶
type ActionChartUninstall ¶
type ActionChartUpsert ¶
type ActionChartUpsert struct {
Namespace string `json:"namespace"`
ReleaseName string `json:"releaseName"`
ValuesOverrides map[string]string `json:"valuesOverrides,omitempty"`
ChartSource ChartSource `json:"chartSource"`
CreateNamespace bool `json:"createNamespace"`
ResetThenReuseValues bool `json:"resetThenReuseValues,omitempty"`
}
type ActionCheckNodeDeleted ¶
type ActionCheckNodeStatus ¶
type ActionCheckNodeStatus struct {
NodeName string `json:"nodeName"`
NodeID string `json:"nodeId"`
NodeStatus ActionCheckNodeStatus_Status `json:"nodeStatus,omitempty"`
WaitTimeoutSeconds *int32 `json:"waitTimeoutSeconds,omitempty"`
}
type ActionCheckNodeStatus_Status ¶
type ActionCheckNodeStatus_Status string
const ( ActionCheckNodeStatus_READY ActionCheckNodeStatus_Status = "NodeStatus_READY" ActionCheckNodeStatus_DELETED ActionCheckNodeStatus_Status = "NodeStatus_DELETED" )
type ActionCreate ¶
type ActionCreate struct {
GroupVersionResource `json:",inline"`
Object map[string]interface{} `json:"object,omitempty"`
}
type ActionCreateEvent ¶
type ActionDelete ¶
type ActionDelete struct {
ID ObjectID `json:"id"`
}
type ActionDeleteNode ¶
type ActionDisconnectCluster ¶
type ActionDisconnectCluster struct{}
type ActionDrainNode ¶
type ActionEvictPod ¶
type ActionPatch ¶
type ActionPatchNode ¶
type ActionPatchNode struct {
NodeName string `json:"nodeName"`
NodeID string `json:"nodeId"`
Labels map[string]string `json:"labels"`
Taints []NodeTaint `json:"taints"`
Annotations map[string]string `json:"annotations"`
Unschedulable *bool `json:"unschedulable"`
// Capacity allows advertising extended resources for a Node.
// More info: https://kubernetes.io/docs/tasks/administer-cluster/extended-resource-node/
Capacity v1.ResourceList `json:"capacity"`
}
type CastAIClient ¶
type CastAIClient interface {
GetActions(ctx context.Context, k8sVersion string) ([]*ClusterAction, error)
AckAction(ctx context.Context, actionID string, req *AckClusterActionRequest) error
SendLog(ctx context.Context, e *LogEntry) error
}
CastAIClient lists functions used by actions package.
type ChartSource ¶
type ChartSource struct {
RepoURL string `json:"repoUrl"`
Name string `json:"name"`
Version string `json:"version"`
}
func (*ChartSource) Validate ¶
func (c *ChartSource) Validate() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to Cast AI. It can poll and acknowledge actions and also inject logs.
func (*Client) GetActions ¶
type ClusterAction ¶
type ClusterAction struct {
ID string `json:"id"`
ActionDeleteNode *ActionDeleteNode `json:"actionDeleteNode,omitempty"`
ActionDrainNode *ActionDrainNode `json:"actionDrainNode,omitempty"`
ActionPatchNode *ActionPatchNode `json:"actionPatchNode,omitempty"`
ActionCreateEvent *ActionCreateEvent `json:"actionCreateEvent,omitempty"`
ActionChartUpsert *ActionChartUpsert `json:"actionChartUpsert,omitempty"`
ActionChartUninstall *ActionChartUninstall `json:"actionChartUninstall,omitempty"`
ActionChartRollback *ActionChartRollback `json:"actionChartRollback,omitempty"`
ActionDisconnectCluster *ActionDisconnectCluster `json:"actionDisconnectCluster,omitempty"`
ActionCheckNodeDeleted *ActionCheckNodeDeleted `json:"actionCheckNodeDeleted,omitempty"`
ActionCheckNodeStatus *ActionCheckNodeStatus `json:"actionCheckNodeStatus,omitempty"`
ActionEvictPod *ActionEvictPod `json:"actionEvictPod,omitempty"`
ActionPatch *ActionPatch `json:"actionPatch,omitempty"`
ActionCreate *ActionCreate `json:"actionCreate,omitempty"`
ActionDelete *ActionDelete `json:"actionDelete,omitempty"`
CreatedAt time.Time `json:"createdAt"`
DoneAt *time.Time `json:"doneAt,omitempty"`
Error *string `json:"error,omitempty"`
}
func (*ClusterAction) Data ¶
func (c *ClusterAction) Data() interface{}
func (*ClusterAction) GetType ¶
func (c *ClusterAction) GetType() string
GetType tries to deduct the type of the action based on its data. In case this fails, UnknownActionType is returned.
func (*ClusterAction) IsValid ¶
func (c *ClusterAction) IsValid() bool
IsValid checks if the action is OK to use. If this value is nil, most likely current version of cluster controller does not know about the action type and cannot execute it. It can also be a case of invalid data from server, but we cannot distinguish between the two at the moment.
type GetClusterActionsResponse ¶
type GetClusterActionsResponse struct {
Items []*ClusterAction `json:"items"`
}
type GroupVersionResource ¶
type GroupVersionResource struct {
Group string `json:"group"`
Version string `json:"version"`
Resource string `json:"resource"`
}
func (GroupVersionResource) String ¶
func (r GroupVersionResource) String() string
type ObjectID ¶
type ObjectID struct {
GroupVersionResource `json:",inline"`
Namespace *string `json:"namespace"`
Name string `json:"name"`
}
Click to show internal directories.
Click to hide internal directories.