Documentation ¶
Index ¶
- func GenerateInstanceUrl(project, zone, name string) string
- func GenerateMigUrl(project, zone, name string) string
- func ParseInstanceUrl(url string) (project string, zone string, name string, err error)
- func ParseMigUrl(url string) (project string, zone string, name string, err error)
- type GceCloudProvider
- type GceManager
- func (m *GceManager) DeleteInstances(instances []*GceRef) error
- func (m *GceManager) GetMigForInstance(instance *GceRef) (*Mig, error)
- func (m *GceManager) GetMigNodes(mig *Mig) ([]string, error)
- func (m *GceManager) GetMigSize(mig *Mig) (int64, error)
- func (m *GceManager) RegisterMig(mig *Mig)
- func (m *GceManager) SetMigSize(mig *Mig, size int64) error
- type GceRef
- type Mig
- func (mig *Mig) Belongs(node *apiv1.Node) (bool, error)
- func (mig *Mig) Debug() string
- func (mig *Mig) DecreaseTargetSize(delta int) error
- func (mig *Mig) DeleteNodes(nodes []*apiv1.Node) error
- func (mig *Mig) Id() string
- func (mig *Mig) IncreaseSize(delta int) error
- func (mig *Mig) MaxSize() int
- func (mig *Mig) MinSize() int
- func (mig *Mig) Nodes() ([]string, error)
- func (mig *Mig) TargetSize() (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateInstanceUrl ¶
GenerateInstanceUrl generates url for instance.
func GenerateMigUrl ¶
GenerateMigUrl generates url for instance.
func ParseInstanceUrl ¶
ParseInstanceUrl expects url in format: https://content.googleapis.com/compute/v1/projects/<project-id>/zones/<zone>/instances/<name>
func ParseMigUrl ¶
ParseMigUrl expects url in format: https://content.googleapis.com/compute/v1/projects/<project-id>/zones/<zone>/instanceGroups/<name>
Types ¶
type GceCloudProvider ¶
type GceCloudProvider struct {
// contains filtered or unexported fields
}
GceCloudProvider implements CloudProvider interface.
func BuildGceCloudProvider ¶
func BuildGceCloudProvider(gceManager *GceManager, specs []string) (*GceCloudProvider, error)
BuildGceCloudProvider builds CloudProvider implementation for GCE.
func (*GceCloudProvider) Name ¶
func (gce *GceCloudProvider) Name() string
Name returns name of the cloud provider.
func (*GceCloudProvider) NodeGroupForNode ¶
func (gce *GceCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error)
NodeGroupForNode returns the node group for the given node.
func (*GceCloudProvider) NodeGroups ¶
func (gce *GceCloudProvider) NodeGroups() []cloudprovider.NodeGroup
NodeGroups returns all node groups configured for this cloud provider.
type GceManager ¶
type GceManager struct {
// contains filtered or unexported fields
}
GceManager is handles gce communication and data caching.
func CreateGceManager ¶
func CreateGceManager(configReader io.Reader) (*GceManager, error)
CreateGceManager constructs gceManager object.
func (*GceManager) DeleteInstances ¶
func (m *GceManager) DeleteInstances(instances []*GceRef) error
DeleteInstances deletes the given instances. All instances must be controlled by the same MIG.
func (*GceManager) GetMigForInstance ¶
func (m *GceManager) GetMigForInstance(instance *GceRef) (*Mig, error)
GetMigForInstance returns MigConfig of the given Instance
func (*GceManager) GetMigNodes ¶
func (m *GceManager) GetMigNodes(mig *Mig) ([]string, error)
GetMigNodes returns mig nodes.
func (*GceManager) GetMigSize ¶
func (m *GceManager) GetMigSize(mig *Mig) (int64, error)
GetMigSize gets MIG size.
func (*GceManager) RegisterMig ¶
func (m *GceManager) RegisterMig(mig *Mig)
RegisterMig registers mig in Gce Manager.
func (*GceManager) SetMigSize ¶
func (m *GceManager) SetMigSize(mig *Mig, size int64) error
SetMigSize sets MIG size.
type GceRef ¶
GceRef contains s reference to some entity in GCE/GKE world.
func GceRefFromProviderId ¶
GceRefFromProviderId creates InstanceConfig object from provider id which must be in format: gce://<project-id>/<zone>/<name> TODO(piosz): add better check whether the id is correct
type Mig ¶
type Mig struct { GceRef // contains filtered or unexported fields }
Mig implements NodeGroup interfrace.
func (*Mig) DecreaseTargetSize ¶
DecreaseTargetSize decreases the target size of the node group. This function doesn't permit to delete any existing node and can be used only to reduce the request for new nodes that have not been yet fulfilled. Delta should be negative.
func (*Mig) DeleteNodes ¶
DeleteNodes deletes the nodes from the group.
func (*Mig) IncreaseSize ¶
IncreaseSize increases Mig size
func (*Mig) TargetSize ¶
TargetSize returns the current TARGET size of the node group. It is possible that the number is different from the number of nodes registered in Kuberentes.