Documentation ¶
Index ¶
- func ValidateCRI(c CRI) error
- func ValidateCluster(clusterName string, clusterConfig Kubernetes, nodePools []NodePool, ...) error
- func ValidateClusterName(name string) error
- func ValidateExtensions(e *Extensions) error
- func ValidateHibernation(h *Hibernation) error
- func ValidateMaintenance(m *Maintenance) error
- func ValidateNodePool(np NodePool) error
- func ValidateTaint(t Taint) error
- type ArgusExtension
- type CRI
- type Cluster
- type ClusterList
- type Credentials
- type Extensions
- type Hibernation
- type HibernationScedule
- type Kubernetes
- type KubernetesClusterService
- func (svc *KubernetesClusterService) CreateOrUpdate(ctx context.Context, projectID string, clusterName string, ...) (res Cluster, w *wait.Handler, err error)
- func (svc *KubernetesClusterService) Delete(ctx context.Context, projectID, clusterName string) (w *wait.Handler, err error)
- func (svc *KubernetesClusterService) Get(ctx context.Context, projectID, clusterName string) (res Cluster, err error)
- func (svc *KubernetesClusterService) GetCredential(ctx context.Context, projectID, clusterName string) (res Credentials, err error)
- func (svc *KubernetesClusterService) Hibernate(ctx context.Context, projectID, clusterName string) (res Cluster, err error)
- func (svc *KubernetesClusterService) List(ctx context.Context, projectID string) (res ClusterList, err error)
- func (svc *KubernetesClusterService) Maintenance(ctx context.Context, projectID, clusterName string) (res Cluster, err error)
- func (svc *KubernetesClusterService) Reconcile(ctx context.Context, projectID, clusterName string) (res Cluster, err error)
- func (svc *KubernetesClusterService) RotateCredentials(ctx context.Context, projectID, clusterName string) (err error)
- func (svc *KubernetesClusterService) Wakeup(ctx context.Context, projectID, clusterName string) (res Cluster, err error)
- type Machine
- type MachineImage
- type Maintenance
- type MaintenanceAutoUpdate
- type MaintenanceTimeWindow
- type NodePool
- type Status
- type Taint
- type Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateCluster ¶
func ValidateCluster( clusterName string, clusterConfig Kubernetes, nodePools []NodePool, maintenance *Maintenance, hibernation *Hibernation, extensions *Extensions, ) error
ValidateCluster validates the given cluster data (dry validation)
func ValidateClusterName ¶
ValidateClusterName validates a given cluster name
func ValidateExtensions ¶
func ValidateExtensions(e *Extensions) error
ValidateExtensions validates a given cluster extensions
func ValidateHibernation ¶
func ValidateHibernation(h *Hibernation) error
ValidateHibernation validates a given cluster hibernation
func ValidateMaintenance ¶
func ValidateMaintenance(m *Maintenance) error
ValidateMaintenance validates a given cluster maintenance
func ValidateNodePool ¶
ValidateNodePool validates a given node pool
func ValidateTaint ¶
ValidateTaint validates a given node pool taint
Types ¶
type ArgusExtension ¶
type ArgusExtension struct { Enabled bool `json:"enabled"` ArgusInstanceID string `json:"argusInstanceId"` }
ArgusExtension is Argus extension
type CRI ¶
type CRI struct {
Name string `json:"name"`
}
CRI is the container runtime interface of the node pool
type Cluster ¶
type Cluster struct { Name string `json:"name"` // 11 lowercase letters, numbers, or hyphens Kubernetes Kubernetes `json:"kubernetes"` Nodepools []NodePool `json:"nodepools"` Maintenance *Maintenance `json:"maintenance,omitempty"` Hibernation *Hibernation `json:"hibernation,omitempty"` Extensions *Extensions `json:"extensions,omitempty"` Status *Status `json:"status,omitempty"` }
Cluster is a struct representation of a cluster in STACKIT api
type ClusterList ¶ added in v0.1.1
type ClusterList struct {
Items []Cluster `json:"items"`
}
ClusterList is the response for listing clusters
type Credentials ¶
type Credentials struct { Server string `json:"server"` Kubeconfig string `json:"kubeconfig"` CertificateAuthorityData string `json:"certificateAuthorityData"` Token string `json:"token"` }
Credentials is the struct response for cluster credentils
type Extensions ¶
type Extensions struct {
Argus *ArgusExtension `json:"argus,omitempty"`
}
Extensions represent SKE extensions
type Hibernation ¶
type Hibernation struct {
Schedules []HibernationScedule `json:"schedules"`
}
Hibernation schedule
type HibernationScedule ¶
type HibernationScedule struct { Start string `json:"start"` End string `json:"end"` Timezone string `json:"timezone"` }
HibernationScedule is the schedule for hibernation
type Kubernetes ¶
type Kubernetes struct { Version string `json:"version"` AllowPrivilegedContainers bool `json:"allowPrivilegedContainers"` }
Kubernetes contains the cluster's kubernetes config
type KubernetesClusterService ¶
KubernetesClusterService is the service that handles CRUD functionality for SKE clusters
func New ¶
func New(c common.Client) *KubernetesClusterService
New returns a new handler for the service
func (*KubernetesClusterService) CreateOrUpdate ¶ added in v0.4.0
func (svc *KubernetesClusterService) CreateOrUpdate( ctx context.Context, projectID string, clusterName string, clusterConfig Kubernetes, nodePools []NodePool, maintenance *Maintenance, hibernation *Hibernation, extensions *Extensions, ) (res Cluster, w *wait.Handler, err error)
CreateOrUpdate creates or updates a SKE cluster See also https://api.stackit.schwarz/ske-service/openapi.v1.html#operation/SkeService_CreateOrUpdateCluster The function also returns a wait functionality in case there's no error trigger wait by running `.Wait()` which returns the cluster information (clusters.Cluster struct)
func (*KubernetesClusterService) Delete ¶
func (svc *KubernetesClusterService) Delete(ctx context.Context, projectID, clusterName string) (w *wait.Handler, err error)
Delete deletes a SKE cluster See also https://api.stackit.schwarz/ske-service/openapi.v1.html#operation/SkeService_DeleteCluster Wait for deletion to complete by running the returned wait functionality `wait.Wait()`
func (*KubernetesClusterService) Get ¶
func (svc *KubernetesClusterService) Get(ctx context.Context, projectID, clusterName string) (res Cluster, err error)
Get returns the a cluster by project ID and cluster name See also https://api.stackit.schwarz/ske-service/openapi.v1.html#operation/SkeService_ListClusters
func (*KubernetesClusterService) GetCredential ¶
func (svc *KubernetesClusterService) GetCredential(ctx context.Context, projectID, clusterName string) (res Credentials, err error)
GetCredential returns the a credentials for the cluster See also https://api.stackit.schwarz/ske-service/openapi.v1.html#tag/Credentials
func (*KubernetesClusterService) Hibernate ¶
func (svc *KubernetesClusterService) Hibernate(ctx context.Context, projectID, clusterName string) (res Cluster, err error)
Hibernate triggers cluster hibernation See also https://api.stackit.schwarz/ske-service/openapi.v1.html#operation/SkeService_TriggerClusterHibernation
func (*KubernetesClusterService) List ¶
func (svc *KubernetesClusterService) List(ctx context.Context, projectID string) (res ClusterList, err error)
List returns the clusters in the project See also https://api.stackit.schwarz/ske-service/openapi.v1.html#operation/SkeService_ListClusters
func (*KubernetesClusterService) Maintenance ¶
func (svc *KubernetesClusterService) Maintenance(ctx context.Context, projectID, clusterName string) (res Cluster, err error)
Maintenance triggers cluster maintenance See also https://api.stackit.schwarz/ske-service/openapi.v1.html#operation/SkeService_TriggerClusterMaintenance
func (*KubernetesClusterService) Reconcile ¶
func (svc *KubernetesClusterService) Reconcile(ctx context.Context, projectID, clusterName string) (res Cluster, err error)
Reconcile triggers cluster reconciliation See also https://api.stackit.schwarz/ske-service/openapi.v1.html#operation/SkeService_TriggerClusterReconciliation
func (*KubernetesClusterService) RotateCredentials ¶
func (svc *KubernetesClusterService) RotateCredentials(ctx context.Context, projectID, clusterName string) (err error)
RotateCredentials triggers cluster credentials rotation See also https://api.stackit.schwarz/ske-service/openapi.v1.html#operation/SkeService_TriggerClusterCredentialRotation
func (*KubernetesClusterService) Wakeup ¶
func (svc *KubernetesClusterService) Wakeup(ctx context.Context, projectID, clusterName string) (res Cluster, err error)
Wakeup triggers cluster wakeup See also https://api.stackit.schwarz/ske-service/openapi.v1.html#operation/SkeService_TriggerClusterWakeup
type Machine ¶
type Machine struct { Type string `json:"type"` Image MachineImage `json:"image"` }
Machine contains information of the machine in the node pool
type MachineImage ¶
MachineImage contains information of the machine's image
type Maintenance ¶
type Maintenance struct { AutoUpdate MaintenanceAutoUpdate `json:"autoUpdate"` TimeWindow MaintenanceTimeWindow `json:"timeWindow"` }
Maintenance is the node pool's maintenance window
type MaintenanceAutoUpdate ¶
type MaintenanceAutoUpdate struct { KubernetesVersion bool `json:"kubernetesVersion"` MachineImageVersion bool `json:"machineImageVersion"` }
MaintenanceAutoUpdate is the auto update confguration
type MaintenanceTimeWindow ¶
MaintenanceTimeWindow is when the maintenance window should happen
type NodePool ¶
type NodePool struct { Name string `json:"name,omitempty"` Machine Machine `json:"machine"` Minimum int `json:"minimum"` Maximum int `json:"maximum"` MaxSurge int `json:"maxSurge"` Volume Volume `json:"volume"` Labels map[string]string `json:"labels"` Taints []Taint `json:"taints"` CRI CRI `json:"cri"` AvailabilityZones []string `json:"availabilityZones"` }
NodePool is a struct representing a node pool in the cluster
type Status ¶
type Status struct { Hibernated bool `json:"hibernated"` Aggregated string `json:"aggregated"` Error struct { Code string `json:"code"` Message string `json:"message"` Details string `json:"details"` } `json:"error,omitempty"` }
Status is the cluster status