|
| 1 | +package v1 |
| 2 | + |
| 3 | +import "context" |
| 4 | + |
| 5 | +type Cluster struct { |
| 6 | + // The name of the cluster, displayed on clients. |
| 7 | + Name string |
| 8 | + |
| 9 | + // The unique ID used to associate with this cluster. |
| 10 | + RefID string |
| 11 | + |
| 12 | + // The ID assigned by the cloud provider to the cluster. |
| 13 | + CloudID string |
| 14 | + |
| 15 | + // The cloud provider that manages the cluster. |
| 16 | + Provider string |
| 17 | + |
| 18 | + // The cloud that hosts the cluster. |
| 19 | + Cloud string |
| 20 | + |
| 21 | + // The location of the cluster. |
| 22 | + Location string |
| 23 | + |
| 24 | + // The ID of the VPC that the cluster is associated with. |
| 25 | + VPCID string |
| 26 | + |
| 27 | + // The subnet IDs that the cluster's nodes are deployed into. |
| 28 | + SubnetIDs []string |
| 29 | + |
| 30 | + // The version of Kubernetes that the cluster is running. |
| 31 | + KubernetesVersion string |
| 32 | + |
| 33 | + // The status of the cluster. |
| 34 | + Status ClusterStatus |
| 35 | + |
| 36 | + // The node groups associated with the cluster. |
| 37 | + NodeGroups []NodeGroup |
| 38 | +} |
| 39 | + |
| 40 | +type NodeGroup struct { |
| 41 | + // The name of the node group, displayed on clients. |
| 42 | + Name string |
| 43 | + |
| 44 | + // The unique ID used to associate with this node group. |
| 45 | + RefID string |
| 46 | + // The minimum number of nodes in the node group. |
| 47 | + MinNodeCount int |
| 48 | + |
| 49 | + // The maximum number of nodes in the node group. |
| 50 | + MaxNodeCount int |
| 51 | + |
| 52 | + // The instance type of the nodes in the node group. |
| 53 | + InstanceType string |
| 54 | +} |
| 55 | + |
| 56 | +type ClusterStatus string |
| 57 | + |
| 58 | +const ( |
| 59 | + ClusterStatusPending ClusterStatus = "pending" |
| 60 | + ClusterStatusAvailable ClusterStatus = "available" |
| 61 | +) |
| 62 | + |
| 63 | +type CreateClusterArgs struct { |
| 64 | + Name string |
| 65 | + VPCID string |
| 66 | + SubnetIDs []string |
| 67 | + KubernetesVersion string |
| 68 | + Location string |
| 69 | + NodeGroups []CreateNodeGroupArgs |
| 70 | +} |
| 71 | + |
| 72 | +type CreateNodeGroupArgs struct { |
| 73 | + Name string |
| 74 | + RefID string |
| 75 | + MinNodeCount int |
| 76 | + MaxNodeCount int |
| 77 | + InstanceType string |
| 78 | +} |
| 79 | + |
| 80 | +type GetClusterArgs struct { |
| 81 | + RefID string |
| 82 | + CloudID string |
| 83 | + Location string |
| 84 | +} |
| 85 | + |
| 86 | +type DeleteClusterArgs struct { |
| 87 | + Cluster *Cluster |
| 88 | +} |
| 89 | + |
| 90 | +type CloudMaintainKubernetes interface { |
| 91 | + CreateCluster(ctx context.Context, args CreateClusterArgs) (*Cluster, error) |
| 92 | + GetCluster(ctx context.Context, args GetClusterArgs) (*Cluster, error) |
| 93 | + DeleteCluster(ctx context.Context, args DeleteClusterArgs) error |
| 94 | +} |
0 commit comments