Documentation ¶
Index ¶
- Constants
- func BootDiskRRN(projectID, location, ringName, keyName string) string
- func ClusterRRN(projectID, location, clusterName string) string
- func Create(ctx context.Context, gkeClient services.GKEClusterService, ...) error
- func GetCluster(ctx context.Context, gkeClient services.GKEClusterService, ...) (*gkeapi.Cluster, error)
- func GetGKEClient(ctx context.Context, credential string) (*gkeapi.Service, error)
- func GetGKEClusterClient(ctx context.Context, credential string) (services.GKEClusterService, error)
- func GetTokenSource(ctx context.Context, credential string) (oauth2.TokenSource, error)
- func Location(region, zone string) string
- func LocationRRN(projectID, location string) string
- func NewClusterCreateRequest(config *gkev1.GKEClusterConfig) *gkeapi.CreateClusterRequest
- func NodePoolRRN(projectID, location, clusterName, nodePool string) string
- func RemoveCluster(ctx context.Context, gkeClient services.GKEClusterService, ...) error
- type Status
- func CreateNodePool(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func RemoveNodePool(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateClusterAddons(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateLabels(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateLocations(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateLoggingMonitoringService(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateMaintenanceWindow(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateMasterAuthorizedNetworks(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateMasterKubernetesVersion(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateNetworkPolicyEnabled(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateNodePoolAutoscaling(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateNodePoolConfig(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateNodePoolKubernetesVersionOrImageType(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateNodePoolManagement(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
- func UpdateNodePoolSize(ctx context.Context, gkeClient services.GKEClusterService, ...) (Status, error)
Constants ¶
const (
// CloudLoggingService is the Cloud Logging service with a Kubernetes-native resource model
CloudLoggingService = "logging.googleapis.com/kubernetes"
)
Logging Services
const (
// CloudMonitoringService is the Cloud Monitoring service with a Kubernetes-native resource model
CloudMonitoringService = "monitoring.googleapis.com/kubernetes"
)
Monitoring Services
const (
// NetworkProviderCalico describes the calico provider
NetworkProviderCalico = "CALICO"
)
Network Providers
Variables ¶
This section is empty.
Functions ¶
func BootDiskRRN ¶ added in v1.9.0
BootDiskRRN returns a Relative Resource Name of a disk key in the region or zone for the specified project
func ClusterRRN ¶
ClusterRRN returns an Relative Resource Name of a cluster in the specified region or zone
func Create ¶
func Create(ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig) error
Create creates an upstream GKE cluster.
func GetCluster ¶
func GetCluster(ctx context.Context, gkeClient services.GKEClusterService, configSpec *gkev1.GKEClusterConfigSpec) (*gkeapi.Cluster, error)
func GetGKEClient ¶
GetGKEClient accepts a JSON credential string and returns a Service client.
func GetGKEClusterClient ¶ added in v1.2.0
func GetTokenSource ¶
func Location ¶
Location returns the region or zone depending on which is not set to empty. Cluster creation validation should ensure that only one of region or zone is set, not both.
func LocationRRN ¶
LocationRRN returns a Relative Resource Name representing a location. This RRN can either represent a Region or a Zone. It can be used as the parent attribute during cluster creation to create a zonal or regional cluster, or be used to generate more specific RRNs like an RRN representing a cluster.
https://cloud.google.com/apis/design/resource_names#relative_resource_name
func NewClusterCreateRequest ¶ added in v1.9.0
func NewClusterCreateRequest(config *gkev1.GKEClusterConfig) *gkeapi.CreateClusterRequest
NewClusterCreateRequest creates a CreateClusterRequest that can be submitted to GKE
func NodePoolRRN ¶
NodePoolRRN returns a Relative Resource Name of a node pool in a cluster in the region or zone for the specified project
func RemoveCluster ¶
func RemoveCluster(ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig) error
RemoveCluster attempts to delete a cluster and retries the delete request if the cluster is busy.
Types ¶
type Status ¶
type Status int
Status indicates how to handle the response from a request to update a resource
const ( // Changed means the request to change resource was accepted and change is in progress Changed Status = iota // Retry means the request to change resource was rejected due to an expected error and should be retried later Retry // NotChanged means the resource was not changed, either due to error or because it was unnecessary NotChanged )
Status indicators
func CreateNodePool ¶
func CreateNodePool(ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig, nodePoolConfig *gkev1.GKENodePoolConfig) (Status, error)
CreateNodePool creates an upstream node pool with the given cluster as a parent.
func RemoveNodePool ¶
func RemoveNodePool(ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig, nodePoolName string) (Status, error)
RemoveNodePool deletes a node pool
func UpdateClusterAddons ¶
func UpdateClusterAddons(ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig, upstreamSpec *gkev1.GKEClusterConfigSpec) (Status, error)
UpdateClusterAddons updates the cluster addons. In the case of the NetworkPolicyConfig addon, this may need to be retried after NetworkPolicyEnabled has been updated.
func UpdateLabels ¶
func UpdateLabels( ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig, upstreamSpec *gkev1.GKEClusterConfigSpec) (Status, error)
UpdateLabels updates the cluster labels.
func UpdateLocations ¶
func UpdateLocations( ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig, upstreamSpec *gkev1.GKEClusterConfigSpec) (Status, error)
UpdateLocations updates Locations.
func UpdateLoggingMonitoringService ¶
func UpdateLoggingMonitoringService( ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig, upstreamSpec *gkev1.GKEClusterConfigSpec) (Status, error)
UpdateLoggingMonitoringService updates both LoggingService and MonitoringService. In most cases, updating one requires explicitly updating the other as well, so these are paired.
func UpdateMaintenanceWindow ¶
func UpdateMaintenanceWindow( ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig, upstreamSpec *gkev1.GKEClusterConfigSpec) (Status, error)
UpdateMaintenanceWindow updates Cluster.MaintenancePolicy.Window.DailyMaintenanceWindow.StartTime
func UpdateMasterAuthorizedNetworks ¶
func UpdateMasterAuthorizedNetworks( ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig, upstreamSpec *gkev1.GKEClusterConfigSpec) (Status, error)
UpdateMasterAuthorizedNetworks updates MasterAuthorizedNetworks
func UpdateMasterKubernetesVersion ¶
func UpdateMasterKubernetesVersion(ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig, upstreamSpec *gkev1.GKEClusterConfigSpec) (Status, error)
UpdateMasterKubernetesVersion updates the Kubernetes version for the control plane. This must occur before the Kubernetes version is changed on the nodes.
func UpdateNetworkPolicyEnabled ¶
func UpdateNetworkPolicyEnabled( ctx context.Context, gkeClient services.GKEClusterService, config *gkev1.GKEClusterConfig, upstreamSpec *gkev1.GKEClusterConfigSpec) (Status, error)
UpdateNetworkPolicyEnabled updates the Cluster NetworkPolicy setting.
func UpdateNodePoolAutoscaling ¶
func UpdateNodePoolAutoscaling( ctx context.Context, gkeClient services.GKEClusterService, nodePool *gkev1.GKENodePoolConfig, config *gkev1.GKEClusterConfig, upstreamNodePool *gkev1.GKENodePoolConfig) (Status, error)
UpdateNodePoolAutoscaling updates the autoscaling parameters for a given node pool. If the node pool is busy, it will return a Retry status indicating the operation should be retried later.
func UpdateNodePoolConfig ¶ added in v1.1.6
func UpdateNodePoolConfig( ctx context.Context, gkeClient services.GKEClusterService, nodePool *gkev1.GKENodePoolConfig, config *gkev1.GKEClusterConfig, upstreamNodePool *gkev1.GKENodePoolConfig) (Status, error)
UpdateNodePoolConfig updates the configured parameters for a given node pool. If the node pool is busy, it will return a Retry status indicating the operation should be retried later.
func UpdateNodePoolKubernetesVersionOrImageType ¶
func UpdateNodePoolKubernetesVersionOrImageType( ctx context.Context, gkeClient services.GKEClusterService, nodePool *gkev1.GKENodePoolConfig, config *gkev1.GKEClusterConfig, upstreamNodePool *gkev1.GKENodePoolConfig) (Status, error)
UpdateNodePoolKubernetesVersionOrImageType sends a combined request to update either the node pool Kubernetes version or image type or both. These attributes are among the few that can be updated in the same request. If the node pool is busy, it will return a Retry status indicating the operation should be retried later.
func UpdateNodePoolManagement ¶
func UpdateNodePoolManagement( ctx context.Context, gkeClient services.GKEClusterService, nodePool *gkev1.GKENodePoolConfig, config *gkev1.GKEClusterConfig, upstreamNodePool *gkev1.GKENodePoolConfig) (Status, error)
UpdateNodePoolManagement updates the management parameters for a given node pool. If the node pool is busy, it will return a Retry status indicating the operation should be retried later.
func UpdateNodePoolSize ¶
func UpdateNodePoolSize( ctx context.Context, gkeClient services.GKEClusterService, nodePool *gkev1.GKENodePoolConfig, config *gkev1.GKEClusterConfig, upstreamNodePool *gkev1.GKENodePoolConfig) (Status, error)
UpdateNodePoolSize sets the size of a given node pool. If the node pool is busy, it will return a Retry status indicating the operation should be retried later.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
mock_services
Package mock_services is a generated GoMock package.
|
Package mock_services is a generated GoMock package. |