Documentation ¶
Index ¶
- type FakeInstanceGroups
- func (f *FakeInstanceGroups) AddInstancesToInstanceGroup(name string, instanceNames []string) error
- func (f *FakeInstanceGroups) AddPortToInstanceGroup(ig *compute.InstanceGroup, port int64) (*compute.NamedPort, error)
- func (f *FakeInstanceGroups) CreateInstanceGroup(name string) (*compute.InstanceGroup, error)
- func (f *FakeInstanceGroups) DeleteInstanceGroup(name string) error
- func (f *FakeInstanceGroups) GetInstanceGroup(name string) (*compute.InstanceGroup, error)
- func (f *FakeInstanceGroups) ListInstancesInInstanceGroup(name string, state string) (*compute.InstanceGroupsListInstances, error)
- func (f *FakeInstanceGroups) RemoveInstancesFromInstanceGroup(name string, instanceNames []string) error
- type InstanceGroups
- type Instances
- func (i *Instances) Add(groupName string, names []string) error
- func (i *Instances) AddInstanceGroup(name string, port int64) (*compute.InstanceGroup, *compute.NamedPort, error)
- func (i *Instances) DeleteInstanceGroup(name string) error
- func (i *Instances) Get(name string) (*compute.InstanceGroup, error)
- func (i *Instances) Remove(groupName string, names []string) error
- func (i *Instances) Sync(nodes []string) (err error)
- type NodePool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeInstanceGroups ¶
type FakeInstanceGroups struct { Ports []int64 // contains filtered or unexported fields }
FakeInstanceGroups fakes out the instance groups api.
func NewFakeInstanceGroups ¶
func NewFakeInstanceGroups(nodes sets.String) *FakeInstanceGroups
NewFakeInstanceGroups creates a new FakeInstanceGroups.
func (*FakeInstanceGroups) AddInstancesToInstanceGroup ¶
func (f *FakeInstanceGroups) AddInstancesToInstanceGroup(name string, instanceNames []string) error
AddInstancesToInstanceGroup fakes adding instances to an instance group.
func (*FakeInstanceGroups) AddPortToInstanceGroup ¶
func (f *FakeInstanceGroups) AddPortToInstanceGroup(ig *compute.InstanceGroup, port int64) (*compute.NamedPort, error)
AddPortToInstanceGroup fakes adding ports to an Instance Group.
func (*FakeInstanceGroups) CreateInstanceGroup ¶
func (f *FakeInstanceGroups) CreateInstanceGroup(name string) (*compute.InstanceGroup, error)
CreateInstanceGroup fakes instance group creation.
func (*FakeInstanceGroups) DeleteInstanceGroup ¶
func (f *FakeInstanceGroups) DeleteInstanceGroup(name string) error
DeleteInstanceGroup fakes instance group deletion.
func (*FakeInstanceGroups) GetInstanceGroup ¶
func (f *FakeInstanceGroups) GetInstanceGroup(name string) (*compute.InstanceGroup, error)
GetInstanceGroup fakes getting an instance group from the cloud.
func (*FakeInstanceGroups) ListInstancesInInstanceGroup ¶
func (f *FakeInstanceGroups) ListInstancesInInstanceGroup(name string, state string) (*compute.InstanceGroupsListInstances, error)
ListInstancesInInstanceGroup fakes listing instances in an instance group.
func (*FakeInstanceGroups) RemoveInstancesFromInstanceGroup ¶
func (f *FakeInstanceGroups) RemoveInstancesFromInstanceGroup(name string, instanceNames []string) error
RemoveInstancesFromInstanceGroup fakes removing instances from an instance group.
type InstanceGroups ¶
type InstanceGroups interface { GetInstanceGroup(name string) (*compute.InstanceGroup, error) CreateInstanceGroup(name string) (*compute.InstanceGroup, error) DeleteInstanceGroup(name string) error // TODO: Refactor for modulatiry. ListInstancesInInstanceGroup(name string, state string) (*compute.InstanceGroupsListInstances, error) AddInstancesToInstanceGroup(name string, instanceNames []string) error RemoveInstancesFromInstanceGroup(name string, instanceName []string) error AddPortToInstanceGroup(ig *compute.InstanceGroup, port int64) (*compute.NamedPort, error) }
InstanceGroups is an interface for managing gce instances groups, and the instances therein.
type Instances ¶
type Instances struct {
// contains filtered or unexported fields
}
Instances implements NodePool.
func (*Instances) AddInstanceGroup ¶
func (i *Instances) AddInstanceGroup(name string, port int64) (*compute.InstanceGroup, *compute.NamedPort, error)
AddInstanceGroup creates or gets an instance group if it doesn't exist and adds the given port to it.
func (*Instances) DeleteInstanceGroup ¶
DeleteInstanceGroup deletes the given IG by name.
func (*Instances) Get ¶
func (i *Instances) Get(name string) (*compute.InstanceGroup, error)
Get returns the Instance Group by name.
type NodePool ¶
type NodePool interface { AddInstanceGroup(name string, port int64) (*compute.InstanceGroup, *compute.NamedPort, error) DeleteInstanceGroup(name string) error // TODO: Refactor for modularity Add(groupName string, nodeNames []string) error Remove(groupName string, nodeNames []string) error Sync(nodeNames []string) error Get(name string) (*compute.InstanceGroup, error) }
NodePool is an interface to manage a pool of kubernetes nodes synced with vm instances in the cloud through the InstanceGroups interface.
func NewNodePool ¶
func NewNodePool(cloud InstanceGroups) NodePool
NewNodePool creates a new node pool.
- cloud: implements InstanceGroups, used to sync Kubernetes nodes with members of the cloud InstanceGroup.