openstack

package
v1.6.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2017 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MiB = 1024 * 1024
	GB  = 1000 * 1000 * 1000
)
View Source
const ProviderName = "openstack"

Variables

View Source
var ErrBadMetadata = errors.New("Invalid OpenStack metadata, got empty uuid")
View Source
var ErrMultipleResults = errors.New("Multiple results where only one expected")
View Source
var ErrNoAddressFound = errors.New("No address found for host")
View Source
var ErrNoRouterId = errors.New("router-id not set in cloud provider config")
View Source
var ErrNotFound = errors.New("Failed to find object")

Functions

func NewRoutes added in v1.6.0

Types

type BlockStorageOpts added in v1.5.0

type BlockStorageOpts struct {
	TrustDevicePath bool `gcfg:"trust-device-path"` // See Issue #33128
}

type Caller added in v1.6.0

type Caller bool

Tiny helper for conditional unwind logic

func NewCaller added in v1.6.0

func NewCaller() Caller

func (*Caller) Call added in v1.6.0

func (c *Caller) Call(f func())

func (*Caller) Disarm added in v1.6.0

func (c *Caller) Disarm()

type Config

type Config struct {
	Global struct {
		AuthUrl    string `gcfg:"auth-url"`
		Username   string
		UserId     string `gcfg:"user-id"`
		Password   string
		TenantId   string `gcfg:"tenant-id"`
		TenantName string `gcfg:"tenant-name"`
		TrustId    string `gcfg:"trust-id"`
		DomainId   string `gcfg:"domain-id"`
		DomainName string `gcfg:"domain-name"`
		Region     string
		CAFile     string `gcfg:"ca-file"`
	}
	LoadBalancer LoadBalancerOpts
	BlockStorage BlockStorageOpts
	Route        RouterOpts
}

type Instances

type Instances struct {
	// contains filtered or unexported fields
}

func (*Instances) AddSSHKeyToAllInstances

func (i *Instances) AddSSHKeyToAllInstances(user string, keyData []byte) error

func (*Instances) CurrentNodeName

func (i *Instances) CurrentNodeName(hostname string) (types.NodeName, error)

Implementation of Instances.CurrentNodeName Note this is *not* necessarily the same as hostname.

func (*Instances) ExternalID

func (i *Instances) ExternalID(name types.NodeName) (string, error)

ExternalID returns the cloud provider ID of the specified instance (deprecated).

func (*Instances) InstanceID

func (i *Instances) InstanceID(name types.NodeName) (string, error)

InstanceID returns the cloud provider ID of the specified instance.

func (*Instances) InstanceType added in v1.2.0

func (i *Instances) InstanceType(name types.NodeName) (string, error)

InstanceType returns the type of the specified instance.

func (*Instances) List

func (i *Instances) List(name_filter string) ([]types.NodeName, error)

func (*Instances) NodeAddresses

func (i *Instances) NodeAddresses(name types.NodeName) ([]v1.NodeAddress, error)

type LbaasV1 added in v1.3.0

type LbaasV1 struct {
	LoadBalancer
}

LoadBalancer implementation for LBaaS v1

func (*LbaasV1) EnsureLoadBalancer added in v1.3.0

func (lb *LbaasV1) EnsureLoadBalancer(clusterName string, apiService *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)

func (*LbaasV1) EnsureLoadBalancerDeleted added in v1.3.0

func (lb *LbaasV1) EnsureLoadBalancerDeleted(clusterName string, service *v1.Service) error

func (*LbaasV1) GetLoadBalancer added in v1.3.0

func (lb *LbaasV1) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)

func (*LbaasV1) UpdateLoadBalancer added in v1.3.0

func (lb *LbaasV1) UpdateLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error

type LbaasV2 added in v1.3.0

type LbaasV2 struct {
	LoadBalancer
}

LoadBalancer implementation for LBaaS v2

func (*LbaasV2) EnsureLoadBalancer added in v1.3.0

func (lbaas *LbaasV2) EnsureLoadBalancer(clusterName string, apiService *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)

func (*LbaasV2) EnsureLoadBalancerDeleted added in v1.3.0

func (lbaas *LbaasV2) EnsureLoadBalancerDeleted(clusterName string, service *v1.Service) error

func (*LbaasV2) GetLoadBalancer added in v1.3.0

func (lbaas *LbaasV2) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)

func (*LbaasV2) UpdateLoadBalancer added in v1.3.0

func (lbaas *LbaasV2) UpdateLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error

type LoadBalancer

type LoadBalancer struct {
	// contains filtered or unexported fields
}

type LoadBalancerOpts

type LoadBalancerOpts struct {
	LBVersion            string     `gcfg:"lb-version"` // overrides autodetection. v1 or v2
	SubnetId             string     `gcfg:"subnet-id"`  // required
	FloatingNetworkId    string     `gcfg:"floating-network-id"`
	LBMethod             string     `gcfg:"lb-method"`
	CreateMonitor        bool       `gcfg:"create-monitor"`
	MonitorDelay         MyDuration `gcfg:"monitor-delay"`
	MonitorTimeout       MyDuration `gcfg:"monitor-timeout"`
	MonitorMaxRetries    uint       `gcfg:"monitor-max-retries"`
	ManageSecurityGroups bool       `gcfg:"manage-security-groups"`
	NodeSecurityGroupID  string     `gcfg:"node-security-group"`
}

type Metadata added in v1.5.0

type Metadata struct {
	Uuid             string `json:"uuid"`
	Name             string `json:"name"`
	AvailabilityZone string `json:"availability_zone"`
}

Assumes the "2012-08-10" meta_data.json format. See http://docs.openstack.org/user-guide/cli_config_drive.html

type MyDuration

type MyDuration struct {
	time.Duration
}

encoding.TextUnmarshaler interface for time.Duration

func (*MyDuration) UnmarshalText

func (d *MyDuration) UnmarshalText(text []byte) error

type OpenStack

type OpenStack struct {
	// contains filtered or unexported fields
}

OpenStack is an implementation of cloud provider Interface for OpenStack.

func (*OpenStack) AttachDisk

func (os *OpenStack) AttachDisk(instanceID string, diskName string) (string, error)

Attaches given cinder volume to the compute running kubelet

func (*OpenStack) Clusters

func (os *OpenStack) Clusters() (cloudprovider.Clusters, bool)

func (*OpenStack) CreateVolume added in v1.2.0

func (os *OpenStack) CreateVolume(name string, size int, vtype, availability string, tags *map[string]string) (volumeName string, err error)

Create a volume of given size (in GiB)

func (*OpenStack) DeleteVolume added in v1.2.0

func (os *OpenStack) DeleteVolume(volumeName string) error

func (*OpenStack) DetachDisk

func (os *OpenStack) DetachDisk(instanceID string, partialDiskId string) error

Detaches given cinder volume from the compute running kubelet

func (*OpenStack) DiskIsAttached added in v1.3.0

func (os *OpenStack) DiskIsAttached(diskName, instanceID string) (bool, error)

query if a volume is attached to a compute instance

func (*OpenStack) DisksAreAttached added in v1.4.6

func (os *OpenStack) DisksAreAttached(diskNames []string, instanceID string) (map[string]bool, error)

query if a list of volumes are attached to a compute instance

func (*OpenStack) GetAttachmentDiskPath added in v1.3.0

func (os *OpenStack) GetAttachmentDiskPath(instanceID string, diskName string) (string, error)

Get device path of attached volume to the compute running kubelet, as known by cinder

func (*OpenStack) GetDevicePath added in v1.3.0

func (os *OpenStack) GetDevicePath(diskId string) string

GetDevicePath returns the path of an attached block storage volume, specified by its id.

func (*OpenStack) GetZone

func (os *OpenStack) GetZone() (cloudprovider.Zone, error)

func (*OpenStack) InstanceID added in v1.3.0

func (os *OpenStack) InstanceID() (string, error)

InstanceID returns the kubelet's cloud provider ID.

func (*OpenStack) Instances

func (os *OpenStack) Instances() (cloudprovider.Instances, bool)

Instances returns an implementation of Instances for OpenStack.

func (*OpenStack) LoadBalancer added in v1.2.0

func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool)

func (*OpenStack) ProviderName

func (os *OpenStack) ProviderName() string

ProviderName returns the cloud provider ID.

func (*OpenStack) Routes

func (os *OpenStack) Routes() (cloudprovider.Routes, bool)

func (*OpenStack) ScrubDNS added in v1.1.1

func (os *OpenStack) ScrubDNS(nameServers, searches []string) ([]string, []string)

ScrubDNS filters DNS settings for pods.

func (*OpenStack) ShouldTrustDevicePath added in v1.5.0

func (os *OpenStack) ShouldTrustDevicePath() bool

query if we should trust the cinder provide deviceName, See issue #33128

func (*OpenStack) Zones

func (os *OpenStack) Zones() (cloudprovider.Zones, bool)

type RouterOpts added in v1.6.0

type RouterOpts struct {
	RouterId string `gcfg:"router-id"` // required
}

type Routes added in v1.6.0

type Routes struct {
	// contains filtered or unexported fields
}

func (*Routes) CreateRoute added in v1.6.0

func (r *Routes) CreateRoute(clusterName string, nameHint string, route *cloudprovider.Route) error

func (*Routes) DeleteRoute added in v1.6.0

func (r *Routes) DeleteRoute(clusterName string, route *cloudprovider.Route) error

func (*Routes) ListRoutes added in v1.6.0

func (r *Routes) ListRoutes(clusterName string) ([]*cloudprovider.Route, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL