Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Create(ctx context.Context, organizationID, projectID string, ...) (*openapi.ComputeClusterRead, error)
- func (c *Client) Delete(ctx context.Context, organizationID, projectID, clusterID string) error
- func (c *Client) Evict(ctx context.Context, organizationID, projectID, clusterID string, ...) error
- func (c *Client) Get(ctx context.Context, organizationID, projectID, clusterID string) (*openapi.ComputeClusterRead, error)
- func (c *Client) HardRebootMachine(ctx context.Context, organizationID, projectID, clusterID, machineID string) error
- func (c *Client) List(ctx context.Context, organizationID string, ...) (openapi.ComputeClusters, error)
- func (c *Client) SoftRebootMachine(ctx context.Context, organizationID, projectID, clusterID, machineID string) error
- func (c *Client) StartMachine(ctx context.Context, organizationID, projectID, clusterID, machineID string) error
- func (c *Client) StopMachine(ctx context.Context, organizationID, projectID, clusterID, machineID string) error
- func (c *Client) Update(ctx context.Context, organizationID, projectID, clusterID string, ...) error
- type Options
Constants ¶
This section is empty.
Variables ¶
var (
ErrConsistency = goerrors.New("consistency error")
)
var (
ErrResourceLookup = goerrors.New("could not find the requested resource")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps up cluster related management handling.
func NewClient ¶
func NewClient(client client.Client, namespace string, options *Options, identity *identity.Client, region *region.Client) *Client
NewClient returns a new client with required parameters.
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, organizationID, projectID string, request *openapi.ComputeClusterWrite) (*openapi.ComputeClusterRead, error)
Create creates the implicit cluster indentified by the JTW claims.
func (*Client) Evict ¶ added in v1.6.0
func (c *Client) Evict(ctx context.Context, organizationID, projectID, clusterID string, request *openapi.EvictionWrite) error
Evict is pretty complicated, we need to delete the requested servers from the region service, and update the cluster's pools to remove those instances so they don't just get recreated instantly, and also update the quota allocations. Now, if you naively deleted the servers, that would trigger a reconcile and a potential replacement before we've had a chance to update the cluster. If you updated the cluster then you've got yourself a problem where we have no control over what's deleted. So what we do is... Pause cluster reconciliation, kill the requested servers, update the allocations, update the cluster and unpause it. Ideally everything would be a nice atomic transaction, but you cannot do that with Kubernetes...
func (*Client) HardRebootMachine ¶ added in v1.7.0
func (*Client) List ¶
func (c *Client) List(ctx context.Context, organizationID string, params openapi.GetApiV1OrganizationsOrganizationIDClustersParams) (openapi.ComputeClusters, error)
List returns all clusters owned by the implicit control plane.