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
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(string, string, string, *container.CreateClusterRequest) error
CreateClusterAsync(string, string, string, *container.CreateClusterRequest) (*container.Operation, error)
DeleteCluster(string, string, string, string) error
DeleteClusterAsync(string, string, string, string) (*container.Operation, error)
GetCluster(string, string, string, string) (*container.Cluster, error)
GetOperation(string, string, string, string) (*container.Operation, error)
ListClustersInProject(string) ([]*container.Cluster, error)
}
SDKOperations wraps GKE SDK related functions
func NewSDKClient ¶
func NewSDKClient() (SDKOperations, error)
NewSDKClient returns an SDKClient that implements SDKOperations
Click to show internal directories.
Click to hide internal directories.