yandex

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRegion

func GetRegion(zoneName string) (string, error)

GetRegion returns region of the provided zone.

func MapNodeNameToInstanceName

func MapNodeNameToInstanceName(nodeName types.NodeName) string

func ParseProviderID

func ParseProviderID(providerID string) (instanceName string, instanceNameIsId bool, err error)

Types

type Cloud

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

Cloud is an implementation of cloudprovider.Interface for Yandex.Cloud

func NewCloud

func NewCloud(config CloudConfig, api *yapi.YandexCloudAPI) *Cloud

NewCloud creates a new instance of Cloud object

func (*Cloud) AddSSHKeyToAllInstances

func (yc *Cloud) AddSSHKeyToAllInstances(_ context.Context, _ string, _ []byte) error

func (*Cloud) Clusters

func (yc *Cloud) Clusters() (cloudprovider.Clusters, bool)

Clusters returns a clusters interface if supported.

func (*Cloud) CreateRoute added in v0.11.14

func (yc *Cloud) CreateRoute(ctx context.Context, _ string, _ string, route *cloudprovider.Route) error

func (*Cloud) CurrentNodeName

func (yc *Cloud) CurrentNodeName(_ context.Context, hostName string) (types.NodeName, error)

func (*Cloud) DeleteRoute added in v0.11.14

func (yc *Cloud) DeleteRoute(ctx context.Context, _ string, route *cloudprovider.Route) error

func (*Cloud) EnsureLoadBalancer added in v0.8.0

func (yc *Cloud) EnsureLoadBalancer(ctx context.Context, _ string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)

EnsureLoadBalancer is an implementation of LoadBalancer.EnsureLoadBalancer.

func (*Cloud) EnsureLoadBalancerDeleted added in v0.8.0

func (yc *Cloud) EnsureLoadBalancerDeleted(ctx context.Context, _ string, service *v1.Service) error

EnsureLoadBalancerDeleted is an implementation of LoadBalancer.EnsureLoadBalancerDeleted.

func (*Cloud) GetLoadBalancer added in v0.8.0

func (yc *Cloud) GetLoadBalancer(ctx context.Context, _ string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)

GetLoadBalancer is an implementation of LoadBalancer.GetLoadBalancer

func (*Cloud) GetLoadBalancerName added in v0.8.0

func (yc *Cloud) GetLoadBalancerName(_ context.Context, _ string, service *v1.Service) string

GetLoadBalancerName is an implementation of LoadBalancer.GetLoadBalancerName.

func (*Cloud) GetZone

func (yc *Cloud) GetZone(_ context.Context) (cloudprovider.Zone, error)

func (*Cloud) GetZoneByNodeName

func (yc *Cloud) GetZoneByNodeName(ctx context.Context, nodeName types.NodeName) (cloudprovider.Zone, error)

func (*Cloud) GetZoneByProviderID

func (yc *Cloud) GetZoneByProviderID(ctx context.Context, providerID string) (cloudprovider.Zone, error)

func (*Cloud) HasClusterID

func (yc *Cloud) HasClusterID() bool

HasClusterID returns true if the cluster has a clusterID

func (*Cloud) Initialize

func (yc *Cloud) Initialize(clientBuilder cloudprovider.ControllerClientBuilder, stop <-chan struct{})

Initialize passes a Kubernetes clientBuilder interface to the cloud provider

func (*Cloud) InstanceExistsByProviderID

func (yc *Cloud) InstanceExistsByProviderID(ctx context.Context, providerID string) (bool, error)

func (*Cloud) InstanceID

func (yc *Cloud) InstanceID(ctx context.Context, nodeName types.NodeName) (string, error)

func (*Cloud) InstanceShutdownByProviderID

func (yc *Cloud) InstanceShutdownByProviderID(ctx context.Context, providerID string) (bool, error)

func (*Cloud) InstanceType

func (yc *Cloud) InstanceType(_ context.Context, _ types.NodeName) (string, error)

func (*Cloud) InstanceTypeByProviderID

func (yc *Cloud) InstanceTypeByProviderID(_ context.Context, _ string) (string, error)

func (*Cloud) Instances

func (yc *Cloud) Instances() (cloudprovider.Instances, bool)

Instances returns an instances interface if supported.

func (*Cloud) InstancesV2 added in v0.19.3

func (yc *Cloud) InstancesV2() (cloudprovider.InstancesV2, bool)

InstancesV2 returns a InstancesV2 interface if supported TODO (zuzzas): implement once it's stable enough (starting in v0.20.0)

func (*Cloud) ListRoutes added in v0.11.14

func (yc *Cloud) ListRoutes(ctx context.Context, _ string) ([]*cloudprovider.Route, error)

func (*Cloud) LoadBalancer

func (yc *Cloud) LoadBalancer() (cloudprovider.LoadBalancer, bool)

LoadBalancer returns a balancer interface if supported.

func (*Cloud) NodeAddresses

func (yc *Cloud) NodeAddresses(ctx context.Context, nodeName types.NodeName) ([]v1.NodeAddress, error)

func (*Cloud) NodeAddressesByProviderID

func (yc *Cloud) NodeAddressesByProviderID(ctx context.Context, providerID string) ([]v1.NodeAddress, error)

func (*Cloud) ProviderName

func (yc *Cloud) ProviderName() string

ProviderName returns the cloud provider ID.

func (*Cloud) Routes

func (yc *Cloud) Routes() (cloudprovider.Routes, bool)

Routes returns a routes interface if supported

func (*Cloud) UpdateLoadBalancer added in v0.8.0

func (yc *Cloud) UpdateLoadBalancer(ctx context.Context, _ string, service *v1.Service, nodes []*v1.Node) error

UpdateLoadBalancer is an implementation of LoadBalancer.UpdateLoadBalancer.

func (*Cloud) Zones

func (yc *Cloud) Zones() (cloudprovider.Zones, bool)

Zones returns a zones interface if supported.

type CloudConfig

type CloudConfig struct {
	ClusterName string

	FolderID     string
	LocalRegion  string
	LocalZone    string
	RouteTableID string

	InternalNetworkIDsSet map[string]struct{}
	ExternalNetworkIDsSet map[string]struct{}

	Credentials ycsdk.Credentials
	// contains filtered or unexported fields
}

CloudConfig includes all the necessary configuration for creating Cloud object

func NewCloudConfig

func NewCloudConfig() (*CloudConfig, error)

NewCloudConfig creates a new instance of CloudConfig object

type MetadataService

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

MetadataService knows how to query the Yandex.Cloud instance metadata server. See https://cloud.yandex.com/docs/compute/operations/vm-info/get-info#gce-metadata.

func NewMetadataService

func NewMetadataService() *MetadataService

NewMetadataService creates an instance of the MetadataService object using default metadata URL.

func NewMetadataServiceWithURL

func NewMetadataServiceWithURL(metadataURL string) *MetadataService

NewMetadataServiceWithURL creates an instance of the MetadataService object using specified metadata URL.

func (*MetadataService) Get

func (m *MetadataService) Get(suffix string) (string, error)

Get returns a value from the instance metadata service. The suffix is appended to "${metadataURL}/computeMetadata/v1/".

func (*MetadataService) GetFolderID

func (m *MetadataService) GetFolderID() (string, error)

GetFolderID returns the current VM's FolderID, such as "b1g4c2a3g6vkffp3qacq" Currently instance metadata service does not implement "project/project-id" element, so we using "instance/zone" to extract FolderID information

func (*MetadataService) GetZone

func (m *MetadataService) GetZone() (string, error)

GetZone returns the current VM's Zone, such as "ru-central1-a".

type NodeTargetGroupSyncer added in v0.11.2

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

func (*NodeTargetGroupSyncer) SyncTGs added in v0.15.12

func (ntgs *NodeTargetGroupSyncer) SyncTGs(ctx context.Context, nodes []*corev1.Node) error

Jump to

Keyboard shortcuts

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