package openstack
import "k8s.io/kubernetes/pkg/cloudprovider/providers/openstack"
Index ¶
- Constants
- Variables
- func NewRoutes(compute *gophercloud.ServiceClient, network *gophercloud.ServiceClient, opts RouterOpts) (cloudprovider.Routes, error)
- func RegisterMetrics()
- type APIVersionsByID
- func (apiVersions APIVersionsByID) Len() int
- func (apiVersions APIVersionsByID) Less(i, j int) bool
- func (apiVersions APIVersionsByID) Swap(i, j int)
- type BlockStorageOpts
- type Caller
- type Config
- type Instances
- func (i *Instances) AddSSHKeyToAllInstances(user string, keyData []byte) error
- func (i *Instances) CurrentNodeName(hostname string) (types.NodeName, error)
- func (i *Instances) ExternalID(name types.NodeName) (string, error)
- func (i *Instances) InstanceID(name types.NodeName) (string, error)
- func (i *Instances) InstanceType(name types.NodeName) (string, error)
- func (i *Instances) InstanceTypeByProviderID(providerID string) (string, error)
- func (i *Instances) List(name_filter string) ([]types.NodeName, error)
- func (i *Instances) NodeAddresses(name types.NodeName) ([]v1.NodeAddress, error)
- func (i *Instances) NodeAddressesByProviderID(providerID string) ([]v1.NodeAddress, error)
- type LbaasV1
- func (lb *LbaasV1) EnsureLoadBalancer(clusterName string, apiService *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
- func (lb *LbaasV1) EnsureLoadBalancerDeleted(clusterName string, service *v1.Service) error
- func (lb *LbaasV1) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
- func (lb *LbaasV1) UpdateLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error
- type LbaasV2
- func (lbaas *LbaasV2) EnsureLoadBalancer(clusterName string, apiService *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
- func (lbaas *LbaasV2) EnsureLoadBalancerDeleted(clusterName string, service *v1.Service) error
- func (lbaas *LbaasV2) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
- func (lbaas *LbaasV2) UpdateLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error
- type LoadBalancer
- type LoadBalancerOpts
- type Metadata
- type MyDuration
- type OpenStack
- func (os *OpenStack) AttachDisk(instanceID, volumeID string) (string, error)
- func (os *OpenStack) Clusters() (cloudprovider.Clusters, bool)
- func (os *OpenStack) CreateVolume(name string, size int, vtype, availability string, tags *map[string]string) (string, string, error)
- func (os *OpenStack) DeleteVolume(volumeID string) error
- func (os *OpenStack) DetachDisk(instanceID, volumeID string) error
- func (os *OpenStack) DiskIsAttached(instanceID, volumeID string) (bool, error)
- func (os *OpenStack) DisksAreAttached(instanceID string, volumeIDs []string) (map[string]bool, error)
- func (os *OpenStack) GetAttachmentDiskPath(instanceID, volumeID string) (string, error)
- func (os *OpenStack) GetDevicePath(volumeID string) string
- func (os *OpenStack) GetZone() (cloudprovider.Zone, error)
- func (os *OpenStack) Initialize(clientBuilder controller.ControllerClientBuilder)
- func (os *OpenStack) InstanceID() (string, error)
- func (os *OpenStack) Instances() (cloudprovider.Instances, bool)
- func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool)
- func (os *OpenStack) NewBlockStorageV1() (*gophercloud.ServiceClient, error)
- func (os *OpenStack) NewBlockStorageV2() (*gophercloud.ServiceClient, error)
- func (os *OpenStack) NewComputeV2() (*gophercloud.ServiceClient, error)
- func (os *OpenStack) NewNetworkV2() (*gophercloud.ServiceClient, error)
- func (os *OpenStack) OperationPending(diskName string) (bool, string, error)
- func (os *OpenStack) ProviderName() string
- func (os *OpenStack) Routes() (cloudprovider.Routes, bool)
- func (os *OpenStack) ScrubDNS(nameServers, searches []string) ([]string, []string)
- func (os *OpenStack) ShouldTrustDevicePath() bool
- func (os *OpenStack) Zones() (cloudprovider.Zones, bool)
- type RouterOpts
- type Routes
- func (r *Routes) CreateRoute(clusterName string, nameHint string, route *cloudprovider.Route) error
- func (r *Routes) DeleteRoute(clusterName string, route *cloudprovider.Route) error
- func (r *Routes) ListRoutes(clusterName string) ([]*cloudprovider.Route, error)
- type Volume
- type VolumeCreateOpts
- type VolumesV1
- type VolumesV2
Constants ¶
const ( OpenstackSubsystem = "openstack" OpenstackOperationKey = "cloudprovider_openstack_api_request_duration_seconds" OpenstackOperationErrorKey = "cloudprovider_openstack_api_request_errors" )
const ( VolumeAvailableStatus = "available" VolumeInUseStatus = "in-use" VolumeDeletedStatus = "deleted" VolumeErrorStatus = "error" )
const ProviderName = "openstack"
Variables ¶
var ( OpenstackOperationsLatency = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Subsystem: OpenstackSubsystem, Name: OpenstackOperationKey, Help: "Latency of openstack api call", }, []string{"request"}, ) OpenstackApiRequestErrors = prometheus.NewCounterVec( prometheus.CounterOpts{ Subsystem: OpenstackSubsystem, Name: OpenstackOperationErrorKey, Help: "Cumulative number of openstack Api call errors", }, []string{"request"}, ) )
Functions ¶
func NewRoutes ¶
func NewRoutes(compute *gophercloud.ServiceClient, network *gophercloud.ServiceClient, opts RouterOpts) (cloudprovider.Routes, error)
func RegisterMetrics ¶
func RegisterMetrics()
Types ¶
type APIVersionsByID ¶
type APIVersionsByID []apiversions_v1.APIVersion
Implementation of sort interface for blockstorage version probing
func (APIVersionsByID) Len ¶
func (apiVersions APIVersionsByID) Len() int
func (APIVersionsByID) Less ¶
func (apiVersions APIVersionsByID) Less(i, j int) bool
func (APIVersionsByID) Swap ¶
func (apiVersions APIVersionsByID) Swap(i, j int)
type BlockStorageOpts ¶
type BlockStorageOpts struct { BSVersion string `gcfg:"bs-version"` // overrides autodetection. v1 or v2. Defaults to auto TrustDevicePath bool `gcfg:"trust-device-path"` // See Issue #33128 }
type Caller ¶
type Caller bool
Tiny helper for conditional unwind logic
func NewCaller ¶
func NewCaller() Caller
func (*Caller) Call ¶
func (c *Caller) Call(f func())
func (*Caller) Disarm ¶
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 (*Instances) CurrentNodeName ¶
Implementation of Instances.CurrentNodeName Note this is *not* necessarily the same as hostname.
func (*Instances) ExternalID ¶
ExternalID returns the cloud provider ID of the specified instance (deprecated).
func (*Instances) InstanceID ¶
InstanceID returns the cloud provider ID of the specified instance.
func (*Instances) InstanceType ¶
InstanceType returns the type of the specified instance.
func (*Instances) InstanceTypeByProviderID ¶
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 (*Instances) List ¶
func (*Instances) NodeAddresses ¶
func (*Instances) NodeAddressesByProviderID ¶
func (i *Instances) NodeAddressesByProviderID(providerID string) ([]v1.NodeAddress, error)
NodeAddressesByProviderID returns the node addresses of an instances 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
type LbaasV1 ¶
type LbaasV1 struct { LoadBalancer }
LoadBalancer implementation for LBaaS v1
func (*LbaasV1) EnsureLoadBalancer ¶
func (lb *LbaasV1) EnsureLoadBalancer(clusterName string, apiService *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
func (*LbaasV1) EnsureLoadBalancerDeleted ¶
func (*LbaasV1) GetLoadBalancer ¶
func (lb *LbaasV1) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
func (*LbaasV1) UpdateLoadBalancer ¶
func (lb *LbaasV1) UpdateLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) error
type LbaasV2 ¶
type LbaasV2 struct { LoadBalancer }
LoadBalancer implementation for LBaaS v2
func (*LbaasV2) EnsureLoadBalancer ¶
func (lbaas *LbaasV2) EnsureLoadBalancer(clusterName string, apiService *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)
func (*LbaasV2) EnsureLoadBalancerDeleted ¶
func (*LbaasV2) GetLoadBalancer ¶
func (lbaas *LbaasV2) GetLoadBalancer(clusterName string, service *v1.Service) (*v1.LoadBalancerStatus, bool, error)
func (*LbaasV2) UpdateLoadBalancer ¶
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 ¶
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 ¶
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 ¶
Attaches given cinder volume to the compute running kubelet
func (*OpenStack) Clusters ¶
func (os *OpenStack) Clusters() (cloudprovider.Clusters, bool)
func (*OpenStack) CreateVolume ¶
func (os *OpenStack) CreateVolume(name string, size int, vtype, availability string, tags *map[string]string) (string, string, error)
Create a volume of given size (in GiB)
func (*OpenStack) DeleteVolume ¶
func (*OpenStack) DetachDisk ¶
DetachDisk detaches given cinder volume from the compute running kubelet
func (*OpenStack) DiskIsAttached ¶
query if a volume is attached to a compute instance
func (*OpenStack) DisksAreAttached ¶
func (os *OpenStack) DisksAreAttached(instanceID string, volumeIDs []string) (map[string]bool, error)
query if a list of volumes are attached to a compute instance
func (*OpenStack) GetAttachmentDiskPath ¶
Get device path of attached volume to the compute running kubelet, as known by cinder
func (*OpenStack) GetDevicePath ¶
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) Initialize ¶
func (os *OpenStack) Initialize(clientBuilder controller.ControllerClientBuilder)
Initialize passes a Kubernetes clientBuilder interface to the cloud provider
func (*OpenStack) InstanceID ¶
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 ¶
func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool)
func (*OpenStack) NewBlockStorageV1 ¶
func (os *OpenStack) NewBlockStorageV1() (*gophercloud.ServiceClient, error)
func (*OpenStack) NewBlockStorageV2 ¶
func (os *OpenStack) NewBlockStorageV2() (*gophercloud.ServiceClient, error)
func (*OpenStack) NewComputeV2 ¶
func (os *OpenStack) NewComputeV2() (*gophercloud.ServiceClient, error)
func (*OpenStack) NewNetworkV2 ¶
func (os *OpenStack) NewNetworkV2() (*gophercloud.ServiceClient, error)
func (*OpenStack) OperationPending ¶
func (*OpenStack) ProviderName ¶
ProviderName returns the cloud provider ID.
func (*OpenStack) Routes ¶
func (os *OpenStack) Routes() (cloudprovider.Routes, bool)
func (*OpenStack) ScrubDNS ¶
ScrubDNS filters DNS settings for pods.
func (*OpenStack) ShouldTrustDevicePath ¶
query if we should trust the cinder provide deviceName, See issue #33128
func (*OpenStack) Zones ¶
func (os *OpenStack) Zones() (cloudprovider.Zones, bool)
type RouterOpts ¶
type RouterOpts struct { RouterId string `gcfg:"router-id"` // required }
type Routes ¶
type Routes struct {
// contains filtered or unexported fields
}
func (*Routes) CreateRoute ¶
func (*Routes) DeleteRoute ¶
func (r *Routes) DeleteRoute(clusterName string, route *cloudprovider.Route) error
func (*Routes) ListRoutes ¶
func (r *Routes) ListRoutes(clusterName string) ([]*cloudprovider.Route, error)
type Volume ¶
type Volume struct { // ID of the instance, to which this volume is attached. "" if not attached AttachedServerId string // Device file path AttachedDevice string // Unique identifier for the volume. ID string // Human-readable display name for the volume. Name string // Current status of the volume. Status string }
type VolumeCreateOpts ¶
type VolumeCreateOpts struct { Size int Availability string Name string VolumeType string Metadata map[string]string }
type VolumesV1 ¶
type VolumesV1 struct {
// contains filtered or unexported fields
}
Volumes implementation for v1
type VolumesV2 ¶
type VolumesV2 struct {
// contains filtered or unexported fields
}
Volumes implementation for v2
Source Files ¶
metadata.go openstack.go openstack_client.go openstack_instances.go openstack_loadbalancer.go openstack_metrics.go openstack_routes.go openstack_volumes.go
- Version
- v1.7.8
- Published
- Oct 5, 2017
- Platform
- js/wasm
- Imports
- 55 packages
- Last checked
- 1 minute ago –
Tools for package owners.