legacy-cloud-providers: k8s.io/legacy-cloud-providers/gce Index | Files

package gce

import "k8s.io/legacy-cloud-providers/gce"

Package gce is an implementation of Interface, LoadBalancer and Instances for Google Compute Engine.

Index

Package Files

doc.go gce.go gce_address_manager.go gce_addresses.go gce_alpha.go gce_annotations.go gce_backendservice.go gce_cert.go gce_clusterid.go gce_clusters.go gce_disks.go gce_fake.go gce_firewall.go gce_forwardingrule.go gce_healthchecks.go gce_instancegroup.go gce_instances.go gce_interfaces.go gce_loadbalancer.go gce_loadbalancer_external.go gce_loadbalancer_internal.go gce_loadbalancer_metrics.go gce_loadbalancer_naming.go gce_networkendpointgroup.go gce_routes.go gce_securitypolicy.go gce_targetpool.go gce_targetproxy.go gce_tpu.go gce_urlmap.go gce_util.go gce_zones.go metrics.go support.go token_source.go

Constants

const (
    // AlphaFeatureILBSubsets allows InternalLoadBalancer services to include a subset
    // of cluster nodes as backends instead of all nodes.
    AlphaFeatureILBSubsets = "ILBSubsets"
    // AlphaFeatureILBCustomSubnet allows InternalLoadBalancer services to specify a
    // network subnet to allocate ip addresses from.
    AlphaFeatureILBCustomSubnet = "ILBCustomSubnet"
)
const (
    // ServiceAnnotationLoadBalancerType is annotated on a service with type LoadBalancer
    // dictates what specific kind of GCP LB should be assembled.
    // Currently, only "Internal" is supported.
    ServiceAnnotationLoadBalancerType = "networking.gke.io/load-balancer-type"

    // LBTypeInternal is the constant for the official internal type.
    LBTypeInternal LoadBalancerType = "Internal"

    // ServiceAnnotationILBBackendShare is annotated on a service with "true" when users
    // want to share GCP Backend Services for a set of internal load balancers.
    // ALPHA feature - this may be removed in a future release.
    ServiceAnnotationILBBackendShare = "alpha.cloud.google.com/load-balancer-backend-share"

    // ServiceAnnotationILBAllowGlobalAccess is annotated on a service with "true" when users
    // want to access the Internal LoadBalancer globally, and not restricted to the region it is
    // created in.
    ServiceAnnotationILBAllowGlobalAccess = "networking.gke.io/internal-load-balancer-allow-global-access"

    // ServiceAnnotationILBSubnet is annotated on a service with the name of the subnetwork
    // the ILB IP Address should be assigned from. By default, this is the subnetwork that the
    // cluster is created in.
    ServiceAnnotationILBSubnet = "networking.gke.io/internal-load-balancer-subnet"

    // NetworkTierAnnotationKey is annotated on a Service object to indicate which
    // network tier a GCP LB should use. The valid values are "Standard" and
    // "Premium" (default).
    NetworkTierAnnotationKey = "cloud.google.com/network-tier"

    // NetworkTierAnnotationStandard is an annotation to indicate the Service is on the Standard network tier
    NetworkTierAnnotationStandard = cloud.NetworkTierStandard

    // NetworkTierAnnotationPremium is an annotation to indicate the Service is on the Premium network tier
    NetworkTierAnnotationPremium = cloud.NetworkTierPremium
)
const (
    // UIDConfigMapName is the Key used to persist UIDs to configmaps.
    UIDConfigMapName = "ingress-uid"

    // UIDNamespace is the namespace which contains the above config map
    UIDNamespace = metav1.NamespaceSystem

    // UIDCluster is the data keys for looking up the clusters UID
    UIDCluster = "uid"

    // UIDProvider is the data keys for looking up the providers UID
    UIDProvider = "provider-uid"

    // UIDLengthBytes is the length of a UID
    UIDLengthBytes = 8
)
const (
    // DiskTypeSSD the type for persistent SSD storage
    DiskTypeSSD = "pd-ssd"

    // DiskTypeStandard the type for standard persistent storage
    DiskTypeStandard = "pd-standard"
)
const (

    // ILBFinalizerV1 key is used to identify ILB services whose resources are managed by service controller.
    ILBFinalizerV1 = "gke.networking.io/l4-ilb-v1"
    // ILBFinalizerV2 is the finalizer used by newer controllers that implement Internal LoadBalancer services.
    ILBFinalizerV2 = "gke.networking.io/l4-ilb-v2"
)
const (
    // ProviderName is the official const representation of the Google Cloud Provider
    ProviderName = "gce"
)

func FirewallToGCloudCreateCmd Uses

func FirewallToGCloudCreateCmd(fw *compute.Firewall, projectID string) string

FirewallToGCloudCreateCmd generates a gcloud command to create a firewall with specified params

func FirewallToGCloudDeleteCmd Uses

func FirewallToGCloudDeleteCmd(fwName, projectID string) string

FirewallToGCloudDeleteCmd generates a gcloud command to delete a firewall to specified params

func FirewallToGCloudUpdateCmd Uses

func FirewallToGCloudUpdateCmd(fw *compute.Firewall, projectID string) string

FirewallToGCloudUpdateCmd generates a gcloud command to update a firewall to specified params

func GetGCERegion Uses

func GetGCERegion(zone string) (string, error)

GetGCERegion returns region of the gce zone. Zone names are of the form: ${region-name}-${ix}. For example, "us-central1-b" has a region of "us-central1". So we look for the last '-' and trim to just before that.

func GetLoadBalancerAnnotationAllowGlobalAccess Uses

func GetLoadBalancerAnnotationAllowGlobalAccess(service *v1.Service) bool

GetLoadBalancerAnnotationAllowGlobalAccess returns if global access is enabled for the given loadbalancer service.

func GetLoadBalancerAnnotationBackendShare Uses

func GetLoadBalancerAnnotationBackendShare(service *v1.Service) bool

GetLoadBalancerAnnotationBackendShare returns whether this service's backend service should be shared with other load balancers. Health checks and the healthcheck firewall will be shared regardless.

func GetLoadBalancerAnnotationSubnet Uses

func GetLoadBalancerAnnotationSubnet(service *v1.Service) string

GetLoadBalancerAnnotationSubnet returns the configured subnet to assign LoadBalancer IP from.

func GetNodesHealthCheckPath Uses

func GetNodesHealthCheckPath() string

GetNodesHealthCheckPath returns the health check path used by the GCE load balancers (l4) for performing health checks on nodes.

func GetNodesHealthCheckPort Uses

func GetNodesHealthCheckPort() int32

GetNodesHealthCheckPort returns the health check port used by the GCE load balancers (l4) for performing health checks on nodes.

func GetServiceNetworkTier Uses

func GetServiceNetworkTier(service *v1.Service) (cloud.NetworkTier, error)

GetServiceNetworkTier returns the network tier of GCP load balancer which should be assembled, and an error if the specified tier is not supported.

func L4LoadBalancerSrcRanges Uses

func L4LoadBalancerSrcRanges() []string

L4LoadBalancerSrcRanges contains the ranges of ips used by the L3/L4 GCE load balancers for proxying client requests and performing health checks.

func L7LoadBalancerSrcRanges Uses

func L7LoadBalancerSrcRanges() []string

L7LoadBalancerSrcRanges contains the ranges of ips used by the GCE load balancers L7 for proxying client requests and performing health checks.

func MakeFirewallName Uses

func MakeFirewallName(name string) string

MakeFirewallName returns the firewall name used by the GCE load balancers (l4) for serving traffic.

func MakeHealthCheckFirewallName Uses

func MakeHealthCheckFirewallName(clusterID, hcName string, isNodesHealthCheck bool) string

MakeHealthCheckFirewallName returns the firewall name used by the GCE load balancers (l4) for performing health checks.

func MakeNodesHealthCheckName Uses

func MakeNodesHealthCheckName(clusterID string) string

MakeNodesHealthCheckName returns name of the health check resource used by the GCE load balancers (l4) for performing health checks on nodes.

func NewAltTokenSource Uses

func NewAltTokenSource(tokenURL, tokenBody string) oauth2.TokenSource

NewAltTokenSource constructs a new alternate token source for generating tokens.

func UpdateFakeGCECloud Uses

func UpdateFakeGCECloud(g *Cloud, vals TestClusterValues)

UpdateFakeGCECloud updates the fake GCE cloud with the specified values. Currently only the onXPN value is updated.

type AlphaFeatureGate Uses

type AlphaFeatureGate struct {
    // contains filtered or unexported fields
}

AlphaFeatureGate contains a mapping of alpha features to whether they are enabled

func NewAlphaFeatureGate Uses

func NewAlphaFeatureGate(features []string) *AlphaFeatureGate

NewAlphaFeatureGate marks the provided alpha features as enabled

func (*AlphaFeatureGate) Enabled Uses

func (af *AlphaFeatureGate) Enabled(key string) bool

Enabled returns true if the provided alpha feature is enabled

type AltTokenSource Uses

type AltTokenSource struct {
    // contains filtered or unexported fields
}

AltTokenSource is the structure holding the data for the functionality needed to generates tokens

func (*AltTokenSource) Token Uses

func (a *AltTokenSource) Token() (*oauth2.Token, error)

Token returns a token which may be used for authentication

type Cloud Uses

type Cloud struct {
    // ClusterID contains functionality for getting (and initializing) the ingress-uid. Call Cloud.Initialize()
    // for the cloudprovider to start watching the configmap.
    ClusterID ClusterID

    // AlphaFeatureGate gates gce alpha features in Cloud instance.
    // Related wrapper functions that interacts with gce alpha api should examine whether
    // the corresponding api is enabled.
    // If not enabled, it should return error.
    AlphaFeatureGate *AlphaFeatureGate
    // contains filtered or unexported fields
}

Cloud is an implementation of Interface, LoadBalancer and Instances for Google Compute Engine.

func CreateGCECloud Uses

func CreateGCECloud(config *CloudConfig) (*Cloud, error)

CreateGCECloud creates a Cloud object using the specified parameters. If no networkUrl is specified, loads networkName via rest call. If no tokenSource is specified, uses oauth2.DefaultTokenSource. If managedZones is nil / empty all zones in the region will be managed.

func CreateGCECloudWithCloud Uses

func CreateGCECloudWithCloud(config *CloudConfig, c cloud.Cloud) (*Cloud, error)

CreateGCECloudWithCloud is a helper function to create an instance of Cloud with the given Cloud interface implementation. Typical usage is to use cloud.NewMockGCE to get a handle to a mock Cloud instance and then use that for testing.

func NewFakeGCECloud Uses

func NewFakeGCECloud(vals TestClusterValues) *Cloud

NewFakeGCECloud constructs a fake GCE Cloud from the cluster values.

func (*Cloud) AddAliasToInstanceByProviderID Uses

func (g *Cloud) AddAliasToInstanceByProviderID(providerID string, alias *net.IPNet) error

AddAliasToInstanceByProviderID adds an alias to the given instance from the named secondary range.

func (*Cloud) AddInstancesToInstanceGroup Uses

func (g *Cloud) AddInstancesToInstanceGroup(name string, zone string, instanceRefs []*compute.InstanceReference) error

AddInstancesToInstanceGroup adds the given instances to the given instance group.

func (*Cloud) AddInstancesToTargetPool Uses

func (g *Cloud) AddInstancesToTargetPool(name, region string, instanceRefs []*compute.InstanceReference) error

AddInstancesToTargetPool adds instances by link to the TargetPool

func (*Cloud) AddRuletoBetaSecurityPolicy Uses

func (g *Cloud) AddRuletoBetaSecurityPolicy(name string, spr *computebeta.SecurityPolicyRule) error

AddRuletoBetaSecurityPolicy adds the given security policy rule to a security policy.

func (*Cloud) AddSSHKeyToAllInstances Uses

func (g *Cloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error

AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances expected format for the key is standard ssh-keygen format: <protocol> <blob>

func (*Cloud) AggregatedListNetworkEndpointGroup Uses

func (g *Cloud) AggregatedListNetworkEndpointGroup() (map[string][]*computebeta.NetworkEndpointGroup, error)

AggregatedListNetworkEndpointGroup returns a map of zone -> endpoint group.

func (*Cloud) AliasRangesByProviderID Uses

func (g *Cloud) AliasRangesByProviderID(providerID string) (cidrs []string, err error)

AliasRangesByProviderID returns a list of CIDR ranges that are assigned to the `node` for allocation to pods. Returns a list of the form "<ip>/<netmask>".

func (*Cloud) AttachDisk Uses

func (g *Cloud) AttachDisk(diskName string, nodeName types.NodeName, readOnly bool, regional bool) error

AttachDisk attaches given disk to the node with the specified NodeName. Current instance is used when instanceID is empty string.

func (*Cloud) AttachNetworkEndpoints Uses

func (g *Cloud) AttachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error

AttachNetworkEndpoints associates the referenced endpoints with the named endpoint group in the zone

func (*Cloud) BulkDisksAreAttached Uses

func (g *Cloud) BulkDisksAreAttached(diskByNodes map[types.NodeName][]string) (map[types.NodeName]map[string]bool, error)

BulkDisksAreAttached is a batch function to check if all corresponding disks are attached to the nodes specified with nodeName.

func (*Cloud) Clusters Uses

func (g *Cloud) Clusters() (cloudprovider.Clusters, bool)

Clusters returns an implementation of Clusters for Google Compute Engine.

func (*Cloud) Compute Uses

func (g *Cloud) Compute() cloud.Cloud

Compute returns the generated stubs for the compute API.

func (*Cloud) ComputeServices Uses

func (g *Cloud) ComputeServices() *Services

ComputeServices returns access to the internal compute services.

func (*Cloud) ContainerService Uses

func (g *Cloud) ContainerService() *container.Service

ContainerService returns the container service.

func (*Cloud) CreateAlphaGlobalBackendService Uses

func (g *Cloud) CreateAlphaGlobalBackendService(bg *computealpha.BackendService) error

CreateAlphaGlobalBackendService creates the given alpha BackendService.

func (*Cloud) CreateAlphaHealthCheck Uses

func (g *Cloud) CreateAlphaHealthCheck(hc *computealpha.HealthCheck) error

CreateAlphaHealthCheck creates the given alpha HealthCheck.

func (*Cloud) CreateAlphaRegionForwardingRule Uses

func (g *Cloud) CreateAlphaRegionForwardingRule(rule *computealpha.ForwardingRule, region string) error

CreateAlphaRegionForwardingRule creates and returns an Alpha forwarding rule in the given region.

func (*Cloud) CreateBetaGlobalBackendService Uses

func (g *Cloud) CreateBetaGlobalBackendService(bg *computebeta.BackendService) error

CreateBetaGlobalBackendService creates the given beta BackendService.

func (*Cloud) CreateBetaHealthCheck Uses

func (g *Cloud) CreateBetaHealthCheck(hc *computebeta.HealthCheck) error

CreateBetaHealthCheck creates the given beta HealthCheck.

func (*Cloud) CreateBetaRegionForwardingRule Uses

func (g *Cloud) CreateBetaRegionForwardingRule(rule *computebeta.ForwardingRule, region string) error

CreateBetaRegionForwardingRule creates and returns a Beta forwarding rule in the given region.

func (*Cloud) CreateBetaSecurityPolicy Uses

func (g *Cloud) CreateBetaSecurityPolicy(sp *computebeta.SecurityPolicy) error

CreateBetaSecurityPolicy creates the given security policy.

func (*Cloud) CreateDisk Uses

func (g *Cloud) CreateDisk(
    name string, diskType string, zone string, sizeGb int64, tags map[string]string) (*Disk, error)

CreateDisk creates a new Persistent Disk, with the specified name & size, in the specified zone. It stores specified tags encoded in JSON in Description field.

func (*Cloud) CreateFirewall Uses

func (g *Cloud) CreateFirewall(f *compute.Firewall) error

CreateFirewall creates the passed firewall

func (*Cloud) CreateGlobalBackendService Uses

func (g *Cloud) CreateGlobalBackendService(bg *compute.BackendService) error

CreateGlobalBackendService creates the given BackendService.

func (*Cloud) CreateGlobalForwardingRule Uses

func (g *Cloud) CreateGlobalForwardingRule(rule *compute.ForwardingRule) error

CreateGlobalForwardingRule creates the passed GlobalForwardingRule

func (*Cloud) CreateHTTPHealthCheck Uses

func (g *Cloud) CreateHTTPHealthCheck(hc *compute.HttpHealthCheck) error

CreateHTTPHealthCheck creates the given HttpHealthCheck.

func (*Cloud) CreateHTTPSHealthCheck Uses

func (g *Cloud) CreateHTTPSHealthCheck(hc *compute.HttpsHealthCheck) error

CreateHTTPSHealthCheck creates the given HttpsHealthCheck.

func (*Cloud) CreateHealthCheck Uses

func (g *Cloud) CreateHealthCheck(hc *compute.HealthCheck) error

CreateHealthCheck creates the given HealthCheck.

func (*Cloud) CreateInstanceGroup Uses

func (g *Cloud) CreateInstanceGroup(ig *compute.InstanceGroup, zone string) error

CreateInstanceGroup creates an instance group with the given instances. It is the callers responsibility to add named ports.

func (*Cloud) CreateNetworkEndpointGroup Uses

func (g *Cloud) CreateNetworkEndpointGroup(neg *computebeta.NetworkEndpointGroup, zone string) error

CreateNetworkEndpointGroup creates an endpoint group in the zone

func (*Cloud) CreateRegionBackendService Uses

func (g *Cloud) CreateRegionBackendService(bg *compute.BackendService, region string) error

CreateRegionBackendService creates the given BackendService.

func (*Cloud) CreateRegionForwardingRule Uses

func (g *Cloud) CreateRegionForwardingRule(rule *compute.ForwardingRule, region string) error

CreateRegionForwardingRule creates and returns a RegionalForwardingRule that points to the given BackendService

func (*Cloud) CreateRegionalDisk Uses

func (g *Cloud) CreateRegionalDisk(
    name string, diskType string, replicaZones sets.String, sizeGb int64, tags map[string]string) (*Disk, error)

CreateRegionalDisk creates a new Regional Persistent Disk, with the specified name & size, replicated to the specified zones. It stores specified tags encoded in JSON in Description field.

func (*Cloud) CreateRoute Uses

func (g *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint string, route *cloudprovider.Route) error

CreateRoute in the cloud environment.

func (*Cloud) CreateSslCertificate Uses

func (g *Cloud) CreateSslCertificate(sslCerts *compute.SslCertificate) (*compute.SslCertificate, error)

CreateSslCertificate creates and returns a SslCertificate.

func (*Cloud) CreateTPU Uses

func (g *Cloud) CreateTPU(ctx context.Context, name, zone string, node *tpuapi.Node) (*tpuapi.Node, error)

CreateTPU creates the Cloud TPU node with the specified name in the specified zone.

func (*Cloud) CreateTargetHTTPProxy Uses

func (g *Cloud) CreateTargetHTTPProxy(proxy *compute.TargetHttpProxy) error

CreateTargetHTTPProxy creates a TargetHttpProxy

func (*Cloud) CreateTargetHTTPSProxy Uses

func (g *Cloud) CreateTargetHTTPSProxy(proxy *compute.TargetHttpsProxy) error

CreateTargetHTTPSProxy creates a TargetHttpsProxy

func (*Cloud) CreateTargetPool Uses

func (g *Cloud) CreateTargetPool(tp *compute.TargetPool, region string) error

CreateTargetPool creates the passed TargetPool

func (*Cloud) CreateURLMap Uses

func (g *Cloud) CreateURLMap(urlMap *compute.UrlMap) error

CreateURLMap creates a url map

func (*Cloud) CurrentNodeName Uses

func (g *Cloud) CurrentNodeName(ctx context.Context, hostname string) (types.NodeName, error)

CurrentNodeName returns the name of the node we are currently running on On most clouds (e.g. GCE) this is the hostname, so we provide the hostname

func (*Cloud) DeleteBetaSecurityPolicy Uses

func (g *Cloud) DeleteBetaSecurityPolicy(name string) error

DeleteBetaSecurityPolicy deletes the given security policy.

func (*Cloud) DeleteDisk Uses

func (g *Cloud) DeleteDisk(diskToDelete string) error

DeleteDisk deletes rgw referenced persistent disk.

func (*Cloud) DeleteExternalTargetPoolAndChecks Uses

func (g *Cloud) DeleteExternalTargetPoolAndChecks(service *v1.Service, name, region, clusterID string, hcNames ...string) error

DeleteExternalTargetPoolAndChecks Deletes an external load balancer pool and verifies the operation

func (*Cloud) DeleteFirewall Uses

func (g *Cloud) DeleteFirewall(name string) error

DeleteFirewall deletes the given firewall rule.

func (*Cloud) DeleteGlobalAddress Uses

func (g *Cloud) DeleteGlobalAddress(name string) error

DeleteGlobalAddress deletes a global address by name.

func (*Cloud) DeleteGlobalBackendService Uses

func (g *Cloud) DeleteGlobalBackendService(name string) error

DeleteGlobalBackendService deletes the given BackendService by name.

func (*Cloud) DeleteGlobalForwardingRule Uses

func (g *Cloud) DeleteGlobalForwardingRule(name string) error

DeleteGlobalForwardingRule deletes the GlobalForwardingRule by name.

func (*Cloud) DeleteHTTPHealthCheck Uses

func (g *Cloud) DeleteHTTPHealthCheck(name string) error

DeleteHTTPHealthCheck deletes the given HttpHealthCheck by name.

func (*Cloud) DeleteHTTPSHealthCheck Uses

func (g *Cloud) DeleteHTTPSHealthCheck(name string) error

DeleteHTTPSHealthCheck deletes the given HttpsHealthCheck by name.

func (*Cloud) DeleteHealthCheck Uses

func (g *Cloud) DeleteHealthCheck(name string) error

DeleteHealthCheck deletes the given HealthCheck by name.

func (*Cloud) DeleteInstance Uses

func (g *Cloud) DeleteInstance(project, zone, name string) error

DeleteInstance deletes an instance specified by project, zone, and name

func (*Cloud) DeleteInstanceGroup Uses

func (g *Cloud) DeleteInstanceGroup(name string, zone string) error

DeleteInstanceGroup deletes an instance group.

func (*Cloud) DeleteNetworkEndpointGroup Uses

func (g *Cloud) DeleteNetworkEndpointGroup(name string, zone string) error

DeleteNetworkEndpointGroup deletes the name endpoint group from the zone

func (*Cloud) DeleteRegionAddress Uses

func (g *Cloud) DeleteRegionAddress(name, region string) error

DeleteRegionAddress deletes a region address by name.

func (*Cloud) DeleteRegionBackendService Uses

func (g *Cloud) DeleteRegionBackendService(name, region string) error

DeleteRegionBackendService deletes the given BackendService by name.

func (*Cloud) DeleteRegionForwardingRule Uses

func (g *Cloud) DeleteRegionForwardingRule(name, region string) error

DeleteRegionForwardingRule deletes the RegionalForwardingRule by name & region.

func (*Cloud) DeleteRoute Uses

func (g *Cloud) DeleteRoute(ctx context.Context, clusterName string, route *cloudprovider.Route) error

DeleteRoute from the cloud environment.

func (*Cloud) DeleteSslCertificate Uses

func (g *Cloud) DeleteSslCertificate(name string) error

DeleteSslCertificate deletes the SslCertificate by name.

func (*Cloud) DeleteTPU Uses

func (g *Cloud) DeleteTPU(ctx context.Context, name, zone string) error

DeleteTPU deletes the Cloud TPU with the specified name in the specified zone.

func (*Cloud) DeleteTargetHTTPProxy Uses

func (g *Cloud) DeleteTargetHTTPProxy(name string) error

DeleteTargetHTTPProxy deletes the TargetHttpProxy by name.

func (*Cloud) DeleteTargetHTTPSProxy Uses

func (g *Cloud) DeleteTargetHTTPSProxy(name string) error

DeleteTargetHTTPSProxy deletes the TargetHttpsProxy by name.

func (*Cloud) DeleteTargetPool Uses

func (g *Cloud) DeleteTargetPool(name, region string) error

DeleteTargetPool deletes TargetPool by name.

func (*Cloud) DeleteURLMap Uses

func (g *Cloud) DeleteURLMap(name string) error

DeleteURLMap deletes a url map by name.

func (*Cloud) DetachDisk Uses

func (g *Cloud) DetachDisk(devicePath string, nodeName types.NodeName) error

DetachDisk detaches given disk to the node with the specified NodeName. Current instance is used when nodeName is empty string.

func (*Cloud) DetachNetworkEndpoints Uses

func (g *Cloud) DetachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error

DetachNetworkEndpoints breaks the association between the referenced endpoints and the named endpoint group in the zone

func (*Cloud) DiskIsAttached Uses

func (g *Cloud) DiskIsAttached(diskName string, nodeName types.NodeName) (bool, error)

DiskIsAttached checks if a disk is attached to the node with the specified NodeName.

func (*Cloud) DisksAreAttached Uses

func (g *Cloud) DisksAreAttached(diskNames []string, nodeName types.NodeName) (map[string]bool, error)

DisksAreAttached is a batch function to check if a list of disks are attached to the node with the specified NodeName.

func (*Cloud) EnsureLoadBalancer Uses

func (g *Cloud) EnsureLoadBalancer(ctx context.Context, clusterName string, svc *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)

EnsureLoadBalancer is an implementation of LoadBalancer.EnsureLoadBalancer.

func (*Cloud) EnsureLoadBalancerDeleted Uses

func (g *Cloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, svc *v1.Service) error

EnsureLoadBalancerDeleted is an implementation of LoadBalancer.EnsureLoadBalancerDeleted.

func (*Cloud) GetAllCurrentZones Uses

func (g *Cloud) GetAllCurrentZones() (sets.String, error)

GetAllCurrentZones returns all the zones in which k8s nodes are currently running

func (*Cloud) GetAllZonesFromCloudProvider Uses

func (g *Cloud) GetAllZonesFromCloudProvider() (sets.String, error)

GetAllZonesFromCloudProvider returns all the zones in which nodes are running Only use this in E2E tests to get zones, on real clusters this will get all zones with compute instances in them even if not k8s instances!!! ex. I have k8s nodes in us-central1-c and us-central1-b. I also have a non-k8s compute in us-central1-a. This func will return a,b, and c.

TODO: this should be removed from the cloud provider.

func (*Cloud) GetAlphaGlobalBackendService Uses

func (g *Cloud) GetAlphaGlobalBackendService(name string) (*computealpha.BackendService, error)

GetAlphaGlobalBackendService retrieves alpha backend by name.

func (*Cloud) GetAlphaHealthCheck Uses

func (g *Cloud) GetAlphaHealthCheck(name string) (*computealpha.HealthCheck, error)

GetAlphaHealthCheck returns the given alpha HealthCheck by name.

func (*Cloud) GetAlphaRegionForwardingRule Uses

func (g *Cloud) GetAlphaRegionForwardingRule(name, region string) (*computealpha.ForwardingRule, error)

GetAlphaRegionForwardingRule returns the Alpha forwarding rule by name & region.

func (*Cloud) GetAutoLabelsForPD Uses

func (g *Cloud) GetAutoLabelsForPD(disk *Disk) (map[string]string, error)

GetAutoLabelsForPD builds the labels that should be automatically added to a PersistentVolume backed by a GCE PD Specifically, this builds FailureDomain (zone) and Region labels. The PersistentVolumeLabel admission controller calls this and adds the labels when a PV is created.

func (*Cloud) GetBetaGlobalBackendService Uses

func (g *Cloud) GetBetaGlobalBackendService(name string) (*computebeta.BackendService, error)

GetBetaGlobalBackendService retrieves beta backend by name.

func (*Cloud) GetBetaHealthCheck Uses

func (g *Cloud) GetBetaHealthCheck(name string) (*computebeta.HealthCheck, error)

GetBetaHealthCheck returns the given beta HealthCheck by name.

func (*Cloud) GetBetaRegionAddress Uses

func (g *Cloud) GetBetaRegionAddress(name, region string) (*computebeta.Address, error)

GetBetaRegionAddress returns the beta region address by name

func (*Cloud) GetBetaRegionAddressByIP Uses

func (g *Cloud) GetBetaRegionAddressByIP(region, ipAddress string) (*computebeta.Address, error)

GetBetaRegionAddressByIP returns the beta regional address matching the given IP address.

func (*Cloud) GetBetaRegionForwardingRule Uses

func (g *Cloud) GetBetaRegionForwardingRule(name, region string) (*computebeta.ForwardingRule, error)

GetBetaRegionForwardingRule returns the Beta forwarding rule by name & region.

func (*Cloud) GetBetaSecurityPolicy Uses

func (g *Cloud) GetBetaSecurityPolicy(name string) (*computebeta.SecurityPolicy, error)

GetBetaSecurityPolicy retrieves a security policy.

func (*Cloud) GetDiskByNameUnknownZone Uses

func (g *Cloud) GetDiskByNameUnknownZone(diskName string) (*Disk, error)

GetDiskByNameUnknownZone scans all managed zones to return the GCE PD Prefer getDiskByName, if the zone can be established Return cloudprovider.DiskNotFound if the given disk cannot be found in any zone

func (*Cloud) GetFirewall Uses

func (g *Cloud) GetFirewall(name string) (*compute.Firewall, error)

GetFirewall returns the Firewall by name.

func (*Cloud) GetGlobalAddress Uses

func (g *Cloud) GetGlobalAddress(name string) (*compute.Address, error)

GetGlobalAddress returns the global address by name.

func (*Cloud) GetGlobalBackendService Uses

func (g *Cloud) GetGlobalBackendService(name string) (*compute.BackendService, error)

GetGlobalBackendService retrieves a backend by name.

func (*Cloud) GetGlobalBackendServiceHealth Uses

func (g *Cloud) GetGlobalBackendServiceHealth(name string, instanceGroupLink string) (*compute.BackendServiceGroupHealth, error)

GetGlobalBackendServiceHealth returns the health of the BackendService identified by the given name, in the given instanceGroup. The instanceGroupLink is the fully qualified self link of an instance group.

func (*Cloud) GetGlobalForwardingRule Uses

func (g *Cloud) GetGlobalForwardingRule(name string) (*compute.ForwardingRule, error)

GetGlobalForwardingRule returns the GlobalForwardingRule by name.

func (*Cloud) GetHTTPHealthCheck Uses

func (g *Cloud) GetHTTPHealthCheck(name string) (*compute.HttpHealthCheck, error)

GetHTTPHealthCheck returns the given HttpHealthCheck by name.

func (*Cloud) GetHTTPSHealthCheck Uses

func (g *Cloud) GetHTTPSHealthCheck(name string) (*compute.HttpsHealthCheck, error)

GetHTTPSHealthCheck returns the given HttpsHealthCheck by name.

func (*Cloud) GetHealthCheck Uses

func (g *Cloud) GetHealthCheck(name string) (*compute.HealthCheck, error)

GetHealthCheck returns the given HealthCheck by name.

func (*Cloud) GetInstanceGroup Uses

func (g *Cloud) GetInstanceGroup(name string, zone string) (*compute.InstanceGroup, error)

GetInstanceGroup returns an instance group by name.

func (*Cloud) GetLabelsForVolume Uses

func (g *Cloud) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVolume) (map[string]string, error)

GetLabelsForVolume retrieved the label info for the provided volume

func (*Cloud) GetLoadBalancer Uses

func (g *Cloud) GetLoadBalancer(ctx context.Context, clusterName string, svc *v1.Service) (*v1.LoadBalancerStatus, bool, error)

GetLoadBalancer is an implementation of LoadBalancer.GetLoadBalancer

func (*Cloud) GetLoadBalancerName Uses

func (g *Cloud) GetLoadBalancerName(ctx context.Context, clusterName string, svc *v1.Service) string

GetLoadBalancerName is an implementation of LoadBalancer.GetLoadBalancerName.

func (*Cloud) GetManagedClusters Uses

func (g *Cloud) GetManagedClusters(ctx context.Context) ([]*container.Cluster, error)

GetManagedClusters will return the cluster objects associated to this project

func (*Cloud) GetNetworkEndpointGroup Uses

func (g *Cloud) GetNetworkEndpointGroup(name string, zone string) (*computebeta.NetworkEndpointGroup, error)

GetNetworkEndpointGroup returns the collection of network endpoints for the name in zone

func (*Cloud) GetNodeTags Uses

func (g *Cloud) GetNodeTags(nodeNames []string) ([]string, error)

GetNodeTags will first try returning the list of tags specified in GCE cloud Configuration. If they weren't provided, it'll compute the host tags with the given hostnames. If the list of hostnames has not changed, a cached set of nodetags are returned.

func (*Cloud) GetRegionAddress Uses

func (g *Cloud) GetRegionAddress(name, region string) (*compute.Address, error)

GetRegionAddress returns the region address by name

func (*Cloud) GetRegionAddressByIP Uses

func (g *Cloud) GetRegionAddressByIP(region, ipAddress string) (*compute.Address, error)

GetRegionAddressByIP returns the regional address matching the given IP address.

func (*Cloud) GetRegionBackendService Uses

func (g *Cloud) GetRegionBackendService(name, region string) (*compute.BackendService, error)

GetRegionBackendService retrieves a backend by name.

func (*Cloud) GetRegionForwardingRule Uses

func (g *Cloud) GetRegionForwardingRule(name, region string) (*compute.ForwardingRule, error)

GetRegionForwardingRule returns the RegionalForwardingRule by name & region.

func (*Cloud) GetRegionalBackendServiceHealth Uses

func (g *Cloud) GetRegionalBackendServiceHealth(name, region string, instanceGroupLink string) (*compute.BackendServiceGroupHealth, error)

GetRegionalBackendServiceHealth returns the health of the BackendService identified by the given name, in the given instanceGroup. The instanceGroupLink is the fully qualified self link of an instance group.

func (*Cloud) GetRuleForBetaSecurityPolicy Uses

func (g *Cloud) GetRuleForBetaSecurityPolicy(name string) (*computebeta.SecurityPolicyRule, error)

GetRuleForBetaSecurityPolicy gets rule from a security policy.

func (*Cloud) GetSslCertificate Uses

func (g *Cloud) GetSslCertificate(name string) (*compute.SslCertificate, error)

GetSslCertificate returns the SslCertificate by name.

func (*Cloud) GetTPU Uses

func (g *Cloud) GetTPU(ctx context.Context, name, zone string) (*tpuapi.Node, error)

GetTPU returns the Cloud TPU with the specified name in the specified zone.

func (*Cloud) GetTargetHTTPProxy Uses

func (g *Cloud) GetTargetHTTPProxy(name string) (*compute.TargetHttpProxy, error)

GetTargetHTTPProxy returns the UrlMap by name.

func (*Cloud) GetTargetHTTPSProxy Uses

func (g *Cloud) GetTargetHTTPSProxy(name string) (*compute.TargetHttpsProxy, error)

GetTargetHTTPSProxy returns the UrlMap by name.

func (*Cloud) GetTargetPool Uses

func (g *Cloud) GetTargetPool(name, region string) (*compute.TargetPool, error)

GetTargetPool returns the TargetPool by name.

func (*Cloud) GetURLMap Uses

func (g *Cloud) GetURLMap(name string) (*compute.UrlMap, error)

GetURLMap returns the UrlMap by name.

func (*Cloud) GetZone Uses

func (g *Cloud) GetZone(ctx context.Context) (cloudprovider.Zone, error)

GetZone creates a cloudprovider.Zone of the current zone and region

func (*Cloud) GetZoneByNodeName Uses

func (g *Cloud) GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (cloudprovider.Zone, error)

GetZoneByNodeName implements Zones.GetZoneByNodeName This is particularly useful in external cloud providers where the kubelet does not initialize node data.

func (*Cloud) GetZoneByProviderID Uses

func (g *Cloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)

GetZoneByProviderID implements Zones.GetZoneByProviderID This is particularly useful in external cloud providers where the kubelet does not initialize node data.

func (*Cloud) HasClusterID Uses

func (g *Cloud) HasClusterID() bool

HasClusterID returns true if the cluster has a clusterID

func (*Cloud) Initialize Uses

func (g *Cloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})

Initialize takes in a clientBuilder and spawns a goroutine for watching the clusterid configmap. This must be called before utilizing the funcs of gce.ClusterID

func (*Cloud) InsertInstance Uses

func (g *Cloud) InsertInstance(project string, zone string, i *compute.Instance) error

InsertInstance creates a new instance on GCP

func (*Cloud) InstanceExists Uses

func (g *Cloud) InstanceExists(ctx context.Context, node *v1.Node) (bool, error)

InstanceExists returns true if the instance with the given provider id still exists and is running. If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.

func (*Cloud) InstanceExistsByProviderID Uses

func (g *Cloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)

InstanceExistsByProviderID returns true if the instance with the given provider id still exists and is running. If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.

func (*Cloud) InstanceID Uses

func (g *Cloud) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error)

InstanceID returns the cloud provider ID of the node with the specified NodeName.

func (*Cloud) InstanceMetadata Uses

func (g *Cloud) InstanceMetadata(ctx context.Context, node *v1.Node) (*cloudprovider.InstanceMetadata, error)

InstanceMetadata returns metadata of the specified instance.

func (*Cloud) InstanceShutdown Uses

func (g *Cloud) InstanceShutdown(ctx context.Context, node *v1.Node) (bool, error)

InstanceShutdown returns true if the instance is in safe state to detach volumes

func (*Cloud) InstanceShutdownByProviderID Uses

func (g *Cloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)

InstanceShutdownByProviderID returns true if the instance is in safe state to detach volumes

func (*Cloud) InstanceType Uses

func (g *Cloud) InstanceType(ctx context.Context, nodeName types.NodeName) (string, error)

InstanceType returns the type of the specified node with the specified NodeName.

func (*Cloud) InstanceTypeByProviderID Uses

func (g *Cloud) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error)

InstanceTypeByProviderID returns the cloudprovider instance type of the node with the specified unique providerID This method will not be called from the node that is requesting this ID. i.e. metadata service and other local methods cannot be used here

func (*Cloud) Instances Uses

func (g *Cloud) Instances() (cloudprovider.Instances, bool)

Instances returns an implementation of Instances for Google Compute Engine.

func (*Cloud) InstancesV2 Uses

func (g *Cloud) InstancesV2() (cloudprovider.InstancesV2, bool)

InstancesV2 returns an implementation of InstancesV2 for Google Compute Engine. Implement ONLY for external cloud provider

func (*Cloud) IsLegacyNetwork Uses

func (g *Cloud) IsLegacyNetwork() bool

IsLegacyNetwork returns true if the cluster is still running a legacy network configuration.

func (*Cloud) ListAlphaRegionForwardingRules Uses

func (g *Cloud) ListAlphaRegionForwardingRules(region string) ([]*computealpha.ForwardingRule, error)

ListAlphaRegionForwardingRules lists all RegionalForwardingRules in the project & region.

func (*Cloud) ListBetaRegionForwardingRules Uses

func (g *Cloud) ListBetaRegionForwardingRules(region string) ([]*computebeta.ForwardingRule, error)

ListBetaRegionForwardingRules lists all RegionalForwardingRules in the project & region.

func (*Cloud) ListBetaSecurityPolicy Uses

func (g *Cloud) ListBetaSecurityPolicy() ([]*computebeta.SecurityPolicy, error)

ListBetaSecurityPolicy lists all security policies in the project.

func (*Cloud) ListClusters Uses

func (g *Cloud) ListClusters(ctx context.Context) ([]string, error)

ListClusters will return a list of cluster names for the associated project

func (*Cloud) ListGlobalBackendServices Uses

func (g *Cloud) ListGlobalBackendServices() ([]*compute.BackendService, error)

ListGlobalBackendServices lists all backend services in the project.

func (*Cloud) ListGlobalForwardingRules Uses

func (g *Cloud) ListGlobalForwardingRules() ([]*compute.ForwardingRule, error)

ListGlobalForwardingRules lists all GlobalForwardingRules in the project.

func (*Cloud) ListHTTPHealthChecks Uses

func (g *Cloud) ListHTTPHealthChecks() ([]*compute.HttpHealthCheck, error)

ListHTTPHealthChecks lists all HttpHealthChecks in the project.

func (*Cloud) ListHTTPSHealthChecks Uses

func (g *Cloud) ListHTTPSHealthChecks() ([]*compute.HttpsHealthCheck, error)

ListHTTPSHealthChecks lists all HttpsHealthChecks in the project.

func (*Cloud) ListHealthChecks Uses

func (g *Cloud) ListHealthChecks() ([]*compute.HealthCheck, error)

ListHealthChecks lists all HealthCheck in the project.

func (*Cloud) ListInstanceGroups Uses

func (g *Cloud) ListInstanceGroups(zone string) ([]*compute.InstanceGroup, error)

ListInstanceGroups lists all InstanceGroups in the project and zone.

func (*Cloud) ListInstanceNames Uses

func (g *Cloud) ListInstanceNames(project, zone string) (string, error)

ListInstanceNames returns a string of instance names separated by spaces. This method should only be used for e2e testing. TODO: remove this method.

func (*Cloud) ListInstancesInInstanceGroup Uses

func (g *Cloud) ListInstancesInInstanceGroup(name string, zone string, state string) ([]*compute.InstanceWithNamedPorts, error)

ListInstancesInInstanceGroup lists all the instances in a given instance group and state.

func (*Cloud) ListLocations Uses

func (g *Cloud) ListLocations(ctx context.Context) ([]*tpuapi.Location, error)

ListLocations returns the zones where Cloud TPUs are available.

func (*Cloud) ListNetworkEndpointGroup Uses

func (g *Cloud) ListNetworkEndpointGroup(zone string) ([]*computebeta.NetworkEndpointGroup, error)

ListNetworkEndpointGroup returns the collection of network endpoints for the zone

func (*Cloud) ListNetworkEndpoints Uses

func (g *Cloud) ListNetworkEndpoints(name, zone string, showHealthStatus bool) ([]*computebeta.NetworkEndpointWithHealthStatus, error)

ListNetworkEndpoints returns all the endpoints associated with the endpoint group in zone and optionally their status.

func (*Cloud) ListRegionBackendServices Uses

func (g *Cloud) ListRegionBackendServices(region string) ([]*compute.BackendService, error)

ListRegionBackendServices lists all backend services in the project.

func (*Cloud) ListRegionForwardingRules Uses

func (g *Cloud) ListRegionForwardingRules(region string) ([]*compute.ForwardingRule, error)

ListRegionForwardingRules lists all RegionalForwardingRules in the project & region.

func (*Cloud) ListRoutes Uses

func (g *Cloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudprovider.Route, error)

ListRoutes in the cloud environment.

func (*Cloud) ListSslCertificates Uses

func (g *Cloud) ListSslCertificates() ([]*compute.SslCertificate, error)

ListSslCertificates lists all SslCertificates in the project.

func (*Cloud) ListTPUs Uses

func (g *Cloud) ListTPUs(ctx context.Context, zone string) ([]*tpuapi.Node, error)

ListTPUs returns Cloud TPUs in the specified zone.

func (*Cloud) ListTargetHTTPProxies Uses

func (g *Cloud) ListTargetHTTPProxies() ([]*compute.TargetHttpProxy, error)

ListTargetHTTPProxies lists all TargetHttpProxies in the project.

func (*Cloud) ListTargetHTTPSProxies Uses

func (g *Cloud) ListTargetHTTPSProxies() ([]*compute.TargetHttpsProxy, error)

ListTargetHTTPSProxies lists all TargetHttpsProxies in the project.

func (*Cloud) ListURLMaps Uses

func (g *Cloud) ListURLMaps() ([]*compute.UrlMap, error)

ListURLMaps lists all UrlMaps in the project.

func (*Cloud) ListZonesInRegion Uses

func (g *Cloud) ListZonesInRegion(region string) ([]*compute.Zone, error)

ListZonesInRegion returns all zones in a GCP region

func (*Cloud) LoadBalancer Uses

func (g *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)

LoadBalancer returns an implementation of LoadBalancer for Google Compute Engine.

func (*Cloud) Master Uses

func (g *Cloud) Master(ctx context.Context, clusterName string) (string, error)

Master returned the dns address of the master

func (*Cloud) NetworkProjectID Uses

func (g *Cloud) NetworkProjectID() string

NetworkProjectID returns the ProjectID corresponding to the project this cluster's network is in.

func (*Cloud) NetworkURL Uses

func (g *Cloud) NetworkURL() string

NetworkURL returns the network url

func (*Cloud) NodeAddresses Uses

func (g *Cloud) NodeAddresses(ctx context.Context, nodeName types.NodeName) ([]v1.NodeAddress, error)

NodeAddresses is an implementation of Instances.NodeAddresses.

func (*Cloud) NodeAddressesByProviderID Uses

func (g *Cloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)

NodeAddressesByProviderID will not be called from the node that is requesting this ID. i.e. metadata service and other local methods cannot be used here

func (*Cloud) OnXPN Uses

func (g *Cloud) OnXPN() bool

OnXPN returns true if the cluster is running on a cross project network (XPN)

func (*Cloud) PatchBetaSecurityPolicy Uses

func (g *Cloud) PatchBetaSecurityPolicy(sp *computebeta.SecurityPolicy) error

PatchBetaSecurityPolicy applies the given security policy as a patch to an existing security policy.

func (*Cloud) PatchRuleForBetaSecurityPolicy Uses

func (g *Cloud) PatchRuleForBetaSecurityPolicy(name string, spr *computebeta.SecurityPolicyRule) error

PatchRuleForBetaSecurityPolicy patches the given security policy rule to a security policy.

func (*Cloud) ProjectID Uses

func (g *Cloud) ProjectID() string

ProjectID returns the ProjectID corresponding to the project this cloud is in.

func (*Cloud) ProviderName Uses

func (g *Cloud) ProviderName() string

ProviderName returns the cloud provider ID.

func (*Cloud) Region Uses

func (g *Cloud) Region() string

Region returns the region

func (*Cloud) RemoveInstancesFromInstanceGroup Uses

func (g *Cloud) RemoveInstancesFromInstanceGroup(name string, zone string, instanceRefs []*compute.InstanceReference) error

RemoveInstancesFromInstanceGroup removes the given instances from the instance group.

func (*Cloud) RemoveInstancesFromTargetPool Uses

func (g *Cloud) RemoveInstancesFromTargetPool(name, region string, instanceRefs []*compute.InstanceReference) error

RemoveInstancesFromTargetPool removes instances by link to the TargetPool

func (*Cloud) RemoveRuleFromBetaSecurityPolicy Uses

func (g *Cloud) RemoveRuleFromBetaSecurityPolicy(name string) error

RemoveRuleFromBetaSecurityPolicy removes rule from a security policy.

func (*Cloud) ReserveBetaRegionAddress Uses

func (g *Cloud) ReserveBetaRegionAddress(addr *computebeta.Address, region string) error

ReserveBetaRegionAddress creates a beta region address

func (*Cloud) ReserveGlobalAddress Uses

func (g *Cloud) ReserveGlobalAddress(addr *compute.Address) error

ReserveGlobalAddress creates a global address. Caller is allocated a random IP if they do not specify an ipAddress. If an ipAddress is specified, it must belong to the current project, eg: an ephemeral IP associated with a global forwarding rule.

func (*Cloud) ReserveRegionAddress Uses

func (g *Cloud) ReserveRegionAddress(addr *compute.Address, region string) error

ReserveRegionAddress creates a region address

func (*Cloud) ResizeDisk Uses

func (g *Cloud) ResizeDisk(diskToResize string, oldSize resource.Quantity, newSize resource.Quantity) (resource.Quantity, error)

ResizeDisk expands given disk and returns new disk size

func (*Cloud) Routes Uses

func (g *Cloud) Routes() (cloudprovider.Routes, bool)

Routes returns an implementation of Routes for Google Compute Engine.

func (*Cloud) SetInformers Uses

func (g *Cloud) SetInformers(informerFactory informers.SharedInformerFactory)

SetInformers sets up the zone handlers we need watching for node changes.

func (*Cloud) SetNamedPortsOfInstanceGroup Uses

func (g *Cloud) SetNamedPortsOfInstanceGroup(igName, zone string, namedPorts []*compute.NamedPort) error

SetNamedPortsOfInstanceGroup sets the list of named ports on a given instance group

func (*Cloud) SetProxyForGlobalForwardingRule Uses

func (g *Cloud) SetProxyForGlobalForwardingRule(forwardingRuleName, targetProxyLink string) error

SetProxyForGlobalForwardingRule links the given TargetHttp(s)Proxy with the given GlobalForwardingRule. targetProxyLink is the SelfLink of a TargetHttp(s)Proxy.

func (*Cloud) SetRateLimiter Uses

func (g *Cloud) SetRateLimiter(rl cloud.RateLimiter)

SetRateLimiter adds a custom cloud.RateLimiter implementation. WARNING: Calling this could have unexpected behavior if you have in-flight requests. It is best to use this immediately after creating a Cloud.

func (*Cloud) SetSecurityPolicyForAlphaGlobalBackendService Uses

func (g *Cloud) SetSecurityPolicyForAlphaGlobalBackendService(backendServiceName string, securityPolicyReference *computealpha.SecurityPolicyReference) error

SetSecurityPolicyForAlphaGlobalBackendService sets the given SecurityPolicyReference for the BackendService identified by the given name.

func (*Cloud) SetSecurityPolicyForBetaGlobalBackendService Uses

func (g *Cloud) SetSecurityPolicyForBetaGlobalBackendService(backendServiceName string, securityPolicyReference *computebeta.SecurityPolicyReference) error

SetSecurityPolicyForBetaGlobalBackendService sets the given SecurityPolicyReference for the BackendService identified by the given name.

func (*Cloud) SetSslCertificateForTargetHTTPSProxy Uses

func (g *Cloud) SetSslCertificateForTargetHTTPSProxy(proxy *compute.TargetHttpsProxy, sslCertURLs []string) error

SetSslCertificateForTargetHTTPSProxy sets the given SslCertificate for the given TargetHttpsProxy.

func (*Cloud) SetURLMapForTargetHTTPProxy Uses

func (g *Cloud) SetURLMapForTargetHTTPProxy(proxy *compute.TargetHttpProxy, urlMapLink string) error

SetURLMapForTargetHTTPProxy sets the given UrlMap for the given TargetHttpProxy.

func (*Cloud) SetURLMapForTargetHTTPSProxy Uses

func (g *Cloud) SetURLMapForTargetHTTPSProxy(proxy *compute.TargetHttpsProxy, urlMapLink string) error

SetURLMapForTargetHTTPSProxy sets the given UrlMap for the given TargetHttpsProxy.

func (*Cloud) SubnetworkURL Uses

func (g *Cloud) SubnetworkURL() string

SubnetworkURL returns the subnetwork url

func (*Cloud) ToInstanceReferences Uses

func (g *Cloud) ToInstanceReferences(zone string, instanceNames []string) (refs []*compute.InstanceReference)

ToInstanceReferences returns instance references by links

func (*Cloud) UpdateAlphaGlobalBackendService Uses

func (g *Cloud) UpdateAlphaGlobalBackendService(bg *computealpha.BackendService) error

UpdateAlphaGlobalBackendService applies the given alpha BackendService as an update to an existing service.

func (*Cloud) UpdateAlphaHealthCheck Uses

func (g *Cloud) UpdateAlphaHealthCheck(hc *computealpha.HealthCheck) error

UpdateAlphaHealthCheck applies the given alpha HealthCheck as an update.

func (*Cloud) UpdateBetaGlobalBackendService Uses

func (g *Cloud) UpdateBetaGlobalBackendService(bg *computebeta.BackendService) error

UpdateBetaGlobalBackendService applies the given beta BackendService as an update to an existing service.

func (*Cloud) UpdateBetaHealthCheck Uses

func (g *Cloud) UpdateBetaHealthCheck(hc *computebeta.HealthCheck) error

UpdateBetaHealthCheck applies the given beta HealthCheck as an update.

func (*Cloud) UpdateFirewall Uses

func (g *Cloud) UpdateFirewall(f *compute.Firewall) error

UpdateFirewall applies the given firewall as an update to an existing service.

func (*Cloud) UpdateGlobalBackendService Uses

func (g *Cloud) UpdateGlobalBackendService(bg *compute.BackendService) error

UpdateGlobalBackendService applies the given BackendService as an update to an existing service.

func (*Cloud) UpdateHTTPHealthCheck Uses

func (g *Cloud) UpdateHTTPHealthCheck(hc *compute.HttpHealthCheck) error

UpdateHTTPHealthCheck applies the given HttpHealthCheck as an update.

func (*Cloud) UpdateHTTPSHealthCheck Uses

func (g *Cloud) UpdateHTTPSHealthCheck(hc *compute.HttpsHealthCheck) error

UpdateHTTPSHealthCheck applies the given HttpsHealthCheck as an update.

func (*Cloud) UpdateHealthCheck Uses

func (g *Cloud) UpdateHealthCheck(hc *compute.HealthCheck) error

UpdateHealthCheck applies the given HealthCheck as an update.

func (*Cloud) UpdateLoadBalancer Uses

func (g *Cloud) UpdateLoadBalancer(ctx context.Context, clusterName string, svc *v1.Service, nodes []*v1.Node) error

UpdateLoadBalancer is an implementation of LoadBalancer.UpdateLoadBalancer.

func (*Cloud) UpdateRegionBackendService Uses

func (g *Cloud) UpdateRegionBackendService(bg *compute.BackendService, region string) error

UpdateRegionBackendService applies the given BackendService as an update to an existing service.

func (*Cloud) UpdateURLMap Uses

func (g *Cloud) UpdateURLMap(urlMap *compute.UrlMap) error

UpdateURLMap applies the given UrlMap as an update

func (*Cloud) Zones Uses

func (g *Cloud) Zones() (cloudprovider.Zones, bool)

Zones returns an implementation of Zones for Google Compute Engine.

type CloudAddressService Uses

type CloudAddressService interface {
    ReserveRegionAddress(address *compute.Address, region string) error
    GetRegionAddress(name string, region string) (*compute.Address, error)
    GetRegionAddressByIP(region, ipAddress string) (*compute.Address, error)
    DeleteRegionAddress(name, region string) error

    // Beta API
    ReserveBetaRegionAddress(address *computebeta.Address, region string) error
    GetBetaRegionAddress(name string, region string) (*computebeta.Address, error)
    GetBetaRegionAddressByIP(region, ipAddress string) (*computebeta.Address, error)
    // contains filtered or unexported methods
}

CloudAddressService is an interface for managing addresses

type CloudConfig Uses

type CloudConfig struct {
    APIEndpoint          string
    ContainerAPIEndpoint string
    ProjectID            string
    NetworkProjectID     string
    Region               string
    Regional             bool
    Zone                 string
    ManagedZones         []string
    NetworkName          string
    NetworkURL           string
    SubnetworkName       string
    SubnetworkURL        string
    // DEPRECATED: Do not rely on this value as it may be incorrect.
    SecondaryRangeName string
    NodeTags           []string
    NodeInstancePrefix string
    TokenSource        oauth2.TokenSource
    UseMetadataServer  bool
    AlphaFeatureGate   *AlphaFeatureGate
}

CloudConfig includes all the necessary configuration for creating Cloud

type CloudForwardingRuleService Uses

type CloudForwardingRuleService interface {
    GetRegionForwardingRule(name, region string) (*compute.ForwardingRule, error)
    CreateRegionForwardingRule(rule *compute.ForwardingRule, region string) error
    DeleteRegionForwardingRule(name, region string) error
    // contains filtered or unexported methods
}

CloudForwardingRuleService is an interface for managing forwarding rules. TODO: Expand the interface to include more methods.

type ClusterID Uses

type ClusterID struct {
    // contains filtered or unexported fields
}

ClusterID is the struct for maintaining information about this cluster's ID

func (*ClusterID) GetFederationID Uses

func (ci *ClusterID) GetFederationID() (string, bool, error)

GetFederationID returns the id which could represent the entire Federation or just the cluster if not federated.

func (*ClusterID) GetID Uses

func (ci *ClusterID) GetID() (string, error)

GetID returns the id which is unique to this cluster if federated, return the provider id (unique to the cluster) if not federated, return the cluster id

type ConfigFile Uses

type ConfigFile struct {
    Global ConfigGlobal `gcfg:"global"`
}

ConfigFile is the struct used to parse the /etc/gce.conf configuration file. NOTE: Cloud config files should follow the same Kubernetes deprecation policy as flags or CLIs. Config fields should not change behavior in incompatible ways and should be deprecated for at least 2 release prior to removing. See https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-a-flag-or-cli for more details.

type ConfigGlobal Uses

type ConfigGlobal struct {
    TokenURL  string `gcfg:"token-url"`
    TokenBody string `gcfg:"token-body" datapolicy:"token"`
    // ProjectID and NetworkProjectID can either be the numeric or string-based
    // unique identifier that starts with [a-z].
    ProjectID string `gcfg:"project-id"`
    // NetworkProjectID refers to the project which owns the network being used.
    NetworkProjectID string `gcfg:"network-project-id"`
    NetworkName      string `gcfg:"network-name"`
    SubnetworkName   string `gcfg:"subnetwork-name"`
    // DEPRECATED: Do not rely on this value as it may be incorrect.
    // SecondaryRangeName is the name of the secondary range to allocate IP
    // aliases. The secondary range must be present on the subnetwork the
    // cluster is attached to.
    SecondaryRangeName string   `gcfg:"secondary-range-name"`
    NodeTags           []string `gcfg:"node-tags"`
    NodeInstancePrefix string   `gcfg:"node-instance-prefix"`
    Regional           bool     `gcfg:"regional"`
    Multizone          bool     `gcfg:"multizone"`
    // APIEndpoint is the GCE compute API endpoint to use. If this is blank,
    // then the default endpoint is used.
    APIEndpoint string `gcfg:"api-endpoint"`
    // ContainerAPIEndpoint is the GCE container API endpoint to use. If this is blank,
    // then the default endpoint is used.
    ContainerAPIEndpoint string `gcfg:"container-api-endpoint"`
    // LocalZone specifies the GCE zone that gce cloud client instance is
    // located in (i.e. where the controller will be running). If this is
    // blank, then the local zone will be discovered via the metadata server.
    LocalZone string `gcfg:"local-zone"`
    // Default to none.
    // For example: MyFeatureFlag
    AlphaFeatures []string `gcfg:"alpha-features"`
}

ConfigGlobal is the in memory representation of the gce.conf config data TODO: replace gcfg with json

type Disk Uses

type Disk struct {
    ZoneInfo zoneType
    Region   string
    Name     string
    Kind     string
    Type     string
    SizeGb   int64
}

Disk holds all relevant data about an instance of GCE storage

type DiskType Uses

type DiskType string

DiskType defines a specific type for holding disk types (eg. pd-ssd)

type Disks Uses

type Disks interface {
    // AttachDisk attaches given disk to the node with the specified NodeName.
    // Current instance is used when instanceID is empty string.
    AttachDisk(diskName string, nodeName types.NodeName, readOnly bool, regional bool) error

    // DetachDisk detaches given disk to the node with the specified NodeName.
    // Current instance is used when nodeName is empty string.
    DetachDisk(devicePath string, nodeName types.NodeName) error

    // DiskIsAttached checks if a disk is attached to the node with the specified NodeName.
    DiskIsAttached(diskName string, nodeName types.NodeName) (bool, error)

    // DisksAreAttached is a batch function to check if a list of disks are attached
    // to the node with the specified NodeName.
    DisksAreAttached(diskNames []string, nodeName types.NodeName) (map[string]bool, error)

    // BulkDisksAreAttached is a batch function to check if all corresponding disks are attached to the
    // nodes specified with nodeName.
    BulkDisksAreAttached(diskByNodes map[types.NodeName][]string) (map[types.NodeName]map[string]bool, error)

    // CreateDisk creates a new PD with given properties. Tags are serialized
    // as JSON into Description field.
    CreateDisk(name string, diskType string, zone string, sizeGb int64, tags map[string]string) (*Disk, error)

    // CreateRegionalDisk creates a new Regional Persistent Disk, with the
    // specified properties, replicated to the specified zones. Tags are
    // serialized as JSON into Description field.
    CreateRegionalDisk(name string, diskType string, replicaZones sets.String, sizeGb int64, tags map[string]string) (*Disk, error)

    // DeleteDisk deletes PD.
    DeleteDisk(diskToDelete string) error

    // ResizeDisk resizes PD and returns new disk size
    ResizeDisk(diskToResize string, oldSize resource.Quantity, newSize resource.Quantity) (resource.Quantity, error)

    // GetAutoLabelsForPD returns labels to apply to PersistentVolume
    // representing this PD, namely failure domain and zone.
    GetAutoLabelsForPD(disk *Disk) (map[string]string, error)
}

Disks is interface for manipulation with GCE PDs.

type ILBOptions Uses

type ILBOptions struct {
    // AllowGlobalAccess Indicates whether global access is allowed for the LoadBalancer
    AllowGlobalAccess bool
    // SubnetName indicates which subnet the LoadBalancer VIPs should be assigned from
    SubnetName string
}

ILBOptions represents the extra options specified when creating a load balancer.

type L4ILBServiceState Uses

type L4ILBServiceState struct {
    // EnabledGlobalAccess specifies if Global Access is enabled.
    EnabledGlobalAccess bool
    // EnabledCustomSubNet specifies if Custom Subnet is enabled.
    EnabledCustomSubnet bool
    // InSuccess specifies if the ILB service VIP is configured.
    InSuccess bool
}

L4ILBServiceState contains Internal Loadbalancer feature states as specified in k8s Service.

type LoadBalancerMetrics Uses

type LoadBalancerMetrics struct {
    sync.Mutex
    // contains filtered or unexported fields
}

LoadBalancerMetrics is a cache that contains loadbalancer service resource states for computing usage metrics.

func (*LoadBalancerMetrics) DeleteL4ILBService Uses

func (lm *LoadBalancerMetrics) DeleteL4ILBService(svcKey string)

DeleteL4ILBService implements loadbalancerMetricsCollector.

func (*LoadBalancerMetrics) Run Uses

func (lm *LoadBalancerMetrics) Run(stopCh <-chan struct{})

Run implements loadbalancerMetricsCollector.

func (*LoadBalancerMetrics) SetL4ILBService Uses

func (lm *LoadBalancerMetrics) SetL4ILBService(svcKey string, state L4ILBServiceState)

SetL4ILBService implements loadbalancerMetricsCollector.

type LoadBalancerType Uses

type LoadBalancerType string

LoadBalancerType defines a specific type for holding load balancer types (eg. Internal)

func GetLoadBalancerAnnotationType Uses

func GetLoadBalancerAnnotationType(service *v1.Service) LoadBalancerType

GetLoadBalancerAnnotationType returns the type of GCP load balancer which should be assembled.

type Services Uses

type Services struct {
    // GA, Alpha, Beta versions of the compute API.
    GA    *compute.Service
    Alpha *computealpha.Service
    Beta  *computebeta.Service
}

Services is the set of all versions of the compute service.

type TestClusterValues Uses

type TestClusterValues struct {
    ProjectID         string
    Region            string
    ZoneName          string
    SecondaryZoneName string
    ClusterID         string
    ClusterName       string
    OnXPN             bool
}

TestClusterValues holds the config values for the fake/test gce cloud object.

func DefaultTestClusterValues Uses

func DefaultTestClusterValues() TestClusterValues

DefaultTestClusterValues Creates a reasonable set of default cluster values for generating a new test fake GCE cloud instance.

Package gce imports 64 packages (graph) and is imported by 127 packages. Updated 2020-11-07. Refresh now. Tools for package owners.