Documentation ¶
Index ¶
- func GetAddonsConfig(addons []string) *container.AddonsConfig
- func GetClusterLocation(region, zone string) string
- func NewCreateClusterRequest(request *Request) (*container.CreateClusterRequest, error)
- func RegionZoneFromLoc(location string) (string, string)
- func Wait(gsc SDKOperations, project, region, zone, opName string, wait time.Duration) error
- type Request
- type SDKOperations
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAddonsConfig ¶
func GetAddonsConfig(addons []string) *container.AddonsConfig
GetAddonsConfig gets AddonsConfig from a slice of addon names, contains the logic of converting string argument to typed AddonsConfig, for example `IstioConfig`. Currently supports Istio, HorizontalPodAutoscaling, HttpLoadBalancing and CloudRun.
func GetClusterLocation ¶
GetClusterLocation returns the location used in GKE operations, given the region and zone.
func NewCreateClusterRequest ¶
func NewCreateClusterRequest(request *Request) (*container.CreateClusterRequest, error)
NewCreateClusterRequest returns a new CreateClusterRequest that can be used in gcloud SDK.
func RegionZoneFromLoc ¶
RegionZoneFromLoc returns the region and the zone, given the location.
Types ¶
type Request ¶
type Request struct { // Project: name of the gcloud project for the cluster Project string // GKEVersion: GKE version of the cluster, default to be latest if not provided GKEVersion string // ClusterName: name of the cluster ClusterName string // MinNodes: the minimum number of nodes of the cluster MinNodes int64 // MaxNodes: the maximum number of nodes of the cluster MaxNodes int64 // NodeType: node type of the cluster, e.g. n1-standard-4, n1-standard-8 NodeType string // Region: region of the cluster, e.g. us-west1, us-central1 Region string // Zone: default is none, must be provided together with region Zone string // Addons: cluster addons to be added to cluster, such as istio Addons []string }
Request contains all settings collected for cluster creation
type SDKOperations ¶
type SDKOperations interface { CreateCluster(project, region, zone string, req *container.CreateClusterRequest) error CreateClusterAsync(project, region, zone string, req *container.CreateClusterRequest) (*container.Operation, error) DeleteCluster(project, region, zone, clusterName string) error DeleteClusterAsync(project, region, zone, clusterName string) (*container.Operation, error) GetCluster(project, region, zone, clusterName string) (*container.Cluster, error) GetOperation(project, region, zone, opName string) (*container.Operation, error) ListClustersInProject(project string) ([]*container.Cluster, error) }
SDKOperations wraps GKE SDK related functions
func NewSDKClient ¶
func NewSDKClient(opts ...option.ClientOption) (SDKOperations, error)
NewSDKClient returns an SDKClient that implements SDKOperations