Documentation ¶
Overview ¶
Package gce is an implementation of Interface, LoadBalancer and Instances for Google Compute Engine.
Index ¶
- Constants
- func GetGCERegion(zone string) (string, error)
- func GetNodesHealthCheckPort() int32
- func LoadBalancerSrcRanges() []string
- func MakeHealthCheckFirewallName(clusterID, hcName string, isNodesHealthCheck bool) string
- func NewAltTokenSource(tokenURL, tokenBody string) oauth2.TokenSource
- type AltTokenSource
- type ClusterID
- type Config
- type DiskType
- type Disks
- type GCECloud
- func (gce *GCECloud) AddInstancesToInstanceGroup(name string, zone string, instanceNames []string) error
- func (gce *GCECloud) AddSSHKeyToAllInstances(user string, keyData []byte) error
- func (gce *GCECloud) AliasRanges(nodeName types.NodeName) (cidrs []string, err error)
- func (gce *GCECloud) AttachDisk(diskName string, nodeName types.NodeName, readOnly bool) error
- func (gce *GCECloud) Clusters() (cloudprovider.Clusters, bool)
- 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(targetProxyLink, ip, name, portRange string) (*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(name string, zone string) (*compute.InstanceGroup, error)
- func (gce *GCECloud) CreateRegionBackendService(bg *compute.BackendService) error
- func (gce *GCECloud) CreateRoute(clusterName string, nameHint string, route *cloudprovider.Route) error
- func (gce *GCECloud) CreateSslCertificate(sslCerts *compute.SslCertificate) (*compute.SslCertificate, error)
- func (gce *GCECloud) CreateTargetHttpProxy(urlMap *compute.UrlMap, name string) (*compute.TargetHttpProxy, error)
- func (gce *GCECloud) CreateTargetHttpsProxy(urlMap *compute.UrlMap, sslCert *compute.SslCertificate, name string) (*compute.TargetHttpsProxy, error)
- func (gce *GCECloud) CreateUrlMap(backend *compute.BackendService, name string) (*compute.UrlMap, error)
- func (gce *GCECloud) CurrentNodeName(hostname string) (types.NodeName, error)
- func (gce *GCECloud) DeleteDisk(diskToDelete string) error
- func (gce *GCECloud) DeleteFirewall(name string) error
- func (gce *GCECloud) DeleteForwardingRule(name string) error
- func (gce *GCECloud) DeleteGlobalBackendService(name string) error
- func (gce *GCECloud) DeleteGlobalForwardingRule(name string) error
- func (gce *GCECloud) DeleteGlobalStaticIP(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) DeleteInstanceGroup(name string, zone string) error
- func (gce *GCECloud) DeleteRegionBackendService(name, region string) error
- func (gce *GCECloud) DeleteRoute(clusterName string, route *cloudprovider.Route) error
- func (gce *GCECloud) DeleteSslCertificate(name string) error
- func (gce *GCECloud) DeleteTargetHttpProxy(name string) error
- func (gce *GCECloud) DeleteTargetHttpsProxy(name string) error
- func (gce *GCECloud) DeleteTargetPool(name string, hcNames ...string) error
- func (gce *GCECloud) DeleteUrlMap(name string) error
- func (gce *GCECloud) DetachDisk(devicePath string, nodeName types.NodeName) 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(clusterName string, apiService *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
- func (gce *GCECloud) EnsureLoadBalancerDeleted(clusterName string, service *v1.Service) error
- func (gce *GCECloud) ExternalID(nodeName types.NodeName) (string, error)
- func (gce *GCECloud) GetAllZones() (sets.String, error)
- func (gce *GCECloud) GetAutoLabelsForPD(name string, zone string) (map[string]string, error)
- func (g *GCECloud) GetComputeService() *compute.Service
- func (gce *GCECloud) GetDiskByNameUnknownZone(diskName string) (*GCEDisk, error)
- func (gce *GCECloud) GetFirewall(name string) (*compute.Firewall, 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) GetGlobalStaticIP(name string) (*compute.Address, 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) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
- func (gce *GCECloud) GetNodeTags(nodeNames []string) ([]string, error)
- func (gce *GCECloud) GetRegionBackendService(name, region string) (*compute.BackendService, error)
- func (gce *GCECloud) GetRegionalBackendServiceHealth(name, region string, instanceGroupLink string) (*compute.BackendServiceGroupHealth, error)
- func (gce *GCECloud) GetSslCertificate(name string) (*compute.SslCertificate, error)
- func (gce *GCECloud) GetTargetHttpProxy(name string) (*compute.TargetHttpProxy, error)
- func (gce *GCECloud) GetTargetHttpsProxy(name string) (*compute.TargetHttpsProxy, error)
- func (gce *GCECloud) GetUrlMap(name string) (*compute.UrlMap, error)
- func (gce *GCECloud) GetZone() (cloudprovider.Zone, error)
- func (gce *GCECloud) Initialize(clientBuilder controller.ControllerClientBuilder)
- func (gce *GCECloud) InstanceID(nodeName types.NodeName) (string, error)
- func (gce *GCECloud) InstanceType(nodeName types.NodeName) (string, error)
- func (gce *GCECloud) InstanceTypeByProviderID(providerID string) (string, error)
- func (gce *GCECloud) Instances() (cloudprovider.Instances, bool)
- func (gce *GCECloud) ListClusters() ([]string, error)
- func (gce *GCECloud) ListGlobalBackendServices() (*compute.BackendServiceList, error)
- func (gce *GCECloud) ListGlobalForwardingRules() (*compute.ForwardingRuleList, error)
- func (gce *GCECloud) ListHealthChecks() (*compute.HealthCheckList, error)
- func (gce *GCECloud) ListHttpHealthChecks() (*compute.HttpHealthCheckList, error)
- func (gce *GCECloud) ListHttpsHealthChecks() (*compute.HttpsHealthCheckList, error)
- func (gce *GCECloud) ListInstanceGroups(zone string) (*compute.InstanceGroupList, error)
- func (gce *GCECloud) ListInstancesInInstanceGroup(name string, zone string, state string) (*compute.InstanceGroupsListInstances, error)
- func (gce *GCECloud) ListRegionBackendServices(region string) (*compute.BackendServiceList, error)
- func (gce *GCECloud) ListRoutes(clusterName string) ([]*cloudprovider.Route, error)
- func (gce *GCECloud) ListSslCertificates() (*compute.SslCertificateList, error)
- func (gce *GCECloud) ListTargetHttpProxies() (*compute.TargetHttpProxyList, error)
- func (gce *GCECloud) ListTargetHttpsProxies() (*compute.TargetHttpsProxyList, error)
- func (gce *GCECloud) ListUrlMaps() (*compute.UrlMapList, error)
- func (gce *GCECloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (gce *GCECloud) Master(clusterName string) (string, error)
- func (gce *GCECloud) NetworkURL() string
- func (gce *GCECloud) NodeAddresses(_ types.NodeName) ([]v1.NodeAddress, error)
- func (gce *GCECloud) NodeAddressesByProviderID(providerID string) ([]v1.NodeAddress, error)
- func (gce *GCECloud) OnXPN() bool
- func (gce *GCECloud) ProviderName() string
- func (gce *GCECloud) Region() string
- func (gce *GCECloud) RemoveInstancesFromInstanceGroup(name string, zone string, instanceNames []string) error
- func (gce *GCECloud) ReserveGlobalStaticIP(name, ipAddress string) (address *compute.Address, err error)
- func (gce *GCECloud) Routes() (cloudprovider.Routes, bool)
- func (gce *GCECloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string)
- func (gce *GCECloud) SetNamedPortsOfInstanceGroup(igName, zone string, namedPorts []*compute.NamedPort) error
- func (gce *GCECloud) SetProxyForGlobalForwardingRule(fw *compute.ForwardingRule, targetProxyLink string) error
- func (gce *GCECloud) SetSslCertificateForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, sslCert *compute.SslCertificate) error
- func (gce *GCECloud) SetUrlMapForTargetHttpProxy(proxy *compute.TargetHttpProxy, urlMap *compute.UrlMap) error
- func (gce *GCECloud) SetUrlMapForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, urlMap *compute.UrlMap) error
- func (gce *GCECloud) SubnetworkURL() string
- 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(clusterName string, service *v1.Service, nodes []*v1.Node) error
- func (gce *GCECloud) UpdateRegionBackendService(bg *compute.BackendService) error
- func (gce *GCECloud) UpdateUrlMap(urlMap *compute.UrlMap) (*compute.UrlMap, error)
- func (gce *GCECloud) Zones() (cloudprovider.Zones, bool)
- type GCEDisk
- type GCEServiceManager
- func (manager *GCEServiceManager) CreateDisk(project string, zone string, disk *compute.Disk) (*compute.Operation, error)
- func (manager *GCEServiceManager) DeleteDisk(project string, zone string, diskName string) (*compute.Operation, error)
- func (manager *GCEServiceManager) GetDisk(project string, zone string, diskName string) (*compute.Disk, error)
- func (manager *GCEServiceManager) WaitForZoneOp(op *compute.Operation, zone string, mc *metricContext) error
- type ServiceManager
Constants ¶
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 (
ProviderName = "gce"
)
Variables ¶
This section is empty.
Functions ¶
func GetGCERegion ¶ added in v1.2.0
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 GetNodesHealthCheckPort ¶ added in v1.7.0
func GetNodesHealthCheckPort() int32
GetNodesHealthCheckPort returns the health check port used by the GCE load balancers (l4) for performing health checks on nodes.
func LoadBalancerSrcRanges ¶ added in v1.7.0
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 MakeHealthCheckFirewallName ¶ added in v1.7.0
MakeHealthCheckFirewallName returns the firewall name used by the GCE load balancers (l4) for performing health checks.
func NewAltTokenSource ¶ added in v1.3.0
func NewAltTokenSource(tokenURL, tokenBody string) oauth2.TokenSource
Types ¶
type AltTokenSource ¶ added in v1.3.0
type AltTokenSource struct {
// contains filtered or unexported fields
}
type ClusterID ¶ added in v1.7.0
type ClusterID struct {
// contains filtered or unexported fields
}
func (*ClusterID) GetFederationId ¶ added in v1.7.0
GetFederationId returns the id which could represent the entire Federation or just the cluster if not federated.
type Config ¶
type Config struct { Global struct { TokenURL string `gcfg:"token-url"` TokenBody string `gcfg:"token-body"` ProjectID string `gcfg:"project-id"` NetworkName string `gcfg:"network-name"` SubnetworkName string `gcfg:"subnetwork-name"` NodeTags []string `gcfg:"node-tags"` NodeInstancePrefix string `gcfg:"node-instance-prefix"` Multizone bool `gcfg:"multizone"` } }
type Disks ¶ added in v1.3.0
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) 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 // DeleteDisk deletes PD. DeleteDisk(diskToDelete string) 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 ClusterID // contains filtered or unexported fields }
GCECloud is an implementation of Interface, LoadBalancer and Instances for Google Compute Engine.
func CreateGCECloud ¶ added in v1.2.0
func CreateGCECloud(projectID, region, zone string, managedZones []string, networkURL, subnetworkURL string, nodeTags []string, nodeInstancePrefix string, tokenSource oauth2.TokenSource, useMetadataServer bool) (*GCECloud, error)
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 (*GCECloud) AddInstancesToInstanceGroup ¶
func (gce *GCECloud) AddInstancesToInstanceGroup(name string, zone string, instanceNames []string) error
AddInstancesToInstanceGroup adds the given instances to the given instance group.
func (*GCECloud) AddSSHKeyToAllInstances ¶
func (*GCECloud) AliasRanges ¶ added in v1.7.0
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) CreateDisk ¶ added in v1.2.0
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 ¶ added in v1.2.0
CreateFirewall creates the passed firewall
func (*GCECloud) CreateGlobalBackendService ¶ added in v1.7.0
func (gce *GCECloud) CreateGlobalBackendService(bg *compute.BackendService) error
CreateGlobalBackendService creates the given BackendService.
func (*GCECloud) CreateGlobalForwardingRule ¶
func (gce *GCECloud) CreateGlobalForwardingRule(targetProxyLink, ip, name, portRange string) (*compute.ForwardingRule, error)
CreateGlobalForwardingRule creates and returns a GlobalForwardingRule that points to the given TargetHttp(s)Proxy. targetProxyLink is the SelfLink of a TargetHttp(s)Proxy.
func (*GCECloud) CreateHealthCheck ¶ added in v1.7.0
func (gce *GCECloud) CreateHealthCheck(hc *compute.HealthCheck) error
CreateHealthCheck creates the given HealthCheck.
func (*GCECloud) CreateHttpHealthCheck ¶ added in v1.2.0
func (gce *GCECloud) CreateHttpHealthCheck(hc *compute.HttpHealthCheck) error
CreateHttpHealthCheck creates the given HttpHealthCheck.
func (*GCECloud) CreateHttpsHealthCheck ¶ added in v1.7.0
func (gce *GCECloud) CreateHttpsHealthCheck(hc *compute.HttpsHealthCheck) error
CreateHttpsHealthCheck creates the given HttpsHealthCheck.
func (*GCECloud) CreateInstanceGroup ¶
CreateInstanceGroup creates an instance group with the given instances. It is the callers responsibility to add named ports.
func (*GCECloud) CreateRegionBackendService ¶ added in v1.7.0
func (gce *GCECloud) CreateRegionBackendService(bg *compute.BackendService) error
CreateRegionBackendService creates the given BackendService.
func (*GCECloud) CreateRoute ¶
func (*GCECloud) CreateSslCertificate ¶ added in v1.2.0
func (gce *GCECloud) CreateSslCertificate(sslCerts *compute.SslCertificate) (*compute.SslCertificate, error)
CreateSslCertificate creates and returns a SslCertificate.
func (*GCECloud) CreateTargetHttpProxy ¶
func (gce *GCECloud) CreateTargetHttpProxy(urlMap *compute.UrlMap, name string) (*compute.TargetHttpProxy, error)
CreateTargetHttpProxy creates and returns a TargetHttpProxy with the given UrlMap.
func (*GCECloud) CreateTargetHttpsProxy ¶ added in v1.2.0
func (gce *GCECloud) CreateTargetHttpsProxy(urlMap *compute.UrlMap, sslCert *compute.SslCertificate, name string) (*compute.TargetHttpsProxy, error)
CreateTargetHttpsProxy creates and returns a TargetHttpsProxy with the given UrlMap and SslCertificate.
func (*GCECloud) CreateUrlMap ¶
func (gce *GCECloud) CreateUrlMap(backend *compute.BackendService, name string) (*compute.UrlMap, error)
CreateUrlMap creates an url map, using the given backend service as the default service.
func (*GCECloud) CurrentNodeName ¶
Implementation of Instances.CurrentNodeName
func (*GCECloud) DeleteDisk ¶ added in v1.2.0
func (*GCECloud) DeleteFirewall ¶ added in v1.2.0
DeleteFirewall deletes the given firewall rule.
func (*GCECloud) DeleteForwardingRule ¶ added in v1.5.0
func (*GCECloud) DeleteGlobalBackendService ¶ added in v1.7.0
DeleteGlobalBackendService deletes the given BackendService by name.
func (*GCECloud) DeleteGlobalForwardingRule ¶
DeleteGlobalForwardingRule deletes the GlobalForwardingRule by name.
func (*GCECloud) DeleteGlobalStaticIP ¶ added in v1.2.0
DeleteGlobalStaticIP deletes a global static IP by name.
func (*GCECloud) DeleteHealthCheck ¶ added in v1.7.0
DeleteHealthCheck deletes the given HealthCheck by name.
func (*GCECloud) DeleteHttpHealthCheck ¶ added in v1.2.0
DeleteHttpHealthCheck deletes the given HttpHealthCheck by name.
func (*GCECloud) DeleteHttpsHealthCheck ¶ added in v1.7.0
DeleteHttpsHealthCheck deletes the given HttpsHealthCheck by name.
func (*GCECloud) DeleteInstanceGroup ¶
DeleteInstanceGroup deletes an instance group.
func (*GCECloud) DeleteRegionBackendService ¶ added in v1.7.0
DeleteRegionBackendService deletes the given BackendService by name.
func (*GCECloud) DeleteRoute ¶
func (gce *GCECloud) DeleteRoute(clusterName string, route *cloudprovider.Route) error
func (*GCECloud) DeleteSslCertificate ¶ added in v1.2.0
DeleteSslCertificate deletes the SslCertificate by name.
func (*GCECloud) DeleteTargetHttpProxy ¶
DeleteTargetHttpProxy deletes the TargetHttpProxy by name.
func (*GCECloud) DeleteTargetHttpsProxy ¶ added in v1.2.0
DeleteTargetHttpsProxy deletes the TargetHttpsProxy by name.
func (*GCECloud) DeleteTargetPool ¶ added in v1.5.0
DeleteTargetPool deletes the given target pool.
func (*GCECloud) DeleteUrlMap ¶
DeleteUrlMap deletes a url map by name.
func (*GCECloud) DetachDisk ¶
func (*GCECloud) DiskIsAttached ¶ added in v1.2.0
func (*GCECloud) DisksAreAttached ¶ added in v1.4.6
func (*GCECloud) EnsureLoadBalancer ¶ added in v1.2.0
func (gce *GCECloud) EnsureLoadBalancer(clusterName string, apiService *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
EnsureLoadBalancer is an implementation of LoadBalancer.EnsureLoadBalancer. Our load balancers in GCE consist of four separate GCE resources - a static IP address, a firewall rule, a target pool, and a forwarding rule. This function has to manage all of them.
Due to an interesting series of design decisions, this handles both creating new load balancers and updating existing load balancers, recognizing when each is needed.
func (*GCECloud) EnsureLoadBalancerDeleted ¶ added in v1.2.0
EnsureLoadBalancerDeleted is an implementation of LoadBalancer.EnsureLoadBalancerDeleted.
func (*GCECloud) ExternalID ¶
ExternalID returns the cloud provider ID of the node with the specified NodeName (deprecated).
func (*GCECloud) GetAllZones ¶ added in v1.3.0
GetAllZones returns all the zones in which nodes are running
func (*GCECloud) GetAutoLabelsForPD ¶ added in v1.2.0
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) GetComputeService ¶ added in v1.2.0
Raw access to the underlying GCE service, probably should only be used for e2e tests
func (*GCECloud) GetDiskByNameUnknownZone ¶ added in v1.7.0
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 ¶ added in v1.2.0
GetFirewall returns the Firewall by name.
func (*GCECloud) GetGlobalBackendService ¶ added in v1.7.0
func (gce *GCECloud) GetGlobalBackendService(name string) (*compute.BackendService, error)
GetGlobalBackendService retrieves a backend by name.
func (*GCECloud) GetGlobalBackendServiceHealth ¶ added in v1.7.0
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) GetGlobalStaticIP ¶ added in v1.2.0
GetGlobalStaticIP returns the global static IP by name.
func (*GCECloud) GetHealthCheck ¶ added in v1.7.0
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 ¶ added in v1.7.0
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) GetLoadBalancer ¶ added in v1.2.0
func (gce *GCECloud) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
GetLoadBalancer is an implementation of LoadBalancer.GetLoadBalancer
func (*GCECloud) GetNodeTags ¶ added in v1.7.0
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) GetRegionBackendService ¶ added in v1.7.0
func (gce *GCECloud) GetRegionBackendService(name, region string) (*compute.BackendService, error)
GetRegionBackendService retrieves a backend by name.
func (*GCECloud) GetRegionalBackendServiceHealth ¶ added in v1.7.0
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) GetSslCertificate ¶ added in v1.2.0
func (gce *GCECloud) GetSslCertificate(name string) (*compute.SslCertificate, error)
GetSslCertificate returns the SslCertificate by name.
func (*GCECloud) GetTargetHttpProxy ¶
func (gce *GCECloud) GetTargetHttpProxy(name string) (*compute.TargetHttpProxy, error)
GetTargetHttpProxy returns the UrlMap by name.
func (*GCECloud) GetTargetHttpsProxy ¶ added in v1.2.0
func (gce *GCECloud) GetTargetHttpsProxy(name string) (*compute.TargetHttpsProxy, error)
GetTargetHttpsProxy returns the UrlMap by name.
func (*GCECloud) Initialize ¶ added in v1.7.0
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) InstanceID ¶
InstanceID returns the cloud provider ID of the node with the specified NodeName.
func (*GCECloud) InstanceType ¶ added in v1.2.0
InstanceType returns the type of the specified node with the specified NodeName.
func (*GCECloud) InstanceTypeByProviderID ¶ added in v1.7.0
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) ListClusters ¶
func (*GCECloud) ListGlobalBackendServices ¶ added in v1.7.0
func (gce *GCECloud) ListGlobalBackendServices() (*compute.BackendServiceList, error)
ListGlobalBackendServices lists all backend services in the project.
func (*GCECloud) ListGlobalForwardingRules ¶ added in v1.2.0
func (gce *GCECloud) ListGlobalForwardingRules() (*compute.ForwardingRuleList, error)
ListGlobalForwardingRules lists all GlobalForwardingRules in the project.
func (*GCECloud) ListHealthChecks ¶ added in v1.7.0
func (gce *GCECloud) ListHealthChecks() (*compute.HealthCheckList, error)
ListHealthChecks lists all HealthCheck in the project.
func (*GCECloud) ListHttpHealthChecks ¶ added in v1.2.0
func (gce *GCECloud) ListHttpHealthChecks() (*compute.HttpHealthCheckList, error)
ListHttpHealthChecks lists all HttpHealthChecks in the project.
func (*GCECloud) ListHttpsHealthChecks ¶ added in v1.7.0
func (gce *GCECloud) ListHttpsHealthChecks() (*compute.HttpsHealthCheckList, error)
ListHttpsHealthChecks lists all HttpsHealthChecks in the project.
func (*GCECloud) ListInstanceGroups ¶ added in v1.2.0
func (gce *GCECloud) ListInstanceGroups(zone string) (*compute.InstanceGroupList, error)
ListInstanceGroups lists all InstanceGroups in the project and zone.
func (*GCECloud) ListInstancesInInstanceGroup ¶
func (gce *GCECloud) ListInstancesInInstanceGroup(name string, zone string, state string) (*compute.InstanceGroupsListInstances, error)
ListInstancesInInstanceGroup lists all the instances in a given instance group and state.
func (*GCECloud) ListRegionBackendServices ¶ added in v1.7.0
func (gce *GCECloud) ListRegionBackendServices(region string) (*compute.BackendServiceList, error)
ListRegionBackendServices lists all backend services in the project.
func (*GCECloud) ListRoutes ¶
func (gce *GCECloud) ListRoutes(clusterName string) ([]*cloudprovider.Route, error)
func (*GCECloud) ListSslCertificates ¶ added in v1.2.0
func (gce *GCECloud) ListSslCertificates() (*compute.SslCertificateList, error)
ListSslCertificates lists all SslCertificates in the project.
func (*GCECloud) ListTargetHttpProxies ¶ added in v1.2.0
func (gce *GCECloud) ListTargetHttpProxies() (*compute.TargetHttpProxyList, error)
ListTargetHttpProxies lists all TargetHttpProxies in the project.
func (*GCECloud) ListTargetHttpsProxies ¶ added in v1.2.0
func (gce *GCECloud) ListTargetHttpsProxies() (*compute.TargetHttpsProxyList, error)
ListTargetHttpsProxies lists all TargetHttpsProxies in the project.
func (*GCECloud) ListUrlMaps ¶ added in v1.2.0
func (gce *GCECloud) ListUrlMaps() (*compute.UrlMapList, error)
ListUrlMaps lists all UrlMaps in the project.
func (*GCECloud) LoadBalancer ¶ added in v1.2.0
func (gce *GCECloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
LoadBalancer returns an implementation of LoadBalancer for Google Compute Engine.
func (*GCECloud) NetworkURL ¶ added in v1.7.0
NetworkURL returns the network url
func (*GCECloud) NodeAddresses ¶
NodeAddresses is an implementation of Instances.NodeAddresses.
func (*GCECloud) NodeAddressesByProviderID ¶ added in v1.7.0
func (gce *GCECloud) NodeAddressesByProviderID(providerID string) ([]v1.NodeAddress, error)
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) OnXPN ¶ added in v1.7.0
OnXPN returns true if the cluster is running on a cross project network (XPN)
func (*GCECloud) ProviderName ¶
ProviderName returns the cloud provider ID.
func (*GCECloud) RemoveInstancesFromInstanceGroup ¶
func (gce *GCECloud) RemoveInstancesFromInstanceGroup(name string, zone string, instanceNames []string) error
RemoveInstancesFromInstanceGroup removes the given instances from the instance group.
func (*GCECloud) ReserveGlobalStaticIP ¶ added in v1.2.0
func (gce *GCECloud) ReserveGlobalStaticIP(name, ipAddress string) (address *compute.Address, err error)
ReserveGlobalStaticIP creates a global static IP. 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) Routes ¶
func (gce *GCECloud) Routes() (cloudprovider.Routes, bool)
Routes returns an implementation of Routes for Google Compute Engine.
func (*GCECloud) SetNamedPortsOfInstanceGroup ¶ added in v1.7.0
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(fw *compute.ForwardingRule, 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) SetSslCertificateForTargetHttpsProxy ¶ added in v1.2.0
func (gce *GCECloud) SetSslCertificateForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, sslCert *compute.SslCertificate) error
SetSslCertificateForTargetHttpsProxy sets the given SslCertificate for the given TargetHttpsProxy.
func (*GCECloud) SetUrlMapForTargetHttpProxy ¶
func (gce *GCECloud) SetUrlMapForTargetHttpProxy(proxy *compute.TargetHttpProxy, urlMap *compute.UrlMap) error
SetUrlMapForTargetHttpProxy sets the given UrlMap for the given TargetHttpProxy.
func (*GCECloud) SetUrlMapForTargetHttpsProxy ¶ added in v1.2.0
func (gce *GCECloud) SetUrlMapForTargetHttpsProxy(proxy *compute.TargetHttpsProxy, urlMap *compute.UrlMap) error
SetUrlMapForTargetHttpsProxy sets the given UrlMap for the given TargetHttpsProxy.
func (*GCECloud) SubnetworkURL ¶ added in v1.7.0
SubnetworkURL returns the subnetwork url
func (*GCECloud) UpdateFirewall ¶ added in v1.2.0
UpdateFirewall applies the given firewall as an update to an existing service.
func (*GCECloud) UpdateGlobalBackendService ¶ added in v1.7.0
func (gce *GCECloud) UpdateGlobalBackendService(bg *compute.BackendService) error
UpdateGlobalBackendService applies the given BackendService as an update to an existing service.
func (*GCECloud) UpdateHealthCheck ¶ added in v1.7.0
func (gce *GCECloud) UpdateHealthCheck(hc *compute.HealthCheck) error
UpdateHealthCheck applies the given HealthCheck as an update.
func (*GCECloud) UpdateHttpHealthCheck ¶ added in v1.2.0
func (gce *GCECloud) UpdateHttpHealthCheck(hc *compute.HttpHealthCheck) error
UpdateHttpHealthCheck applies the given HttpHealthCheck as an update.
func (*GCECloud) UpdateHttpsHealthCheck ¶ added in v1.7.0
func (gce *GCECloud) UpdateHttpsHealthCheck(hc *compute.HttpsHealthCheck) error
UpdateHttpsHealthCheck applies the given HttpsHealthCheck as an update.
func (*GCECloud) UpdateLoadBalancer ¶ added in v1.2.0
func (gce *GCECloud) UpdateLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error
UpdateLoadBalancer is an implementation of LoadBalancer.UpdateLoadBalancer.
func (*GCECloud) UpdateRegionBackendService ¶ added in v1.7.0
func (gce *GCECloud) UpdateRegionBackendService(bg *compute.BackendService) error
UpdateRegionBackendService applies the given BackendService as an update to an existing service.
func (*GCECloud) UpdateUrlMap ¶
UpdateUrlMap applies the given UrlMap as an update, and returns the new UrlMap.
type GCEServiceManager ¶ added in v1.7.0
type GCEServiceManager struct {
// contains filtered or unexported fields
}
func (*GCEServiceManager) CreateDisk ¶ added in v1.7.0
func (*GCEServiceManager) DeleteDisk ¶ added in v1.7.0
func (*GCEServiceManager) WaitForZoneOp ¶ added in v1.7.0
func (manager *GCEServiceManager) WaitForZoneOp(op *compute.Operation, zone string, mc *metricContext) error
type ServiceManager ¶ added in v1.7.0
type ServiceManager interface { // Creates a new persistent disk on GCE with the given disk spec. CreateDisk(project string, zone string, disk *compute.Disk) (*compute.Operation, error) // Gets the persistent disk from GCE with the given diskName. GetDisk(project string, zone string, diskName string) (*compute.Disk, error) // Deletes the persistent disk from GCE with the given diskName. DeleteDisk(project string, zone string, disk string) (*compute.Operation, error) // Waits until GCE reports the given operation in the given zone as done. WaitForZoneOp(op *compute.Operation, zone string, mc *metricContext) error }
Source Files ¶
- doc.go
- gce.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_loadbalancer.go
- gce_op.go
- gce_routes.go
- gce_staticip.go
- gce_targetproxy.go
- gce_urlmap.go
- gce_util.go
- gce_zones.go
- metrics.go
- token_source.go