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 NewAltTokenSource(tokenURL, tokenBody string) oauth2.TokenSource
- type AltTokenSource
- type Cloud
- func (gce *Cloud) AddInstancesToInstanceGroup(name string, zone string, instanceNames []string) error
- func (gce *Cloud) AddPortToInstanceGroup(ig *compute.InstanceGroup, port int64) (*compute.NamedPort, error)
- func (gce *Cloud) AddSSHKeyToAllInstances(user string, keyData []byte) error
- func (gce *Cloud) AttachDisk(diskName string, nodeName types.NodeName, readOnly bool) error
- func (gce *Cloud) Clusters() (cloudprovider.Clusters, bool)
- func (gce *Cloud) CreateBackendService(bg *compute.BackendService) error
- func (gce *Cloud) CreateDisk(name string, diskType string, zone string, sizeGb int64, ...) error
- func (gce *Cloud) CreateDiskFromSnapshot(snapshot string, name string, diskType string, zone string, sizeGb int64, ...) error
- func (gce *Cloud) CreateFirewall(name, desc string, sourceRanges netsets.IPNet, ports []int64, ...) error
- func (gce *Cloud) CreateGlobalForwardingRule(targetProxyLink, ip, name, portRange string) (*compute.ForwardingRule, error)
- func (gce *Cloud) CreateHTTPHealthCheck(hc *compute.HttpHealthCheck) error
- func (gce *Cloud) CreateInstanceGroup(name string, zone string) (*compute.InstanceGroup, error)
- func (gce *Cloud) CreateRoute(clusterName string, nameHint string, route *cloudprovider.Route) error
- func (gce *Cloud) CreateSnapshot(diskName string, zone string, snapshotName string, tags map[string]string) error
- func (gce *Cloud) CreateSslCertificate(sslCerts *compute.SslCertificate) (*compute.SslCertificate, error)
- func (gce *Cloud) CreateTargetHTTPProxy(urlMap *compute.UrlMap, name string) (*compute.TargetHttpProxy, error)
- func (gce *Cloud) CreateTargetHTTPSProxy(urlMap *compute.UrlMap, sslCert *compute.SslCertificate, name string) (*compute.TargetHttpsProxy, error)
- func (gce *Cloud) CreateURLMap(backend *compute.BackendService, name string) (*compute.UrlMap, error)
- func (gce *Cloud) CurrentNodeName(hostname string) (types.NodeName, error)
- func (gce *Cloud) DeleteBackendService(name string) error
- func (gce *Cloud) DeleteDisk(diskToDelete string) error
- func (gce *Cloud) DeleteFirewall(name string) error
- func (gce *Cloud) DeleteForwardingRule(name string) error
- func (gce *Cloud) DeleteGlobalForwardingRule(name string) error
- func (gce *Cloud) DeleteGlobalStaticIP(name string) error
- func (gce *Cloud) DeleteHTTPHealthCheck(name string) error
- func (gce *Cloud) DeleteInstanceGroup(name string, zone string) error
- func (gce *Cloud) DeleteRoute(clusterName string, route *cloudprovider.Route) error
- func (gce *Cloud) DeleteSnapshot(snapshotToDelete string) error
- func (gce *Cloud) DeleteSslCertificate(name string) error
- func (gce *Cloud) DeleteTargetHTTPProxy(name string) error
- func (gce *Cloud) DeleteTargetHTTPSProxy(name string) error
- func (gce *Cloud) DeleteTargetPool(name string, hc *compute.HttpHealthCheck) error
- func (gce *Cloud) DeleteURLMap(name string) error
- func (gce *Cloud) DescribeSnapshot(snapshotToGet string) (status string, isCompleted bool, err error)
- func (gce *Cloud) DetachDisk(devicePath string, nodeName types.NodeName) error
- func (gce *Cloud) DiskIsAttached(diskName string, nodeName types.NodeName) (bool, error)
- func (gce *Cloud) DisksAreAttached(diskNames []string, nodeName types.NodeName) (map[string]bool, error)
- func (gce *Cloud) EnsureLoadBalancer(clusterName string, apiService *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
- func (gce *Cloud) EnsureLoadBalancerDeleted(clusterName string, service *v1.Service) error
- func (gce *Cloud) ExternalID(nodeName types.NodeName) (string, error)
- func (gce *Cloud) FindSnapshot(tags map[string]string) ([]string, []string, error)
- func (gce *Cloud) GetAllZones() (sets.String, error)
- func (gce *Cloud) GetAutoLabelsForPD(name string, zone string) (map[string]string, error)
- func (gce *Cloud) GetBackendService(name string) (*compute.BackendService, error)
- func (gce *Cloud) GetComputeService() *compute.Service
- func (gce *Cloud) GetFirewall(name string) (*compute.Firewall, error)
- func (gce *Cloud) GetGlobalForwardingRule(name string) (*compute.ForwardingRule, error)
- func (gce *Cloud) GetGlobalStaticIP(name string) (address *compute.Address, err error)
- func (gce *Cloud) GetHTTPHealthCheck(name string) (*compute.HttpHealthCheck, error)
- func (gce *Cloud) GetHealth(name string, instanceGroupLink string) (*compute.BackendServiceGroupHealth, error)
- func (gce *Cloud) GetInstanceGroup(name string, zone string) (*compute.InstanceGroup, error)
- func (gce *Cloud) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
- func (gce *Cloud) GetSslCertificate(name string) (*compute.SslCertificate, error)
- func (gce *Cloud) GetTargetHTTPProxy(name string) (*compute.TargetHttpProxy, error)
- func (gce *Cloud) GetTargetHTTPSProxy(name string) (*compute.TargetHttpsProxy, error)
- func (gce *Cloud) GetURLMap(name string) (*compute.UrlMap, error)
- func (gce *Cloud) GetZone() (cloudprovider.Zone, error)
- func (gce *Cloud) InstanceID(nodeName types.NodeName) (string, error)
- func (gce *Cloud) InstanceType(nodeName types.NodeName) (string, error)
- func (gce *Cloud) Instances() (cloudprovider.Instances, bool)
- func (gce *Cloud) ListBackendServices() (*compute.BackendServiceList, error)
- func (gce *Cloud) ListClusters() ([]string, error)
- func (gce *Cloud) ListGlobalForwardingRules() (*compute.ForwardingRuleList, error)
- func (gce *Cloud) ListHTTPHealthChecks() (*compute.HttpHealthCheckList, error)
- func (gce *Cloud) ListInstanceGroups(zone string) (*compute.InstanceGroupList, error)
- func (gce *Cloud) ListInstancesInInstanceGroup(name string, zone string, state string) (*compute.InstanceGroupsListInstances, error)
- func (gce *Cloud) ListRoutes(clusterName string) ([]*cloudprovider.Route, error)
- func (gce *Cloud) ListSslCertificates() (*compute.SslCertificateList, error)
- func (gce *Cloud) ListTargetHTTPProxies() (*compute.TargetHttpProxyList, error)
- func (gce *Cloud) ListTargetHTTPSProxies() (*compute.TargetHttpsProxyList, error)
- func (gce *Cloud) ListURLMaps() (*compute.UrlMapList, error)
- func (gce *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (gce *Cloud) Master(clusterName string) (string, error)
- func (gce *Cloud) NodeAddresses(_ types.NodeName) ([]v1.NodeAddress, error)
- func (gce *Cloud) ProviderName() string
- func (gce *Cloud) RemoveInstancesFromInstanceGroup(name string, zone string, instanceNames []string) error
- func (gce *Cloud) ReserveGlobalStaticIP(name, ipAddress string) (address *compute.Address, err error)
- func (gce *Cloud) Routes() (cloudprovider.Routes, bool)
- func (gce *Cloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string)
- func (gce *Cloud) SetProxyForGlobalForwardingRule(fw *compute.ForwardingRule, targetProxyLink string) error
- func (gce *Cloud) SetSslCertificateForTargetHTTPSProxy(proxy *compute.TargetHttpsProxy, sslCert *compute.SslCertificate) error
- func (gce *Cloud) SetURLMapForTargetHTTPProxy(proxy *compute.TargetHttpProxy, urlMap *compute.UrlMap) error
- func (gce *Cloud) SetURLMapForTargetHTTPSProxy(proxy *compute.TargetHttpsProxy, urlMap *compute.UrlMap) error
- func (gce *Cloud) UpdateBackendService(bg *compute.BackendService) error
- func (gce *Cloud) UpdateFirewall(name, desc string, sourceRanges netsets.IPNet, ports []int64, ...) error
- func (gce *Cloud) UpdateHTTPHealthCheck(hc *compute.HttpHealthCheck) error
- func (gce *Cloud) UpdateLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error
- func (gce *Cloud) UpdateURLMap(urlMap *compute.UrlMap) (*compute.UrlMap, error)
- func (gce *Cloud) Zones() (cloudprovider.Zones, bool)
- type Config
- type DiskType
- type Disks
Constants ¶
const ( // DiskTypeSSD is the disk type for SSD PD DiskTypeSSD = "pd-ssd" // DiskTypeStandard is the disk type for standard PD DiskTypeStandard = "pd-standard" )
const (
// ProviderName is the cloud provider name
ProviderName = "gce"
)
Variables ¶
This section is empty.
Functions ¶
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 NewAltTokenSource ¶
func NewAltTokenSource(tokenURL, tokenBody string) oauth2.TokenSource
NewAltTokenSource creates a TokenSource
Types ¶
type AltTokenSource ¶
type AltTokenSource struct {
// contains filtered or unexported fields
}
AltTokenSource defines a token source
type Cloud ¶
type Cloud struct {
// contains filtered or unexported fields
}
Cloud is an implementation of Interface, LoadBalancer and Instances for Google Compute Engine.
func CreateGCECloud ¶
func CreateGCECloud(projectID, region, zone string, managedZones []string, networkURL string, nodeTags []string, nodeInstancePrefix string, tokenSource oauth2.TokenSource, useMetadataServer bool) (*Cloud, error)
CreateGCECloud creates a GCE Cloud object using the specified parameters. If no networkUrl is specified, loads networkName via rest call. If no tokenSource is specified, uses oauth2.DefaultTokenSource. If managedZones is nil / empty all zones in the region will be managed.
func (*Cloud) AddInstancesToInstanceGroup ¶
func (gce *Cloud) AddInstancesToInstanceGroup(name string, zone string, instanceNames []string) error
AddInstancesToInstanceGroup adds the given instances to the given instance group.
func (*Cloud) AddPortToInstanceGroup ¶
func (gce *Cloud) AddPortToInstanceGroup(ig *compute.InstanceGroup, port int64) (*compute.NamedPort, error)
AddPortToInstanceGroup adds a port to the given instance group.
func (*Cloud) AddSSHKeyToAllInstances ¶
AddSSHKeyToAllInstances adds SSH key to all instances
func (*Cloud) AttachDisk ¶
AttachDisk attaches a disk
func (*Cloud) Clusters ¶
func (gce *Cloud) Clusters() (cloudprovider.Clusters, bool)
Clusters returns GCE clusters
func (*Cloud) CreateBackendService ¶
func (gce *Cloud) CreateBackendService(bg *compute.BackendService) error
CreateBackendService creates the given BackendService.
func (*Cloud) CreateDisk ¶
func (gce *Cloud) 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 (*Cloud) CreateDiskFromSnapshot ¶
func (gce *Cloud) CreateDiskFromSnapshot(snapshot string, name string, diskType string, zone string, sizeGb int64, tags map[string]string) error
CreateDiskFromSnapshot create a disk from snapshot
func (*Cloud) CreateFirewall ¶
func (gce *Cloud) CreateFirewall(name, desc string, sourceRanges netsets.IPNet, ports []int64, hostNames []string) error
CreateFirewall creates the given firewall rule.
func (*Cloud) CreateGlobalForwardingRule ¶
func (gce *Cloud) 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 (*Cloud) CreateHTTPHealthCheck ¶
func (gce *Cloud) CreateHTTPHealthCheck(hc *compute.HttpHealthCheck) error
CreateHTTPHealthCheck creates the given HTTPHealthCheck.
func (*Cloud) CreateInstanceGroup ¶
CreateInstanceGroup creates an instance group with the given instances. It is the callers responsibility to add named ports.
func (*Cloud) CreateRoute ¶
func (gce *Cloud) CreateRoute(clusterName string, nameHint string, route *cloudprovider.Route) error
CreateRoute creates a route
func (*Cloud) CreateSnapshot ¶
func (gce *Cloud) CreateSnapshot(diskName string, zone string, snapshotName string, tags map[string]string) error
CreateSnapshot creates a snapshot
func (*Cloud) CreateSslCertificate ¶
func (gce *Cloud) CreateSslCertificate(sslCerts *compute.SslCertificate) (*compute.SslCertificate, error)
CreateSslCertificate creates and returns a SslCertificate.
func (*Cloud) CreateTargetHTTPProxy ¶
func (gce *Cloud) CreateTargetHTTPProxy(urlMap *compute.UrlMap, name string) (*compute.TargetHttpProxy, error)
CreateTargetHTTPProxy creates and returns a TargetHTTPProxy with the given UrlMap.
func (*Cloud) CreateTargetHTTPSProxy ¶
func (gce *Cloud) 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 (*Cloud) CreateURLMap ¶
func (gce *Cloud) CreateURLMap(backend *compute.BackendService, name string) (*compute.UrlMap, error)
CreateURLMap creates an url map, using the given backend service as the default service.
func (*Cloud) CurrentNodeName ¶
CurrentNodeName is an implementation of Instances.CurrentNodeName
func (*Cloud) DeleteBackendService ¶
DeleteBackendService deletes the given BackendService by name.
func (*Cloud) DeleteDisk ¶
DeleteDisk deletes a disk
func (*Cloud) DeleteFirewall ¶
DeleteFirewall deletes the given firewall rule.
func (*Cloud) DeleteForwardingRule ¶
DeleteForwardingRule deletes the forwarding rule
func (*Cloud) DeleteGlobalForwardingRule ¶
DeleteGlobalForwardingRule deletes the GlobalForwardingRule by name.
func (*Cloud) DeleteGlobalStaticIP ¶
DeleteGlobalStaticIP deletes a global static IP by name.
func (*Cloud) DeleteHTTPHealthCheck ¶
DeleteHTTPHealthCheck deletes the given HTTPHealthCheck by name.
func (*Cloud) DeleteInstanceGroup ¶
DeleteInstanceGroup deletes an instance group.
func (*Cloud) DeleteRoute ¶
func (gce *Cloud) DeleteRoute(clusterName string, route *cloudprovider.Route) error
DeleteRoute deletes a route
func (*Cloud) DeleteSnapshot ¶
DeleteSnapshot deletes a snapshot
func (*Cloud) DeleteSslCertificate ¶
DeleteSslCertificate deletes the SslCertificate by name.
func (*Cloud) DeleteTargetHTTPProxy ¶
DeleteTargetHTTPProxy deletes the TargetHTTPProxy by name.
func (*Cloud) DeleteTargetHTTPSProxy ¶
DeleteTargetHTTPSProxy deletes the TargetHTTPSProxy by name.
func (*Cloud) DeleteTargetPool ¶
func (gce *Cloud) DeleteTargetPool(name string, hc *compute.HttpHealthCheck) error
DeleteTargetPool deletes the given target pool.
func (*Cloud) DeleteURLMap ¶
DeleteURLMap deletes a url map by name.
func (*Cloud) DescribeSnapshot ¶
func (gce *Cloud) DescribeSnapshot(snapshotToGet string) (status string, isCompleted bool, err error)
DescribeSnapshot checks the status of a snapshot
func (*Cloud) DetachDisk ¶
DetachDisk detaches a disk
func (*Cloud) DiskIsAttached ¶
DiskIsAttached checks if disk is attached
func (*Cloud) DisksAreAttached ¶
func (gce *Cloud) DisksAreAttached(diskNames []string, nodeName types.NodeName) (map[string]bool, error)
DisksAreAttached checks if disks are attached
func (*Cloud) EnsureLoadBalancer ¶
func (gce *Cloud) 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 (*Cloud) EnsureLoadBalancerDeleted ¶
EnsureLoadBalancerDeleted is an implementation of LoadBalancer.EnsureLoadBalancerDeleted.
func (*Cloud) ExternalID ¶
ExternalID returns the cloud provider ID of the node with the specified NodeName (deprecated).
func (*Cloud) FindSnapshot ¶
FindSnapshot returns the found snapshots
func (*Cloud) GetAllZones ¶
GetAllZones returns all the zones in which nodes are running
func (*Cloud) GetAutoLabelsForPD ¶
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 (*Cloud) GetBackendService ¶
func (gce *Cloud) GetBackendService(name string) (*compute.BackendService, error)
GetBackendService retrieves a backend by name.
func (*Cloud) GetComputeService ¶
GetComputeService gets the compute service Raw access to the underlying GCE service, probably should only be used for e2e tests
func (*Cloud) GetFirewall ¶
GetFirewall returns the Firewall by name.
func (*Cloud) GetGlobalForwardingRule ¶
func (gce *Cloud) GetGlobalForwardingRule(name string) (*compute.ForwardingRule, error)
GetGlobalForwardingRule returns the GlobalForwardingRule by name.
func (*Cloud) GetGlobalStaticIP ¶
GetGlobalStaticIP returns the global static IP by name.
func (*Cloud) GetHTTPHealthCheck ¶
func (gce *Cloud) GetHTTPHealthCheck(name string) (*compute.HttpHealthCheck, error)
GetHTTPHealthCheck returns the given HTTPHealthCheck by name.
func (*Cloud) GetHealth ¶
func (gce *Cloud) GetHealth(name string, instanceGroupLink string) (*compute.BackendServiceGroupHealth, error)
GetHealth returns the health of the BackendService identified by the given name, in the given instanceGroup. The instanceGroupLink is the fully qualified self link of an instance group.
func (*Cloud) GetInstanceGroup ¶
GetInstanceGroup returns an instance group by name.
func (*Cloud) GetLoadBalancer ¶
func (gce *Cloud) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
GetLoadBalancer is an implementation of LoadBalancer.GetLoadBalancer
func (*Cloud) GetSslCertificate ¶
func (gce *Cloud) GetSslCertificate(name string) (*compute.SslCertificate, error)
GetSslCertificate returns the SslCertificate by name.
func (*Cloud) GetTargetHTTPProxy ¶
func (gce *Cloud) GetTargetHTTPProxy(name string) (*compute.TargetHttpProxy, error)
GetTargetHTTPProxy returns the UrlMap by name.
func (*Cloud) GetTargetHTTPSProxy ¶
func (gce *Cloud) GetTargetHTTPSProxy(name string) (*compute.TargetHttpsProxy, error)
GetTargetHTTPSProxy returns the URLMap by name.
func (*Cloud) InstanceID ¶
InstanceID returns the cloud provider ID of the node with the specified NodeName.
func (*Cloud) InstanceType ¶
InstanceType returns the type of the specified node with the specified NodeName.
func (*Cloud) Instances ¶
func (gce *Cloud) Instances() (cloudprovider.Instances, bool)
Instances returns an implementation of Instances for Google Compute Engine.
func (*Cloud) ListBackendServices ¶
func (gce *Cloud) ListBackendServices() (*compute.BackendServiceList, error)
ListBackendServices lists all backend services in the project.
func (*Cloud) ListClusters ¶
ListClusters lists clusters
func (*Cloud) ListGlobalForwardingRules ¶
func (gce *Cloud) ListGlobalForwardingRules() (*compute.ForwardingRuleList, error)
ListGlobalForwardingRules lists all GlobalForwardingRules in the project.
func (*Cloud) ListHTTPHealthChecks ¶
func (gce *Cloud) ListHTTPHealthChecks() (*compute.HttpHealthCheckList, error)
ListHTTPHealthChecks lists all HTTPHealthChecks in the project.
func (*Cloud) ListInstanceGroups ¶
func (gce *Cloud) ListInstanceGroups(zone string) (*compute.InstanceGroupList, error)
ListInstanceGroups lists all InstanceGroups in the project and zone.
func (*Cloud) ListInstancesInInstanceGroup ¶
func (gce *Cloud) ListInstancesInInstanceGroup(name string, zone string, state string) (*compute.InstanceGroupsListInstances, error)
ListInstancesInInstanceGroup lists all the instances in a given instance group and state.
func (*Cloud) ListRoutes ¶
func (gce *Cloud) ListRoutes(clusterName string) ([]*cloudprovider.Route, error)
ListRoutes lists routes
func (*Cloud) ListSslCertificates ¶
func (gce *Cloud) ListSslCertificates() (*compute.SslCertificateList, error)
ListSslCertificates lists all SslCertificates in the project.
func (*Cloud) ListTargetHTTPProxies ¶
func (gce *Cloud) ListTargetHTTPProxies() (*compute.TargetHttpProxyList, error)
ListTargetHTTPProxies lists all TargetHTTPProxies in the project.
func (*Cloud) ListTargetHTTPSProxies ¶
func (gce *Cloud) ListTargetHTTPSProxies() (*compute.TargetHttpsProxyList, error)
ListTargetHTTPSProxies lists all TargetHTTPSProxies in the project.
func (*Cloud) ListURLMaps ¶
func (gce *Cloud) ListURLMaps() (*compute.UrlMapList, error)
ListURLMaps lists all URLMaps in the project.
func (*Cloud) LoadBalancer ¶
func (gce *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)
LoadBalancer returns an implementation of LoadBalancer for Google Compute Engine.
func (*Cloud) NodeAddresses ¶
NodeAddresses is an implementation of Instances.NodeAddresses.
func (*Cloud) ProviderName ¶
ProviderName returns the cloud provider ID.
func (*Cloud) RemoveInstancesFromInstanceGroup ¶
func (gce *Cloud) RemoveInstancesFromInstanceGroup(name string, zone string, instanceNames []string) error
RemoveInstancesFromInstanceGroup removes the given instances from the instance group.
func (*Cloud) ReserveGlobalStaticIP ¶
func (gce *Cloud) 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 (*Cloud) Routes ¶
func (gce *Cloud) Routes() (cloudprovider.Routes, bool)
Routes returns an implementation of Routes for Google Compute Engine.
func (*Cloud) SetProxyForGlobalForwardingRule ¶
func (gce *Cloud) 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 (*Cloud) SetSslCertificateForTargetHTTPSProxy ¶
func (gce *Cloud) SetSslCertificateForTargetHTTPSProxy(proxy *compute.TargetHttpsProxy, sslCert *compute.SslCertificate) error
SetSslCertificateForTargetHTTPSProxy sets the given SslCertificate for the given TargetHTTPSProxy.
func (*Cloud) SetURLMapForTargetHTTPProxy ¶
func (gce *Cloud) SetURLMapForTargetHTTPProxy(proxy *compute.TargetHttpProxy, urlMap *compute.UrlMap) error
SetURLMapForTargetHTTPProxy sets the given URLMap for the given TargetHTTPProxy.
func (*Cloud) SetURLMapForTargetHTTPSProxy ¶
func (gce *Cloud) SetURLMapForTargetHTTPSProxy(proxy *compute.TargetHttpsProxy, urlMap *compute.UrlMap) error
SetURLMapForTargetHTTPSProxy sets the given URLMap for the given TargetHTTPSProxy.
func (*Cloud) UpdateBackendService ¶
func (gce *Cloud) UpdateBackendService(bg *compute.BackendService) error
UpdateBackendService applies the given BackendService as an update to an existing service.
func (*Cloud) UpdateFirewall ¶
func (gce *Cloud) UpdateFirewall(name, desc string, sourceRanges netsets.IPNet, ports []int64, hostNames []string) error
UpdateFirewall applies the given firewall rule as an update to an existing firewall rule with the same name.
func (*Cloud) UpdateHTTPHealthCheck ¶
func (gce *Cloud) UpdateHTTPHealthCheck(hc *compute.HttpHealthCheck) error
UpdateHTTPHealthCheck applies the given HTTPHealthCheck as an update.
func (*Cloud) UpdateLoadBalancer ¶
func (gce *Cloud) UpdateLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error
UpdateLoadBalancer is an implementation of LoadBalancer.UpdateLoadBalancer.
func (*Cloud) UpdateURLMap ¶
UpdateURLMap applies the given UrlMap as an update, and returns the new UrlMap.
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"` NodeTags []string `gcfg:"node-tags"` NodeInstancePrefix string `gcfg:"node-instance-prefix"` Multizone bool `gcfg:"multizone"` } }
Config contains config options for the GCE Cloud
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) 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 // Create an GCE PD volume snapshot CreateSnapshot(diskName string, zone string, snapshotName string, tags map[string]string) error // Delete an GCE PD volume snapshot DeleteSnapshot(snapshotToDelete string) error // Describe a GCE PD volume snapshot status for create or delete. // return status (completed or pending or error), and error DescribeSnapshot(snapshotToGet string) (status string, isCompleted bool, err error) // Find snapshot by tags FindSnapshot(tags map[string]string) ([]string, []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.