Documentation ¶
Overview ¶
Package gce is an implementation of Interface, LoadBalancer and Instances for Google Compute Engine.
Index ¶
- Constants
- func FirewallToGCloudCreateCmd(fw *compute.Firewall, projectID string) string
- func FirewallToGCloudDeleteCmd(fwName, projectID string) string
- func FirewallToGCloudUpdateCmd(fw *compute.Firewall, projectID string) string
- func GetGCERegion(zone string) (string, error)
- func GetLoadBalancerAnnotationBackendShare(service *v1.Service) bool
- func GetNodesHealthCheckPath() string
- func GetNodesHealthCheckPort() int32
- func GetServiceNetworkTier(service *v1.Service) (cloud.NetworkTier, error)
- func LoadBalancerSrcRanges() []string
- func MakeFirewallName(name string) string
- func MakeHealthCheckFirewallName(clusterID, hcName string, isNodesHealthCheck bool) string
- func MakeNodesHealthCheckName(clusterID string) string
- func NewAltTokenSource(tokenURL, tokenBody string) oauth2.TokenSource
- type AlphaFeatureGate
- type AltTokenSource
- type CloudAddressService
- type CloudConfig
- type CloudForwardingRuleService
- type ClusterID
- type ConfigFile
- type ConfigGlobal
- type DiskType
- type Disks
- type GCECloud
- func (gce *GCECloud) AddAliasToInstance(nodeName types.NodeName, alias *net.IPNet) error
- func (gce *GCECloud) AddInstancesToInstanceGroup(name string, zone string, instanceRefs []*compute.InstanceReference) error
- func (gce *GCECloud) AddInstancesToTargetPool(name, region string, instanceRefs []*compute.InstanceReference) error
- func (gce *GCECloud) AddRuletoBetaSecurityPolicy(name string, spr *computebeta.SecurityPolicyRule) error
- func (gce *GCECloud) AddSSHKeyToAllInstances(ctx context.Context, user string, keyData []byte) error
- func (gce *GCECloud) AggregatedListNetworkEndpointGroup() (map[string][]*computebeta.NetworkEndpointGroup, error)
- func (gce *GCECloud) AliasRanges(nodeName types.NodeName) (cidrs []string, err error)
- func (gce *GCECloud) AttachDisk(diskName string, nodeName types.NodeName, readOnly bool, regional bool) error
- func (gce *GCECloud) AttachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error
- func (gce *GCECloud) Clusters() (cloudprovider.Clusters, bool)
- func (g *GCECloud) Compute() cloud.Cloud
- func (g *GCECloud) ComputeServices() *Services
- func (g *GCECloud) ContainerService() *container.Service
- func (gce *GCECloud) CreateAlphaGlobalBackendService(bg *computealpha.BackendService) error
- func (gce *GCECloud) CreateAlphaHealthCheck(hc *computealpha.HealthCheck) error
- func (gce *GCECloud) CreateAlphaRegionForwardingRule(rule *computealpha.ForwardingRule, region string) error
- func (gce *GCECloud) CreateBetaGlobalBackendService(bg *computebeta.BackendService) error
- func (gce *GCECloud) CreateBetaHealthCheck(hc *computebeta.HealthCheck) error
- func (gce *GCECloud) CreateBetaSecurityPolicy(sp *computebeta.SecurityPolicy) error
- func (gce *GCECloud) CreateDisk(name string, diskType string, zone string, sizeGb int64, ...) error
- func (gce *GCECloud) CreateFirewall(f *compute.Firewall) error
- func (gce *GCECloud) CreateGlobalBackendService(bg *compute.BackendService) error
- func (gce *GCECloud) CreateGlobalForwardingRule(rule *compute.ForwardingRule) error
- func (gce *GCECloud) CreateHealthCheck(hc *compute.HealthCheck) error
- func (gce *GCECloud) CreateHttpHealthCheck(hc *compute.HttpHealthCheck) error
- func (gce *GCECloud) CreateHttpsHealthCheck(hc *compute.HttpsHealthCheck) error
- func (gce *GCECloud) CreateInstanceGroup(ig *compute.InstanceGroup, zone string) error
- func (gce *GCECloud) CreateNetworkEndpointGroup(neg *computebeta.NetworkEndpointGroup, zone string) error
- func (gce *GCECloud) CreateRegionBackendService(bg *compute.BackendService, region string) error
- func (gce *GCECloud) CreateRegionForwardingRule(rule *compute.ForwardingRule, region string) error
- func (gce *GCECloud) CreateRegionalDisk(name string, diskType string, replicaZones sets.String, sizeGb int64, ...) error
- func (gce *GCECloud) CreateRoute(ctx context.Context, clusterName string, nameHint string, ...) error
- func (gce *GCECloud) CreateSslCertificate(sslCerts *compute.SslCertificate) (*compute.SslCertificate, error)
- func (gce *GCECloud) CreateTPU(ctx context.Context, name, zone string, node *tpuapi.Node) (*tpuapi.Node, error)
- func (gce *GCECloud) CreateTargetHttpProxy(proxy *compute.TargetHttpProxy) error
- func (gce *GCECloud) CreateTargetHttpsProxy(proxy *compute.TargetHttpsProxy) error
- func (gce *GCECloud) CreateTargetPool(tp *compute.TargetPool, region string) error
- func (gce *GCECloud) CreateUrlMap(urlMap *compute.UrlMap) error
- func (gce *GCECloud) CurrentNodeName(ctx context.Context, hostname string) (types.NodeName, error)
- func (gce *GCECloud) DeleteBetaSecurityPolicy(name string) error
- func (gce *GCECloud) DeleteDisk(diskToDelete string) error
- func (gce *GCECloud) DeleteExternalTargetPoolAndChecks(service *v1.Service, name, region, clusterID string, hcNames ...string) error
- func (gce *GCECloud) DeleteFirewall(name string) error
- func (gce *GCECloud) DeleteGlobalAddress(name string) error
- func (gce *GCECloud) DeleteGlobalBackendService(name string) error
- func (gce *GCECloud) DeleteGlobalForwardingRule(name string) error
- func (gce *GCECloud) DeleteHealthCheck(name string) error
- func (gce *GCECloud) DeleteHttpHealthCheck(name string) error
- func (gce *GCECloud) DeleteHttpsHealthCheck(name string) error
- func (gce *GCECloud) DeleteInstance(project, zone, name string) error
- func (gce *GCECloud) DeleteInstanceGroup(name string, zone string) error
- func (gce *GCECloud) DeleteNetworkEndpointGroup(name string, zone string) error
- func (gce *GCECloud) DeleteRegionAddress(name, region string) error
- func (gce *GCECloud) DeleteRegionBackendService(name, region string) error
- func (gce *GCECloud) DeleteRegionForwardingRule(name, region string) error
- func (gce *GCECloud) DeleteRoute(ctx context.Context, clusterName string, route *cloudprovider.Route) error
- func (gce *GCECloud) DeleteSslCertificate(name string) error
- func (gce *GCECloud) DeleteTPU(ctx context.Context, name, zone string) error
- func (gce *GCECloud) DeleteTargetHttpProxy(name string) error
- func (gce *GCECloud) DeleteTargetHttpsProxy(name string) error
- func (gce *GCECloud) DeleteTargetPool(name, region string) error
- func (gce *GCECloud) DeleteUrlMap(name string) error
- func (gce *GCECloud) DetachDisk(devicePath string, nodeName types.NodeName) error
- func (gce *GCECloud) DetachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error
- func (gce *GCECloud) DiskIsAttached(diskName string, nodeName types.NodeName) (bool, error)
- func (gce *GCECloud) DisksAreAttached(diskNames []string, nodeName types.NodeName) (map[string]bool, error)
- func (gce *GCECloud) EnsureLoadBalancer(ctx context.Context, clusterName string, svc *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
- func (gce *GCECloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, svc *v1.Service) error
- func (gce *GCECloud) GetAllCurrentZones() (sets.String, error)
- func (gce *GCECloud) GetAllZonesFromCloudProvider() (sets.String, error)
- func (gce *GCECloud) GetAlphaGlobalBackendService(name string) (*computealpha.BackendService, error)
- func (gce *GCECloud) GetAlphaHealthCheck(name string) (*computealpha.HealthCheck, error)
- func (gce *GCECloud) GetAlphaRegionAddress(name, region string) (*computealpha.Address, error)
- func (gce *GCECloud) GetAlphaRegionForwardingRule(name, region string) (*computealpha.ForwardingRule, error)
- func (gce *GCECloud) GetAutoLabelsForPD(name string, zone string) (map[string]string, error)
- func (gce *GCECloud) GetBetaGlobalBackendService(name string) (*computebeta.BackendService, error)
- func (gce *GCECloud) GetBetaHealthCheck(name string) (*computebeta.HealthCheck, error)
- func (gce *GCECloud) GetBetaRegionAddress(name, region string) (*computebeta.Address, error)
- func (gce *GCECloud) GetBetaRegionAddressByIP(region, ipAddress string) (*computebeta.Address, error)
- func (gce *GCECloud) GetBetaSecurityPolicy(name string) (*computebeta.SecurityPolicy, error)
- func (gce *GCECloud) GetDiskByNameUnknownZone(diskName string) (*GCEDisk, error)
- func (gce *GCECloud) GetFirewall(name string) (*compute.Firewall, error)
- func (gce *GCECloud) GetGlobalAddress(name string) (*compute.Address, error)
- func (gce *GCECloud) GetGlobalBackendService(name string) (*compute.BackendService, error)
- func (gce *GCECloud) GetGlobalBackendServiceHealth(name string, instanceGroupLink string) (*compute.BackendServiceGroupHealth, error)
- func (gce *GCECloud) GetGlobalForwardingRule(name string) (*compute.ForwardingRule, error)
- func (gce *GCECloud) GetHealthCheck(name string) (*compute.HealthCheck, error)
- func (gce *GCECloud) GetHttpHealthCheck(name string) (*compute.HttpHealthCheck, error)
- func (gce *GCECloud) GetHttpsHealthCheck(name string) (*compute.HttpsHealthCheck, error)
- func (gce *GCECloud) GetInstanceGroup(name string, zone string) (*compute.InstanceGroup, error)
- func (gce *GCECloud) GetLabelsForVolume(ctx context.Context, pv *v1.PersistentVolume) (map[string]string, error)
- func (gce *GCECloud) GetLoadBalancer(ctx context.Context, clusterName string, svc *v1.Service) (*v1.LoadBalancerStatus, bool, error)
- func (gce *GCECloud) GetLoadBalancerName(ctx context.Context, clusterName string, svc *v1.Service) string
- func (gce *GCECloud) GetManagedClusters(ctx context.Context) ([]*container.Cluster, error)
- func (gce *GCECloud) GetNetworkEndpointGroup(name string, zone string) (*computebeta.NetworkEndpointGroup, error)
- func (gce *GCECloud) GetNodeTags(nodeNames []string) ([]string, error)
- func (gce *GCECloud) GetRegionAddress(name, region string) (*compute.Address, error)
- func (gce *GCECloud) GetRegionAddressByIP(region, ipAddress string) (*compute.Address, error)
- func (gce *GCECloud) GetRegionBackendService(name, region string) (*compute.BackendService, error)
- func (gce *GCECloud) GetRegionForwardingRule(name, region string) (*compute.ForwardingRule, error)
- func (gce *GCECloud) GetRegionalBackendServiceHealth(name, region string, instanceGroupLink string) (*compute.BackendServiceGroupHealth, error)
- func (gce *GCECloud) GetRuleForBetaSecurityPolicy(name string) (*computebeta.SecurityPolicyRule, error)
- func (gce *GCECloud) GetSslCertificate(name string) (*compute.SslCertificate, error)
- func (gce *GCECloud) GetTPU(ctx context.Context, name, zone string) (*tpuapi.Node, error)
- func (gce *GCECloud) GetTargetHttpProxy(name string) (*compute.TargetHttpProxy, error)
- func (gce *GCECloud) GetTargetHttpsProxy(name string) (*compute.TargetHttpsProxy, error)
- func (gce *GCECloud) GetTargetPool(name, region string) (*compute.TargetPool, error)
- func (gce *GCECloud) GetUrlMap(name string) (*compute.UrlMap, error)
- func (gce *GCECloud) GetZone(ctx context.Context) (cloudprovider.Zone, error)
- func (gce *GCECloud) GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (cloudprovider.Zone, error)
- func (gce *GCECloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)
- func (gce *GCECloud) HasClusterID() bool
- func (gce *GCECloud) Initialize(clientBuilder controller.ControllerClientBuilder)
- func (gce *GCECloud) InsertInstance(project string, zone string, i *compute.Instance) error
- func (gce *GCECloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)
- func (gce *GCECloud) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error)
- func (gce *GCECloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
- func (gce *GCECloud) InstanceType(ctx context.Context, nodeName types.NodeName) (string, error)
- func (gce *GCECloud) InstanceTypeByProviderID(ctx context.Context, providerID string) (string, error)
- func (gce *GCECloud) Instances() (cloudprovider.Instances, bool)
- func (gce *GCECloud) IsLegacyNetwork() bool
- func (gce *GCECloud) ListAlphaRegionForwardingRules(region string) ([]*computealpha.ForwardingRule, error)
- func (gce *GCECloud) ListBetaSecurityPolicy() ([]*computebeta.SecurityPolicy, error)
- func (gce *GCECloud) ListClusters(ctx context.Context) ([]string, error)
- func (gce *GCECloud) ListGlobalBackendServices() ([]*compute.BackendService, error)
- func (gce *GCECloud) ListGlobalForwardingRules() ([]*compute.ForwardingRule, error)
- func (gce *GCECloud) ListHealthChecks() ([]*compute.HealthCheck, error)
- func (gce *GCECloud) ListHttpHealthChecks() ([]*compute.HttpHealthCheck, error)
- func (gce *GCECloud) ListHttpsHealthChecks() ([]*compute.HttpsHealthCheck, error)
- func (gce *GCECloud) ListInstanceGroups(zone string) ([]*compute.InstanceGroup, error)
- func (gce *GCECloud) ListInstanceNames(project, zone string) (string, error)
- func (gce *GCECloud) ListInstancesInInstanceGroup(name string, zone string, state string) ([]*compute.InstanceWithNamedPorts, error)
- func (gce *GCECloud) ListLocations(ctx context.Context) ([]*tpuapi.Location, error)
- func (gce *GCECloud) ListNetworkEndpointGroup(zone string) ([]*computebeta.NetworkEndpointGroup, error)
- func (gce *GCECloud) ListNetworkEndpoints(name, zone string, showHealthStatus bool) ([]*computebeta.NetworkEndpointWithHealthStatus, error)
- func (gce *GCECloud) ListRegionBackendServices(region string) ([]*compute.BackendService, error)
- func (gce *GCECloud) ListRegionForwardingRules(region string) ([]*compute.ForwardingRule, error)
- func (gce *GCECloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudprovider.Route, error)
- func (gce *GCECloud) ListSslCertificates() ([]*compute.SslCertificate, error)
- func (gce *GCECloud) ListTPUs(ctx context.Context, zone string) ([]*tpuapi.Node, error)
- func (gce *GCECloud) ListTargetHttpProxies() ([]*compute.TargetHttpProxy, error)
- func (gce *GCECloud) ListTargetHttpsProxies() ([]*compute.TargetHttpsProxy, error)
- func (gce *GCECloud) ListUrlMaps() ([]*compute.UrlMap, error)
- func (gce *GCECloud) ListZonesInRegion(region string) ([]*compute.Zone, error)
- func (gce *GCECloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (gce *GCECloud) Master(ctx context.Context, clusterName string) (string, error)
- func (g *GCECloud) NetworkProjectID() string
- func (gce *GCECloud) NetworkURL() string
- func (gce *GCECloud) NodeAddresses(_ context.Context, _ types.NodeName) ([]v1.NodeAddress, error)
- func (gce *GCECloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)
- func (gce *GCECloud) OnXPN() bool
- func (gce *GCECloud) PatchBetaSecurityPolicy(sp *computebeta.SecurityPolicy) error
- func (gce *GCECloud) PatchRuleForBetaSecurityPolicy(name string, spr *computebeta.SecurityPolicyRule) error
- func (g *GCECloud) ProjectID() string
- func (gce *GCECloud) ProviderName() string
- func (gce *GCECloud) Region() string
- func (gce *GCECloud) RemoveInstancesFromInstanceGroup(name string, zone string, instanceRefs []*compute.InstanceReference) error
- func (gce *GCECloud) RemoveInstancesFromTargetPool(name, region string, instanceRefs []*compute.InstanceReference) error
- func (gce *GCECloud) RemoveRuleFromBetaSecurityPolicy(name string) error
- func (gce *GCECloud) ReserveAlphaRegionAddress(addr *computealpha.Address, region string) error
- func (gce *GCECloud) ReserveBetaRegionAddress(addr *computebeta.Address, region string) error
- func (gce *GCECloud) ReserveGlobalAddress(addr *compute.Address) error
- func (gce *GCECloud) ReserveRegionAddress(addr *compute.Address, region string) error
- func (gce *GCECloud) ResizeDisk(diskToResize string, oldSize resource.Quantity, newSize resource.Quantity) (resource.Quantity, error)
- func (gce *GCECloud) Routes() (cloudprovider.Routes, bool)
- func (gce *GCECloud) SetInformers(informerFactory informers.SharedInformerFactory)
- func (gce *GCECloud) SetNamedPortsOfInstanceGroup(igName, zone string, namedPorts []*compute.NamedPort) error
- func (gce *GCECloud) SetProxyForGlobalForwardingRule(forwardingRuleName, targetProxyLink string) error
- func (g *GCECloud) SetRateLimiter(rl cloud.RateLimiter)
- func (gce *GCECloud) SetSecurityPolicyForAlphaGlobalBackendService(backendServiceName string, ...) error
- func (gce *GCECloud) SetSecurityPolicyForBetaGlobalBackendService(backendServiceName string, ...) error
- func (gce *GCECloud) SetSslCertificateForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, sslCertURLs []string) error
- func (gce *GCECloud) SetUrlMapForTargetHttpProxy(proxy *compute.TargetHttpProxy, urlMapLink string) error
- func (gce *GCECloud) SetUrlMapForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, urlMapLink string) error
- func (gce *GCECloud) SubnetworkURL() string
- func (gce *GCECloud) ToInstanceReferences(zone string, instanceNames []string) (refs []*compute.InstanceReference)
- func (gce *GCECloud) UpdateAlphaGlobalBackendService(bg *computealpha.BackendService) error
- func (gce *GCECloud) UpdateAlphaHealthCheck(hc *computealpha.HealthCheck) error
- func (gce *GCECloud) UpdateBetaGlobalBackendService(bg *computebeta.BackendService) error
- func (gce *GCECloud) UpdateBetaHealthCheck(hc *computebeta.HealthCheck) error
- func (gce *GCECloud) UpdateFirewall(f *compute.Firewall) error
- func (gce *GCECloud) UpdateGlobalBackendService(bg *compute.BackendService) error
- func (gce *GCECloud) UpdateHealthCheck(hc *compute.HealthCheck) error
- func (gce *GCECloud) UpdateHttpHealthCheck(hc *compute.HttpHealthCheck) error
- func (gce *GCECloud) UpdateHttpsHealthCheck(hc *compute.HttpsHealthCheck) error
- func (gce *GCECloud) UpdateLoadBalancer(ctx context.Context, clusterName string, svc *v1.Service, nodes []*v1.Node) error
- func (gce *GCECloud) UpdateRegionBackendService(bg *compute.BackendService, region string) error
- func (gce *GCECloud) UpdateUrlMap(urlMap *compute.UrlMap) error
- func (gce *GCECloud) Zones() (cloudprovider.Zones, bool)
- type GCEDisk
- type LoadBalancerType
- type Services
Constants ¶
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 = "cloud.google.com/load-balancer-type" LBTypeInternal LoadBalancerType = "Internal" // 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" // 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 = cloud.NetworkTierStandard NetworkTierAnnotationPremium = cloud.NetworkTierPremium )
const ( // Key used to persist UIDs to configmaps. UIDConfigMapName = "ingress-uid" // Namespace which contains the above config map UIDNamespace = metav1.NamespaceSystem // Data keys for the specific ids UIDCluster = "uid" UIDProvider = "provider-uid" UIDLengthBytes = 8 )
const ( DiskTypeSSD = "pd-ssd" DiskTypeStandard = "pd-standard" )
const ( // alpha: v1.8 (for Services) // // Allows Services backed by a GCP load balancer to choose what network // tier to use. Currently supports "Standard" and "Premium" (default). AlphaFeatureNetworkTiers = "NetworkTiers" )
const (
NEGIPPortNetworkEndpointType = "GCE_VM_IP_PORT"
)
const (
ProviderName = "gce"
)
Variables ¶
This section is empty.
Functions ¶
func FirewallToGCloudCreateCmd ¶
FirewallToGCloudCreateCmd generates a gcloud command to create a firewall with specified params
func FirewallToGCloudDeleteCmd ¶
FirewallToGCloudCreateCmd generates a gcloud command to delete a firewall to specified params
func FirewallToGCloudUpdateCmd ¶
FirewallToGCloudCreateCmd generates a gcloud command to update a firewall to specified params
func GetGCERegion ¶
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 GetLoadBalancerAnnotationBackendShare ¶
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 GetNodesHealthCheckPath ¶
func GetNodesHealthCheckPath() string
GetNodesHealthCheckPath returns the health check path used by the GCE load balancers (l4) for performing health checks on nodes.
func GetNodesHealthCheckPort ¶
func GetNodesHealthCheckPort() int32
GetNodesHealthCheckPort returns the health check port used by the GCE load balancers (l4) for performing health checks on nodes.
func GetServiceNetworkTier ¶
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 LoadBalancerSrcRanges ¶
func LoadBalancerSrcRanges() []string
LoadBalancerSrcRanges contains the ranges of ips used by the GCE load balancers (l4 & L7) for proxying client requests and performing health checks.
func MakeFirewallName ¶
MakeFirewallName returns the firewall name used by the GCE load balancers (l4) for serving traffic.
func MakeHealthCheckFirewallName ¶
MakeHealthCheckFirewallName returns the firewall name used by the GCE load balancers (l4) for performing health checks.
func MakeNodesHealthCheckName ¶
MakeNodesHealthCheckName returns name of the health check resource used by the GCE load balancers (l4) for performing health checks on nodes.
func NewAltTokenSource ¶
func NewAltTokenSource(tokenURL, tokenBody string) oauth2.TokenSource
Types ¶
type AlphaFeatureGate ¶
type AlphaFeatureGate struct {
// contains filtered or unexported fields
}
func NewAlphaFeatureGate ¶
func NewAlphaFeatureGate(features []string) *AlphaFeatureGate
func (*AlphaFeatureGate) Enabled ¶
func (af *AlphaFeatureGate) Enabled(key string) bool
type AltTokenSource ¶
type AltTokenSource struct {
// contains filtered or unexported fields
}
type CloudAddressService ¶
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 // Alpha API. GetAlphaRegionAddress(name, region string) (*computealpha.Address, error) ReserveAlphaRegionAddress(addr *computealpha.Address, 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 ¶
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 SecondaryRangeName string NodeTags []string NodeInstancePrefix string TokenSource oauth2.TokenSource UseMetadataServer bool AlphaFeatureGate *AlphaFeatureGate }
CloudConfig includes all the necessary configuration for creating GCECloud
type CloudForwardingRuleService ¶
type CloudForwardingRuleService interface { GetRegionForwardingRule(name, region string) (*compute.ForwardingRule, error) CreateRegionForwardingRule(rule *compute.ForwardingRule, region string) error DeleteRegionForwardingRule(name, region string) error // Alpha API. GetAlphaRegionForwardingRule(name, region string) (*computealpha.ForwardingRule, error) CreateAlphaRegionForwardingRule(rule *computealpha.ForwardingRule, 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 ¶
type ClusterID struct {
// contains filtered or unexported fields
}
func (*ClusterID) GetFederationId ¶
GetFederationId returns the id which could represent the entire Federation or just the cluster if not federated.
type ConfigFile ¶
type ConfigFile struct {
Global ConfigGlobal `gcfg:"global"`
}
ConfigFile is the struct used to parse the /etc/gce.conf configuration file.
type ConfigGlobal ¶
type ConfigGlobal struct { TokenURL string `gcfg:"token-url"` TokenBody string `gcfg:"token-body"` // 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"` // 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"` }
TODO: replace gcfg with json
type Disks ¶
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) // 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) 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) 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. // zone can be provided to specify the zone for the PD, // if empty all managed zones will be searched. GetAutoLabelsForPD(name string, zone string) (map[string]string, error) }
Disks is interface for manipulation with GCE PDs.
type GCECloud ¶
type GCECloud struct { // ClusterID contains functionality for getting (and initializing) the ingress-uid. Call GCECloud.Initialize() // for the cloudprovider to start watching the configmap. ClusterID ClusterID // AlphaFeatureGate gates gce alpha features in GCECloud 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 }
GCECloud is an implementation of Interface, LoadBalancer and Instances for Google Compute Engine.
func CreateGCECloud ¶
func CreateGCECloud(config *CloudConfig) (*GCECloud, error)
CreateGCECloud creates a GCECloud 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 ¶
func CreateGCECloudWithCloud(config *CloudConfig, c cloud.Cloud) (*GCECloud, error)
CreateGCECloudWithCloud is a helper function to create an instance of GCECloud 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 (*GCECloud) AddAliasToInstance ¶
AddAliasToInstance adds an alias to the given instance from the named secondary range.
func (*GCECloud) AddInstancesToInstanceGroup ¶
func (gce *GCECloud) AddInstancesToInstanceGroup(name string, zone string, instanceRefs []*compute.InstanceReference) error
AddInstancesToInstanceGroup adds the given instances to the given instance group.
func (*GCECloud) AddInstancesToTargetPool ¶
func (gce *GCECloud) AddInstancesToTargetPool(name, region string, instanceRefs []*compute.InstanceReference) error
AddInstancesToTargetPool adds instances by link to the TargetPool
func (*GCECloud) AddRuletoBetaSecurityPolicy ¶
func (gce *GCECloud) AddRuletoBetaSecurityPolicy(name string, spr *computebeta.SecurityPolicyRule) error
AddRuletoBetaSecurityPolicy adds the given security policy rule to a security policy.
func (*GCECloud) AddSSHKeyToAllInstances ¶
func (*GCECloud) AggregatedListNetworkEndpointGroup ¶
func (gce *GCECloud) AggregatedListNetworkEndpointGroup() (map[string][]*computebeta.NetworkEndpointGroup, error)
AggregatedListNetworkEndpointGroup returns a map of zone -> endpoint group.
func (*GCECloud) AliasRanges ¶
AliasRanges 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 (*GCECloud) AttachDisk ¶
func (*GCECloud) AttachNetworkEndpoints ¶
func (gce *GCECloud) AttachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error
func (*GCECloud) ComputeServices ¶
ComputeServices returns access to the internal compute services.
func (*GCECloud) ContainerService ¶
ContainerService returns the container service.
func (*GCECloud) CreateAlphaGlobalBackendService ¶
func (gce *GCECloud) CreateAlphaGlobalBackendService(bg *computealpha.BackendService) error
CreateAlphaGlobalBackendService creates the given alpha BackendService.
func (*GCECloud) CreateAlphaHealthCheck ¶
func (gce *GCECloud) CreateAlphaHealthCheck(hc *computealpha.HealthCheck) error
CreateAlphaHealthCheck creates the given alpha HealthCheck.
func (*GCECloud) CreateAlphaRegionForwardingRule ¶
func (gce *GCECloud) CreateAlphaRegionForwardingRule(rule *computealpha.ForwardingRule, region string) error
CreateAlphaRegionForwardingRule creates and returns an Alpha forwarding fule in the given region.
func (*GCECloud) CreateBetaGlobalBackendService ¶
func (gce *GCECloud) CreateBetaGlobalBackendService(bg *computebeta.BackendService) error
CreateBetaGlobalBackendService creates the given beta BackendService.
func (*GCECloud) CreateBetaHealthCheck ¶
func (gce *GCECloud) CreateBetaHealthCheck(hc *computebeta.HealthCheck) error
CreateBetaHealthCheck creates the given beta HealthCheck.
func (*GCECloud) CreateBetaSecurityPolicy ¶
func (gce *GCECloud) CreateBetaSecurityPolicy(sp *computebeta.SecurityPolicy) error
CreateBetaSecurityPolicy creates the given security policy.
func (*GCECloud) CreateDisk ¶
func (gce *GCECloud) CreateDisk( name string, diskType string, zone string, sizeGb int64, tags map[string]string) 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 (*GCECloud) CreateFirewall ¶
CreateFirewall creates the passed firewall
func (*GCECloud) CreateGlobalBackendService ¶
func (gce *GCECloud) CreateGlobalBackendService(bg *compute.BackendService) error
CreateGlobalBackendService creates the given BackendService.
func (*GCECloud) CreateGlobalForwardingRule ¶
func (gce *GCECloud) CreateGlobalForwardingRule(rule *compute.ForwardingRule) error
CreateGlobalForwardingRule creates the passed GlobalForwardingRule
func (*GCECloud) CreateHealthCheck ¶
func (gce *GCECloud) CreateHealthCheck(hc *compute.HealthCheck) error
CreateHealthCheck creates the given HealthCheck.
func (*GCECloud) CreateHttpHealthCheck ¶
func (gce *GCECloud) CreateHttpHealthCheck(hc *compute.HttpHealthCheck) error
CreateHttpHealthCheck creates the given HttpHealthCheck.
func (*GCECloud) CreateHttpsHealthCheck ¶
func (gce *GCECloud) CreateHttpsHealthCheck(hc *compute.HttpsHealthCheck) error
CreateHttpsHealthCheck creates the given HttpsHealthCheck.
func (*GCECloud) CreateInstanceGroup ¶
func (gce *GCECloud) 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 (*GCECloud) CreateNetworkEndpointGroup ¶
func (gce *GCECloud) CreateNetworkEndpointGroup(neg *computebeta.NetworkEndpointGroup, zone string) error
func (*GCECloud) CreateRegionBackendService ¶
func (gce *GCECloud) CreateRegionBackendService(bg *compute.BackendService, region string) error
CreateRegionBackendService creates the given BackendService.
func (*GCECloud) CreateRegionForwardingRule ¶
func (gce *GCECloud) CreateRegionForwardingRule(rule *compute.ForwardingRule, region string) error
CreateRegionForwardingRule creates and returns a RegionalForwardingRule that points to the given BackendService
func (*GCECloud) CreateRegionalDisk ¶
func (gce *GCECloud) CreateRegionalDisk( name string, diskType string, replicaZones sets.String, sizeGb int64, tags map[string]string) 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 (*GCECloud) CreateRoute ¶
func (gce *GCECloud) CreateRoute(ctx context.Context, clusterName string, nameHint string, route *cloudprovider.Route) error
CreateRoute in the cloud environment.
func (*GCECloud) CreateSslCertificate ¶
func (gce *GCECloud) CreateSslCertificate(sslCerts *compute.SslCertificate) (*compute.SslCertificate, error)
CreateSslCertificate creates and returns a SslCertificate.
func (*GCECloud) CreateTPU ¶
func (gce *GCECloud) 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 (*GCECloud) CreateTargetHttpProxy ¶
func (gce *GCECloud) CreateTargetHttpProxy(proxy *compute.TargetHttpProxy) error
CreateTargetHttpProxy creates a TargetHttpProxy
func (*GCECloud) CreateTargetHttpsProxy ¶
func (gce *GCECloud) CreateTargetHttpsProxy(proxy *compute.TargetHttpsProxy) error
CreateTargetHttpsProxy creates a TargetHttpsProxy
func (*GCECloud) CreateTargetPool ¶
func (gce *GCECloud) CreateTargetPool(tp *compute.TargetPool, region string) error
CreateTargetPool creates the passed TargetPool
func (*GCECloud) CreateUrlMap ¶
CreateUrlMap creates a url map
func (*GCECloud) CurrentNodeName ¶
Implementation of Instances.CurrentNodeName
func (*GCECloud) DeleteBetaSecurityPolicy ¶
DeleteBetaSecurityPolicy deletes the given security policy.
func (*GCECloud) DeleteDisk ¶
func (*GCECloud) DeleteExternalTargetPoolAndChecks ¶
func (*GCECloud) DeleteFirewall ¶
DeleteFirewall deletes the given firewall rule.
func (*GCECloud) DeleteGlobalAddress ¶
DeleteGlobalAddress deletes a global address by name.
func (*GCECloud) DeleteGlobalBackendService ¶
DeleteGlobalBackendService deletes the given BackendService by name.
func (*GCECloud) DeleteGlobalForwardingRule ¶
DeleteGlobalForwardingRule deletes the GlobalForwardingRule by name.
func (*GCECloud) DeleteHealthCheck ¶
DeleteHealthCheck deletes the given HealthCheck by name.
func (*GCECloud) DeleteHttpHealthCheck ¶
DeleteHttpHealthCheck deletes the given HttpHealthCheck by name.
func (*GCECloud) DeleteHttpsHealthCheck ¶
DeleteHttpsHealthCheck deletes the given HttpsHealthCheck by name.
func (*GCECloud) DeleteInstance ¶
DeleteInstance deletes an instance specified by project, zone, and name
func (*GCECloud) DeleteInstanceGroup ¶
DeleteInstanceGroup deletes an instance group.
func (*GCECloud) DeleteNetworkEndpointGroup ¶
func (*GCECloud) DeleteRegionAddress ¶
DeleteRegionAddress deletes a region address by name.
func (*GCECloud) DeleteRegionBackendService ¶
DeleteRegionBackendService deletes the given BackendService by name.
func (*GCECloud) DeleteRegionForwardingRule ¶
DeleteRegionForwardingRule deletes the RegionalForwardingRule by name & region.
func (*GCECloud) DeleteRoute ¶
func (gce *GCECloud) DeleteRoute(ctx context.Context, clusterName string, route *cloudprovider.Route) error
DeleteRoute from the cloud environment.
func (*GCECloud) DeleteSslCertificate ¶
DeleteSslCertificate deletes the SslCertificate by name.
func (*GCECloud) DeleteTPU ¶
DeleteTPU deletes the Cloud TPU with the specified name in the specified zone.
func (*GCECloud) DeleteTargetHttpProxy ¶
DeleteTargetHttpProxy deletes the TargetHttpProxy by name.
func (*GCECloud) DeleteTargetHttpsProxy ¶
DeleteTargetHttpsProxy deletes the TargetHttpsProxy by name.
func (*GCECloud) DeleteTargetPool ¶
DeleteTargetPool deletes TargetPool by name.
func (*GCECloud) DeleteUrlMap ¶
DeleteUrlMap deletes a url map by name.
func (*GCECloud) DetachDisk ¶
func (*GCECloud) DetachNetworkEndpoints ¶
func (gce *GCECloud) DetachNetworkEndpoints(name, zone string, endpoints []*computebeta.NetworkEndpoint) error
func (*GCECloud) DiskIsAttached ¶
func (*GCECloud) DisksAreAttached ¶
func (*GCECloud) EnsureLoadBalancer ¶
func (gce *GCECloud) EnsureLoadBalancer(ctx context.Context, clusterName string, svc *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
EnsureLoadBalancer is an implementation of LoadBalancer.EnsureLoadBalancer.
func (*GCECloud) EnsureLoadBalancerDeleted ¶
func (gce *GCECloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName string, svc *v1.Service) error
EnsureLoadBalancerDeleted is an implementation of LoadBalancer.EnsureLoadBalancerDeleted.
func (*GCECloud) GetAllCurrentZones ¶
GetAllCurrentZones returns all the zones in which k8s nodes are currently running
func (*GCECloud) GetAllZonesFromCloudProvider ¶
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 (*GCECloud) GetAlphaGlobalBackendService ¶
func (gce *GCECloud) GetAlphaGlobalBackendService(name string) (*computealpha.BackendService, error)
GetAlphaGlobalBackendService retrieves alpha backend by name.
func (*GCECloud) GetAlphaHealthCheck ¶
func (gce *GCECloud) GetAlphaHealthCheck(name string) (*computealpha.HealthCheck, error)
GetAlphaHealthCheck returns the given alpha HealthCheck by name.
func (*GCECloud) GetAlphaRegionAddress ¶
func (gce *GCECloud) GetAlphaRegionAddress(name, region string) (*computealpha.Address, error)
GetAlphaRegionAddress returns the Alpha, regional address by name.
func (*GCECloud) GetAlphaRegionForwardingRule ¶
func (gce *GCECloud) GetAlphaRegionForwardingRule(name, region string) (*computealpha.ForwardingRule, error)
GetAlphaRegionForwardingRule returns the Alpha forwarding rule by name & region.
func (*GCECloud) 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. If zone is specified, the volume will only be found in the specified zone, otherwise all managed zones will be searched.
func (*GCECloud) GetBetaGlobalBackendService ¶
func (gce *GCECloud) GetBetaGlobalBackendService(name string) (*computebeta.BackendService, error)
GetBetaGlobalBackendService retrieves beta backend by name.
func (*GCECloud) GetBetaHealthCheck ¶
func (gce *GCECloud) GetBetaHealthCheck(name string) (*computebeta.HealthCheck, error)
GetBetaHealthCheck returns the given beta HealthCheck by name.
func (*GCECloud) GetBetaRegionAddress ¶
func (gce *GCECloud) GetBetaRegionAddress(name, region string) (*computebeta.Address, error)
GetBetaRegionAddress returns the beta region address by name
func (*GCECloud) GetBetaRegionAddressByIP ¶
func (gce *GCECloud) GetBetaRegionAddressByIP(region, ipAddress string) (*computebeta.Address, error)
GetBetaRegionAddressByIP returns the beta regional address matching the given IP address.
func (*GCECloud) GetBetaSecurityPolicy ¶
func (gce *GCECloud) GetBetaSecurityPolicy(name string) (*computebeta.SecurityPolicy, error)
GetBetaSecurityPolicy retrieves a security policy.
func (*GCECloud) 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 (*GCECloud) GetFirewall ¶
GetFirewall returns the Firewall by name.
func (*GCECloud) GetGlobalAddress ¶
GetGlobalAddress returns the global address by name.
func (*GCECloud) GetGlobalBackendService ¶
func (gce *GCECloud) GetGlobalBackendService(name string) (*compute.BackendService, error)
GetGlobalBackendService retrieves a backend by name.
func (*GCECloud) GetGlobalBackendServiceHealth ¶
func (gce *GCECloud) 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 (*GCECloud) GetGlobalForwardingRule ¶
func (gce *GCECloud) GetGlobalForwardingRule(name string) (*compute.ForwardingRule, error)
GetGlobalForwardingRule returns the GlobalForwardingRule by name.
func (*GCECloud) GetHealthCheck ¶
func (gce *GCECloud) GetHealthCheck(name string) (*compute.HealthCheck, error)
GetHealthCheck returns the given HealthCheck by name.
func (*GCECloud) GetHttpHealthCheck ¶
func (gce *GCECloud) GetHttpHealthCheck(name string) (*compute.HttpHealthCheck, error)
GetHttpHealthCheck returns the given HttpHealthCheck by name.
func (*GCECloud) GetHttpsHealthCheck ¶
func (gce *GCECloud) GetHttpsHealthCheck(name string) (*compute.HttpsHealthCheck, error)
GetHttpsHealthCheck returns the given HttpsHealthCheck by name.
func (*GCECloud) GetInstanceGroup ¶
GetInstanceGroup returns an instance group by name.
func (*GCECloud) GetLabelsForVolume ¶
func (*GCECloud) GetLoadBalancer ¶
func (gce *GCECloud) GetLoadBalancer(ctx context.Context, clusterName string, svc *v1.Service) (*v1.LoadBalancerStatus, bool, error)
GetLoadBalancer is an implementation of LoadBalancer.GetLoadBalancer
func (*GCECloud) GetLoadBalancerName ¶
func (gce *GCECloud) GetLoadBalancerName(ctx context.Context, clusterName string, svc *v1.Service) string
GetLoadBalancerName is an implementation of LoadBalancer.GetLoadBalancerName.
func (*GCECloud) GetManagedClusters ¶
func (*GCECloud) GetNetworkEndpointGroup ¶
func (gce *GCECloud) GetNetworkEndpointGroup(name string, zone string) (*computebeta.NetworkEndpointGroup, error)
func (*GCECloud) GetNodeTags ¶
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 (*GCECloud) GetRegionAddress ¶
GetRegionAddress returns the region address by name
func (*GCECloud) GetRegionAddressByIP ¶
GetRegionAddressByIP returns the regional address matching the given IP address.
func (*GCECloud) GetRegionBackendService ¶
func (gce *GCECloud) GetRegionBackendService(name, region string) (*compute.BackendService, error)
GetRegionBackendService retrieves a backend by name.
func (*GCECloud) GetRegionForwardingRule ¶
func (gce *GCECloud) GetRegionForwardingRule(name, region string) (*compute.ForwardingRule, error)
GetRegionForwardingRule returns the RegionalForwardingRule by name & region.
func (*GCECloud) GetRegionalBackendServiceHealth ¶
func (gce *GCECloud) 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 (*GCECloud) GetRuleForBetaSecurityPolicy ¶
func (gce *GCECloud) GetRuleForBetaSecurityPolicy(name string) (*computebeta.SecurityPolicyRule, error)
GetRuleForBetaSecurityPolicy gets rule from a security policy.
func (*GCECloud) GetSslCertificate ¶
func (gce *GCECloud) GetSslCertificate(name string) (*compute.SslCertificate, error)
GetSslCertificate returns the SslCertificate by name.
func (*GCECloud) GetTPU ¶
GetTPU returns the Cloud TPU with the specified name in the specified zone.
func (*GCECloud) GetTargetHttpProxy ¶
func (gce *GCECloud) GetTargetHttpProxy(name string) (*compute.TargetHttpProxy, error)
GetTargetHttpProxy returns the UrlMap by name.
func (*GCECloud) GetTargetHttpsProxy ¶
func (gce *GCECloud) GetTargetHttpsProxy(name string) (*compute.TargetHttpsProxy, error)
GetTargetHttpsProxy returns the UrlMap by name.
func (*GCECloud) GetTargetPool ¶
func (gce *GCECloud) GetTargetPool(name, region string) (*compute.TargetPool, error)
GetTargetPool returns the TargetPool by name.
func (*GCECloud) GetZoneByNodeName ¶
func (gce *GCECloud) 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 (*GCECloud) GetZoneByProviderID ¶
func (gce *GCECloud) 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 (*GCECloud) HasClusterID ¶
HasClusterID returns true if the cluster has a clusterID
func (*GCECloud) Initialize ¶
func (gce *GCECloud) Initialize(clientBuilder controller.ControllerClientBuilder)
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 (*GCECloud) InsertInstance ¶
InsertInstance creates a new instance on GCP
func (*GCECloud) InstanceExistsByProviderID ¶
func (gce *GCECloud) 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 (*GCECloud) InstanceID ¶
InstanceID returns the cloud provider ID of the node with the specified NodeName.
func (*GCECloud) InstanceShutdownByProviderID ¶
func (gce *GCECloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)
InstanceShutdownByProviderID returns true if the instance is in safe state to detach volumes
func (*GCECloud) InstanceType ¶
InstanceType returns the type of the specified node with the specified NodeName.
func (*GCECloud) InstanceTypeByProviderID ¶
func (gce *GCECloud) 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 (*GCECloud) Instances ¶
func (gce *GCECloud) Instances() (cloudprovider.Instances, bool)
Instances returns an implementation of Instances for Google Compute Engine.
func (*GCECloud) IsLegacyNetwork ¶
func (*GCECloud) ListAlphaRegionForwardingRules ¶
func (gce *GCECloud) ListAlphaRegionForwardingRules(region string) ([]*computealpha.ForwardingRule, error)
ListAlphaRegionForwardingRules lists all RegionalForwardingRules in the project & region.
func (*GCECloud) ListBetaSecurityPolicy ¶
func (gce *GCECloud) ListBetaSecurityPolicy() ([]*computebeta.SecurityPolicy, error)
ListBetaSecurityPolicy lists all security policies in the project.
func (*GCECloud) ListClusters ¶
func (*GCECloud) ListGlobalBackendServices ¶
func (gce *GCECloud) ListGlobalBackendServices() ([]*compute.BackendService, error)
ListGlobalBackendServices lists all backend services in the project.
func (*GCECloud) ListGlobalForwardingRules ¶
func (gce *GCECloud) ListGlobalForwardingRules() ([]*compute.ForwardingRule, error)
ListGlobalForwardingRules lists all GlobalForwardingRules in the project.
func (*GCECloud) ListHealthChecks ¶
func (gce *GCECloud) ListHealthChecks() ([]*compute.HealthCheck, error)
ListHealthChecks lists all HealthCheck in the project.
func (*GCECloud) ListHttpHealthChecks ¶
func (gce *GCECloud) ListHttpHealthChecks() ([]*compute.HttpHealthCheck, error)
ListHttpHealthChecks lists all HttpHealthChecks in the project.
func (*GCECloud) ListHttpsHealthChecks ¶
func (gce *GCECloud) ListHttpsHealthChecks() ([]*compute.HttpsHealthCheck, error)
ListHttpsHealthChecks lists all HttpsHealthChecks in the project.
func (*GCECloud) ListInstanceGroups ¶
func (gce *GCECloud) ListInstanceGroups(zone string) ([]*compute.InstanceGroup, error)
ListInstanceGroups lists all InstanceGroups in the project and zone.
func (*GCECloud) ListInstanceNames ¶
ListInstanceNames returns a string of instance names separated by spaces. This method should only be used for e2e testing. TODO: remove this method.
func (*GCECloud) ListInstancesInInstanceGroup ¶
func (gce *GCECloud) ListInstancesInInstanceGroup(name string, zone string, state string) ([]*compute.InstanceWithNamedPorts, error)
ListInstancesInInstanceGroup lists all the instances in a given instance group and state.
func (*GCECloud) ListLocations ¶
ListLocations returns the zones where Cloud TPUs are available.
func (*GCECloud) ListNetworkEndpointGroup ¶
func (gce *GCECloud) ListNetworkEndpointGroup(zone string) ([]*computebeta.NetworkEndpointGroup, error)
func (*GCECloud) ListNetworkEndpoints ¶
func (gce *GCECloud) ListNetworkEndpoints(name, zone string, showHealthStatus bool) ([]*computebeta.NetworkEndpointWithHealthStatus, error)
func (*GCECloud) ListRegionBackendServices ¶
func (gce *GCECloud) ListRegionBackendServices(region string) ([]*compute.BackendService, error)
ListRegionBackendServices lists all backend services in the project.
func (*GCECloud) ListRegionForwardingRules ¶
func (gce *GCECloud) ListRegionForwardingRules(region string) ([]*compute.ForwardingRule, error)
ListRegionForwardingRules lists all RegionalForwardingRules in the project & region.
func (*GCECloud) ListRoutes ¶
func (gce *GCECloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudprovider.Route, error)
ListRoutes in the cloud environment.
func (*GCECloud) ListSslCertificates ¶
func (gce *GCECloud) ListSslCertificates() ([]*compute.SslCertificate, error)
ListSslCertificates lists all SslCertificates in the project.
func (*GCECloud) ListTargetHttpProxies ¶
func (gce *GCECloud) ListTargetHttpProxies() ([]*compute.TargetHttpProxy, error)
ListTargetHttpProxies lists all TargetHttpProxies in the project.
func (*GCECloud) ListTargetHttpsProxies ¶
func (gce *GCECloud) ListTargetHttpsProxies() ([]*compute.TargetHttpsProxy, error)
ListTargetHttpsProxies lists all TargetHttpsProxies in the project.
func (*GCECloud) ListUrlMaps ¶
ListUrlMaps lists all UrlMaps in the project.
func (*GCECloud) ListZonesInRegion ¶
ListZonesInRegion returns all zones in a GCP region
func (*GCECloud) LoadBalancer ¶
func (gce *GCECloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
LoadBalancer returns an implementation of LoadBalancer for Google Compute Engine.
func (*GCECloud) NetworkProjectID ¶
NetworkProjectID returns the ProjectID corresponding to the project this cluster's network is in.
func (*GCECloud) NetworkURL ¶
NetworkURL returns the network url
func (*GCECloud) NodeAddresses ¶
NodeAddresses is an implementation of Instances.NodeAddresses.
func (*GCECloud) NodeAddressesByProviderID ¶
func (gce *GCECloud) 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 (*GCECloud) OnXPN ¶
OnXPN returns true if the cluster is running on a cross project network (XPN)
func (*GCECloud) PatchBetaSecurityPolicy ¶
func (gce *GCECloud) PatchBetaSecurityPolicy(sp *computebeta.SecurityPolicy) error
PatchBetaSecurityPolicy applies the given security policy as a patch to an existing security policy.
func (*GCECloud) PatchRuleForBetaSecurityPolicy ¶
func (gce *GCECloud) PatchRuleForBetaSecurityPolicy(name string, spr *computebeta.SecurityPolicyRule) error
PatchRuleForBetaSecurityPolicy patches the given security policy rule to a security policy.
func (*GCECloud) ProjectID ¶
ProjectID returns the ProjectID corresponding to the project this cloud is in.
func (*GCECloud) ProviderName ¶
ProviderName returns the cloud provider ID.
func (*GCECloud) RemoveInstancesFromInstanceGroup ¶
func (gce *GCECloud) RemoveInstancesFromInstanceGroup(name string, zone string, instanceRefs []*compute.InstanceReference) error
RemoveInstancesFromInstanceGroup removes the given instances from the instance group.
func (*GCECloud) RemoveInstancesFromTargetPool ¶
func (gce *GCECloud) RemoveInstancesFromTargetPool(name, region string, instanceRefs []*compute.InstanceReference) error
RemoveInstancesFromTargetPool removes instances by link to the TargetPool
func (*GCECloud) RemoveRuleFromBetaSecurityPolicy ¶
RemoveRuleFromBetaSecurityPolicy removes rule from a security policy.
func (*GCECloud) ReserveAlphaRegionAddress ¶
func (gce *GCECloud) ReserveAlphaRegionAddress(addr *computealpha.Address, region string) error
ReserveAlphaRegionAddress creates an Alpha, regional address.
func (*GCECloud) ReserveBetaRegionAddress ¶
func (gce *GCECloud) ReserveBetaRegionAddress(addr *computebeta.Address, region string) error
ReserveBetaRegionAddress creates a beta region address
func (*GCECloud) ReserveGlobalAddress ¶
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 (*GCECloud) ReserveRegionAddress ¶
ReserveRegionAddress creates a region address
func (*GCECloud) ResizeDisk ¶
func (gce *GCECloud) ResizeDisk(diskToResize string, oldSize resource.Quantity, newSize resource.Quantity) (resource.Quantity, error)
ResizeDisk expands given disk and returns new disk size
func (*GCECloud) Routes ¶
func (gce *GCECloud) Routes() (cloudprovider.Routes, bool)
Routes returns an implementation of Routes for Google Compute Engine.
func (*GCECloud) SetInformers ¶
func (gce *GCECloud) SetInformers(informerFactory informers.SharedInformerFactory)
func (*GCECloud) SetNamedPortsOfInstanceGroup ¶
func (gce *GCECloud) SetNamedPortsOfInstanceGroup(igName, zone string, namedPorts []*compute.NamedPort) error
SetNamedPortsOfInstanceGroup sets the list of named ports on a given instance group
func (*GCECloud) SetProxyForGlobalForwardingRule ¶
func (gce *GCECloud) 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 (*GCECloud) SetRateLimiter ¶
func (g *GCECloud) 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 GCECloud.
func (*GCECloud) SetSecurityPolicyForAlphaGlobalBackendService ¶
func (gce *GCECloud) SetSecurityPolicyForAlphaGlobalBackendService(backendServiceName string, securityPolicyReference *computealpha.SecurityPolicyReference) error
SetSecurityPolicyForAlphaGlobalBackendService sets the given SecurityPolicyReference for the BackendService identified by the given name.
func (*GCECloud) SetSecurityPolicyForBetaGlobalBackendService ¶
func (gce *GCECloud) SetSecurityPolicyForBetaGlobalBackendService(backendServiceName string, securityPolicyReference *computebeta.SecurityPolicyReference) error
SetSecurityPolicyForBetaGlobalBackendService sets the given SecurityPolicyReference for the BackendService identified by the given name.
func (*GCECloud) SetSslCertificateForTargetHttpsProxy ¶
func (gce *GCECloud) SetSslCertificateForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, sslCertURLs []string) error
SetSslCertificateForTargetHttpsProxy sets the given SslCertificate for the given TargetHttpsProxy.
func (*GCECloud) SetUrlMapForTargetHttpProxy ¶
func (gce *GCECloud) SetUrlMapForTargetHttpProxy(proxy *compute.TargetHttpProxy, urlMapLink string) error
SetUrlMapForTargetHttpProxy sets the given UrlMap for the given TargetHttpProxy.
func (*GCECloud) SetUrlMapForTargetHttpsProxy ¶
func (gce *GCECloud) SetUrlMapForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, urlMapLink string) error
SetUrlMapForTargetHttpsProxy sets the given UrlMap for the given TargetHttpsProxy.
func (*GCECloud) SubnetworkURL ¶
SubnetworkURL returns the subnetwork url
func (*GCECloud) ToInstanceReferences ¶
func (gce *GCECloud) ToInstanceReferences(zone string, instanceNames []string) (refs []*compute.InstanceReference)
ToInstanceReferences returns instance references by links
func (*GCECloud) UpdateAlphaGlobalBackendService ¶
func (gce *GCECloud) UpdateAlphaGlobalBackendService(bg *computealpha.BackendService) error
UpdateAlphaGlobalBackendService applies the given alpha BackendService as an update to an existing service.
func (*GCECloud) UpdateAlphaHealthCheck ¶
func (gce *GCECloud) UpdateAlphaHealthCheck(hc *computealpha.HealthCheck) error
UpdateAlphaHealthCheck applies the given alpha HealthCheck as an update.
func (*GCECloud) UpdateBetaGlobalBackendService ¶
func (gce *GCECloud) UpdateBetaGlobalBackendService(bg *computebeta.BackendService) error
UpdateBetaGlobalBackendService applies the given beta BackendService as an update to an existing service.
func (*GCECloud) UpdateBetaHealthCheck ¶
func (gce *GCECloud) UpdateBetaHealthCheck(hc *computebeta.HealthCheck) error
UpdateBetaHealthCheck applies the given beta HealthCheck as an update.
func (*GCECloud) UpdateFirewall ¶
UpdateFirewall applies the given firewall as an update to an existing service.
func (*GCECloud) UpdateGlobalBackendService ¶
func (gce *GCECloud) UpdateGlobalBackendService(bg *compute.BackendService) error
UpdateGlobalBackendService applies the given BackendService as an update to an existing service.
func (*GCECloud) UpdateHealthCheck ¶
func (gce *GCECloud) UpdateHealthCheck(hc *compute.HealthCheck) error
UpdateHealthCheck applies the given HealthCheck as an update.
func (*GCECloud) UpdateHttpHealthCheck ¶
func (gce *GCECloud) UpdateHttpHealthCheck(hc *compute.HttpHealthCheck) error
UpdateHttpHealthCheck applies the given HttpHealthCheck as an update.
func (*GCECloud) UpdateHttpsHealthCheck ¶
func (gce *GCECloud) UpdateHttpsHealthCheck(hc *compute.HttpsHealthCheck) error
UpdateHttpsHealthCheck applies the given HttpsHealthCheck as an update.
func (*GCECloud) UpdateLoadBalancer ¶
func (gce *GCECloud) UpdateLoadBalancer(ctx context.Context, clusterName string, svc *v1.Service, nodes []*v1.Node) error
UpdateLoadBalancer is an implementation of LoadBalancer.UpdateLoadBalancer.
func (*GCECloud) UpdateRegionBackendService ¶
func (gce *GCECloud) UpdateRegionBackendService(bg *compute.BackendService, region string) error
UpdateRegionBackendService applies the given BackendService as an update to an existing service.
func (*GCECloud) UpdateUrlMap ¶
UpdateUrlMap applies the given UrlMap as an update
type LoadBalancerType ¶
type LoadBalancerType string
func GetLoadBalancerAnnotationType ¶
func GetLoadBalancerAnnotationType(service *v1.Service) (LoadBalancerType, bool)
GetLoadBalancerAnnotationType returns the type of GCP load balancer which should be assembled.
type Services ¶
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.
Source 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_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_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
Directories ¶
Path | Synopsis |
---|---|
Package cloud implements a more golang friendly interface to the GCE compute API.
|
Package cloud implements a more golang friendly interface to the GCE compute API. |
filter
Package filter encapsulates the filter argument to compute API calls.
|
Package filter encapsulates the filter argument to compute API calls. |
gen
Generator for GCE compute wrapper code.
|
Generator for GCE compute wrapper code. |
meta
Package meta contains the meta description of the GCE cloud types to generate code for.
|
Package meta contains the meta description of the GCE cloud types to generate code for. |
mock
Package mock encapsulates mocks for testing GCE provider functionality.
|
Package mock encapsulates mocks for testing GCE provider functionality. |