alicloud

package
v0.0.0-...-8d0eeec Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENI_ID     = "eni-abcdef1122344"
	ENI_ADDR_1 = "192.168.0.1"
	ENI_ADDR_2 = "192.168.0.2"
)
View Source
const (
	// ServiceAnnotationPrefix prefix of service annotation
	ServiceAnnotationPrefix = "service.beta.kubernetes.io/alibaba-cloud-"

	// ServiceAnnotationLegacyPrefix legacy prefix of service annotation
	ServiceAnnotationLegacyPrefix = "service.beta.kubernetes.io/alicloud-"

	// ServiceAnnotationLoadBalancerPrefix loadbalancer prefix
	ServiceAnnotationLoadBalancerPrefix = ServiceAnnotationPrefix + "loadbalancer-"

	// ServiceAnnotationPrivateZonePrefix private zone prefix
	ServiceAnnotationPrivateZonePrefix = ServiceAnnotationPrefix + "private-zone-"

	// ServiceAnnotationLoadBalancerAclStatus enable or disable acl on all listener
	ServiceAnnotationLoadBalancerAclStatus = ServiceAnnotationLoadBalancerPrefix + "acl-status"

	// ServiceAnnotationLoadBalancerAclID acl id
	ServiceAnnotationLoadBalancerAclID = ServiceAnnotationLoadBalancerPrefix + "acl-id"

	// ServiceAnnotationLoadBalancerAclType acl type, black or white
	ServiceAnnotationLoadBalancerAclType = ServiceAnnotationLoadBalancerPrefix + "acl-type"

	// ServiceAnnotationLoadBalancerProtocolPort protocol port
	ServiceAnnotationLoadBalancerProtocolPort = ServiceAnnotationLoadBalancerPrefix + "protocol-port"

	// ServiceAnnotationLoadBalancerAddressType loadbalancer address type
	ServiceAnnotationLoadBalancerAddressType = ServiceAnnotationLoadBalancerPrefix + "address-type"

	// ServiceAnnotationLoadBalancerVswitch loadbalancer vswitch id
	ServiceAnnotationLoadBalancerVswitch = ServiceAnnotationLoadBalancerPrefix + "vswitch-id"

	// ServiceAnnotationLoadBalancerForwardPort loadbalancer forward port
	ServiceAnnotationLoadBalancerForwardPort = ServiceAnnotationLoadBalancerPrefix + "forward-port"

	// ServiceAnnotationLoadBalancerSLBNetworkType loadbalancer network type
	ServiceAnnotationLoadBalancerSLBNetworkType = ServiceAnnotationLoadBalancerPrefix + "slb-network-type"
	// ServiceAnnotationLoadBalancerChargeType lb charge type
	ServiceAnnotationLoadBalancerChargeType = ServiceAnnotationLoadBalancerPrefix + "charge-type"

	// ServiceAnnotationLoadBalancerId lb id
	ServiceAnnotationLoadBalancerId = ServiceAnnotationLoadBalancerPrefix + "id"

	// ServiceAnnotationLoadBalancerBackendLabel backend labels
	ServiceAnnotationLoadBalancerBackendLabel = ServiceAnnotationLoadBalancerPrefix + "backend-label"

	// ServiceAnnotationLoadBalancerRegion region
	ServiceAnnotationLoadBalancerRegion = ServiceAnnotationLoadBalancerPrefix + "region"

	// ServiceAnnotationLoadBalancerMasterZoneID master zone id
	ServiceAnnotationLoadBalancerMasterZoneID = ServiceAnnotationLoadBalancerPrefix + "master-zoneid"

	// ServiceAnnotationLoadBalancerSlaveZoneID slave zone id
	ServiceAnnotationLoadBalancerSlaveZoneID = ServiceAnnotationLoadBalancerPrefix + "slave-zoneid"

	// ServiceAnnotationLoadBalancerBandwidth bandwidth
	ServiceAnnotationLoadBalancerBandwidth = ServiceAnnotationLoadBalancerPrefix + "bandwidth"

	// ServiceAnnotationLoadBalancerCertID cert id
	ServiceAnnotationLoadBalancerCertID = ServiceAnnotationLoadBalancerPrefix + "cert-id"

	// ServiceAnnotationLoadBalancerHealthCheckFlag health check flag
	ServiceAnnotationLoadBalancerHealthCheckFlag = ServiceAnnotationLoadBalancerPrefix + "health-check-flag"

	// ServiceAnnotationLoadBalancerHealthCheckType health check type
	ServiceAnnotationLoadBalancerHealthCheckType = ServiceAnnotationLoadBalancerPrefix + "health-check-type"

	// ServiceAnnotationLoadBalancerHealthCheckURI health check uri
	ServiceAnnotationLoadBalancerHealthCheckURI = ServiceAnnotationLoadBalancerPrefix + "health-check-uri"

	// ServiceAnnotationLoadBalancerHealthCheckConnectPort health check connect port
	ServiceAnnotationLoadBalancerHealthCheckConnectPort = ServiceAnnotationLoadBalancerPrefix + "health-check-connect-port"

	// ServiceAnnotationLoadBalancerHealthCheckHealthyThreshold health check healthy thresh hold
	ServiceAnnotationLoadBalancerHealthCheckHealthyThreshold = ServiceAnnotationLoadBalancerPrefix + "healthy-threshold"

	// ServiceAnnotationLoadBalancerHealthCheckUnhealthyThreshold health check unhealthy thresh hold
	ServiceAnnotationLoadBalancerHealthCheckUnhealthyThreshold = ServiceAnnotationLoadBalancerPrefix + "unhealthy-threshold"

	// ServiceAnnotationLoadBalancerHealthCheckInterval health check interval
	ServiceAnnotationLoadBalancerHealthCheckInterval = ServiceAnnotationLoadBalancerPrefix + "health-check-interval"

	// ServiceAnnotationLoadBalancerHealthCheckConnectTimeout health check connect timeout
	ServiceAnnotationLoadBalancerHealthCheckConnectTimeout = ServiceAnnotationLoadBalancerPrefix + "health-check-connect-timeout"

	// ServiceAnnotationLoadBalancerHealthCheckTimeout health check timeout
	ServiceAnnotationLoadBalancerHealthCheckTimeout = ServiceAnnotationLoadBalancerPrefix + "health-check-timeout"

	// ServiceAnnotationLoadBalancerHealthCheckDomain health check domain
	ServiceAnnotationLoadBalancerHealthCheckDomain = ServiceAnnotationLoadBalancerPrefix + "health-check-domain"

	// ServiceAnnotationLoadBalancerHealthCheckHTTPCode health check http code
	ServiceAnnotationLoadBalancerHealthCheckHTTPCode = ServiceAnnotationLoadBalancerPrefix + "health-check-httpcode"

	// ServiceAnnotationLoadBalancerAdditionalTags For example: "Key1=Val1,Key2=Val2,KeyNoVal1=,KeyNoVal2",same with aws
	ServiceAnnotationLoadBalancerAdditionalTags = ServiceAnnotationLoadBalancerPrefix + "additional-resource-tags"

	// ServiceAnnotationLoadBalancerOverrideListener force override listeners
	ServiceAnnotationLoadBalancerOverrideListener = ServiceAnnotationLoadBalancerPrefix + "force-override-listeners"

	// ServiceAnnotationLoadBalancerSpec slb spec
	ServiceAnnotationLoadBalancerSpec = ServiceAnnotationLoadBalancerPrefix + "spec"

	// ServiceAnnotationLoadBalancerScheduler slb scheduler
	ServiceAnnotationLoadBalancerScheduler = ServiceAnnotationLoadBalancerPrefix + "scheduler"

	// ServiceAnnotationLoadBalancerSessionStick sticky session
	ServiceAnnotationLoadBalancerSessionStick = ServiceAnnotationLoadBalancerPrefix + "sticky-session"

	// ServiceAnnotationLoadBalancerSessionStickType session sticky type
	ServiceAnnotationLoadBalancerSessionStickType = ServiceAnnotationLoadBalancerPrefix + "sticky-session-type"

	// ServiceAnnotationLoadBalancerCookieTimeout cookie timeout
	ServiceAnnotationLoadBalancerCookieTimeout = ServiceAnnotationLoadBalancerPrefix + "cookie-timeout"

	//ServiceAnnotationLoadBalancerCookie lb cookie
	ServiceAnnotationLoadBalancerCookie = ServiceAnnotationLoadBalancerPrefix + "cookie"

	// ServiceAnnotationLoadBalancerPersistenceTimeout persistence timeout
	ServiceAnnotationLoadBalancerPersistenceTimeout = ServiceAnnotationLoadBalancerPrefix + "persistence-timeout"

	//ServiceAnnotationLoadBalancerIPVersion ip version
	ServiceAnnotationLoadBalancerIPVersion = ServiceAnnotationLoadBalancerPrefix + "ip-version"

	// MAX_LOADBALANCER_BACKEND max default lb backend count.
	MAX_LOADBALANCER_BACKEND = 18

	// ServiceAnnotationLoadBalancerPrivateZoneName private zone name
	ServiceAnnotationLoadBalancerPrivateZoneName = ServiceAnnotationPrivateZonePrefix + "name"

	// ServiceAnnotationLoadBalancerPrivateZoneId private zone id
	ServiceAnnotationLoadBalancerPrivateZoneId = ServiceAnnotationPrivateZonePrefix + "id"

	// ServiceAnnotationLoadBalancerPrivateZoneRecordName private zone record name
	ServiceAnnotationLoadBalancerPrivateZoneRecordName = ServiceAnnotationPrivateZonePrefix + "record-name"

	// ServiceAnnotationLoadBalancerPrivateZoneRecordTTL private zone record ttl
	ServiceAnnotationLoadBalancerPrivateZoneRecordTTL = ServiceAnnotationPrivateZonePrefix + "record-ttl"

	// ServiceAnnotationLoadBalancerBackendType backend type
	ServiceAnnotationLoadBalancerBackendType = utils.BACKEND_TYPE_LABEL
)
View Source
const DEFAULT_LANG = "en"

DEFAULT_LANG default lang

View Source
const DEFAULT_SERVER_WEIGHT = 100

DEFAULT_SERVER_WEIGHT default server weight

View Source
const MAX_BACKEND_NUM = 19

MAX_BACKEND_NUM max batch backend num

View Source
const ProviderName = "alicloud"

ProviderName is the name of this cloud provider.

View Source
const TAGKEY = "kubernetes.do.not.delete"

TAGKEY Default tag key.

Variables

View Source
var (
	// DEFAULT_CHARGE_TYPE default charge type
	DEFAULT_CHARGE_TYPE = common.PayByTraffic

	// DEFAULT_BANDWIDTH default bandwidth
	DEFAULT_BANDWIDTH = 100

	// DEFAULT_ADDRESS_TYPE default address type
	DEFAULT_ADDRESS_TYPE = slb.InternetAddressType

	DEFAULT_NODE_MONITOR_PERIOD = 120 * time.Second

	DEFAULT_NODE_ADDR_SYNC_PERIOD = 240 * time.Second

	// DEFAULT_REGION should be override in cloud initialize.
	DEFAULT_REGION = common.Hangzhou
)
View Source
var (
	INSTANCEID  = "i-xlakjbidlslkcdxxxx"
	INSTANCEID2 = "i-xlakjbidlslkcdxxxx2"
)
View Source
var (
	LOADBALANCER_ID = "lb-bp1ids9hmq5924m6uk5w1"
	// do not change LOADBALANCER_NAME unless needed
	LOADBALANCER_NAME         = "ac83f8bed812e11e9a0ad00163e0a398"
	LOADBALANCER_ADDRESS      = "47.97.241.114"
	LOADBALANCER_NETWORK_TYPE = "classic"
	LOADBALANCER_SPEC         = slb.LoadBalancerSpecType(slb.S1Small)

	SERVICE_UID = types.UID("2cb99d47-cc83-11e8-99db-00163e125603")
)
View Source
var (
	VPCID          = "vpc-2zeaybwqmvn6qgabfd3pe"
	VROUTER_ID     = "vrt-2zegcm0ty46mq243fmxoj"
	ROUTE_TABLE_ID = "vtb-2zedne8cr43rp5oqsr9xg"
	REGION         = common.Hangzhou
	REGION_A       = "cn-hangzhou-a"
	VSWITCH_ID     = "vsw-2zeclpmxy66zzxj4cg4ls"
	ROUTE_ENTRIES  = []ecs.RouteEntrySetType{
		{
			RouteTableId:         ROUTE_TABLE_ID,
			DestinationCidrBlock: "172.16.3.0/24",
			Type:                 ecs.RouteTableCustom,
			NextHopType:          "Instance",
			InstanceId:           "i-2zee0h6bdcgrocv2n9jb",
			Status:               ecs.RouteEntryStatusAvailable,
		},
		{
			RouteTableId:         ROUTE_TABLE_ID,
			DestinationCidrBlock: "172.16.2.0/24",
			Type:                 ecs.RouteTableCustom,
			NextHopType:          "Instance",
			InstanceId:           "i-2zecarjjmtkx3oru4233",
			Status:               ecs.RouteEntryStatusAvailable,
		},
		{
			RouteTableId:         ROUTE_TABLE_ID,
			DestinationCidrBlock: "172.16.0.0/24",
			Type:                 ecs.RouteTableCustom,
			NextHopType:          "Instance",
			InstanceId:           "i-2ze7q4vl8cosjsd56j0h",
			Status:               ecs.RouteEntryStatusAvailable,
		},
		{
			RouteTableId:         ROUTE_TABLE_ID,
			DestinationCidrBlock: "0.0.0.0/0",
			Type:                 ecs.RouteTableCustom,
			NextHopType:          "NatGateway",
			InstanceId:           "ngw-2zetlvdtq0zt9ubez3zz3",
			Status:               ecs.RouteEntryStatusAvailable,
		},
		{
			RouteTableId:         ROUTE_TABLE_ID,
			DestinationCidrBlock: "192.168.0.0/16",
			Type:                 ecs.RouteTableSystem,
			NextHopType:          "local",
			Status:               ecs.RouteEntryStatusAvailable,
		},
		{
			RouteTableId:         ROUTE_TABLE_ID,
			DestinationCidrBlock: "100.64.0.0/10",
			Type:                 ecs.RouteTableSystem,
			NextHopType:          "service",
			Status:               ecs.RouteEntryStatusAvailable,
		},
	}
)
View Source
var (
	// ACTION_ADD actions add
	ACTION_ADD = "ADD"

	// ACTION_UPDATE update
	ACTION_UPDATE = "UPDATE"

	// ACTION_DELETE delete
	ACTION_DELETE = "DELETE"
)
View Source
var ASSUME_ROLE_NAME = "AliyunCSManagedKubernetesRole"

ASSUME_ROLE_NAME managed kubernetes role name

View Source
var CLUSTER_ID = "clusterid"

CLUSTER_ID default cluster id if it is not specified.

View Source
var DEFAULT_LISTENER_BANDWIDTH = -1

DEFAULT_LISTENER_BANDWIDTH default listener bandwidth

View Source
var DEFAULT_PREFIX = "k8s"

DEFAULT_PREFIX default prefix for listener

View Source
var FORMAT_ERROR = "ListenerName Format Error: k8s/${port}/${service}/${namespace}/${clusterid} format is expected"

FORMAT_ERROR format error message

View Source
var INSTANCE = InstanceStore{}
View Source
var KUBERNETES_ALICLOUD_IDENTITY = fmt.Sprintf("Kubernetes.Alicloud/%s", version.Get().String())

KUBERNETES_ALICLOUD_IDENTITY is for statistic purpose.

View Source
var LOADBALANCER = LBStore{}

LOADBALANCER slb cloud mock storage string: *slb.LoadBalancerType{}

View Source
var ROLE_NAME = "KubernetesMasterRole"

ROLE_NAME default kubernetes master role name

View Source
var ROUTES = RouteStore{}
View Source
var STRINGS_EMPTY = ""

STRINGS_EMPTY empty string

View Source
var TOKEN_RESYNC_PERIOD = 10 * time.Minute

TOKEN_RESYNC_PERIOD default token sync period

Functions

func Batch

func Batch(m interface{}, cnt int, batch Func) error

Batch batch process `object` m with func `func` for general purpose

func BuildVirtualGroupFromRemoteAPI

func BuildVirtualGroupFromRemoteAPI(
	lb *slb.LoadBalancerType,
	slbins *LoadBalancerClient,
) (vgroups, error)

func BuildVirturalGroupFromService

func BuildVirturalGroupFromService(
	client *LoadBalancerClient,
	service *v1.Service,
	slbins *slb.LoadBalancerType,
) *vgroups

func CleanUPVGroupDirect

func CleanUPVGroupDirect(local *vgroups) error

CleanUPVGroupDirect do clean vserver group

func CleanUPVGroupMerged

func CleanUPVGroupMerged(
	slbins *LoadBalancerClient,
	service *v1.Service,
	lb *slb.LoadBalancerType,
	local *vgroups,
) error

CleanUPVGroupMerged Merge with service port and do clean vserver group

func Contains

func Contains(list []int, x int) bool

Contains containsLabel in

func DefaultPreset

func DefaultPreset()

func EndpointIpsList

func EndpointIpsList(nodes *v1.Endpoints) []string

func Ensure

func Ensure(v *vgroup, nodes interface{}) error

func EnsureListeners

func EnsureListeners(
	slbins *LoadBalancerClient,
	service *v1.Service,
	lb *slb.LoadBalancerType,
	vgs *vgroups,
) error

EnsureListeners make sure listeners reconciled 1. First, build listeners config from aliyun API output. 2. Second, build listeners from k8s service object. 3. Third, Merge the up two listeners to decide whether add/update/remove is needed. 4. Do update. Clean unused vserver group.

func EnsureListenersDeleted

func EnsureListenersDeleted(
	client ClientSLBSDK,
	service *v1.Service,
	lb *slb.LoadBalancerType,
	vgs *vgroups,
) error

EnsureListenersDeleted Only listener which owned by my service was deleted.

func EnsureVirtualGroups

func EnsureVirtualGroups(vgrps *vgroups, nodes interface{}) error

func ExpectAddressTypeNotEqual

func ExpectAddressTypeNotEqual(f *FrameWork) error

func ExpectExist

func ExpectExist(f *FrameWork) error

func ExpectExistAndEqual

func ExpectExistAndEqual(f *FrameWork) error

service & Cloud data must be consistent

func ExpectNotExist

func ExpectNotExist(f *FrameWork) error

func ExtractAnnotationRequest

func ExtractAnnotationRequest(service *v1.Service) (*AnnotationRequest, *AnnotationRequest)

ExtractAnnotationRequest extract annotations from service labels defaulted is the parameters which set by programe. request represent user defined parameters.

func GetLocalService

func GetLocalService() *localService

GetLocalService return service cache

func GetPrivateZoneRecordCache

func GetPrivateZoneRecordCache() *kvstore

GetPrivateZoneRecordCache return record cache

func InitCache

func InitCache()

func NodeList

func NodeList(nodes []*v1.Node) []string

NodeList return nodes list in string

func PreSetCloudData

func PreSetCloudData(sets ...CloudDataMock)

func PrettyJson

func PrettyJson(obj interface{}) string

PrettyJson pretty json output

func Protocol

func Protocol(annotation string, port v1.ServicePort) (string, error)

Protocol for protocol transform

func RefreshToken

func RefreshToken(mgr *ClientMgr, token *Token) error

func URIfromService

func URIfromService(svc *v1.Service) string

URIfromService build ServiceURI from service

func WaitCreate

func WaitCreate(rc *RoutesClient, tableid string, route *ecs.CreateRouteEntryArgs) error

WaitCreate create route and wait for route ready

func WaitDelete

func WaitDelete(rc *RoutesClient, tableid string, route *ecs.DeleteRouteEntryArgs) error

WaitDelete delete route and wait for route ready

func WaitForRouteEntryAvailable

func WaitForRouteEntryAvailable(client RouteSDK, routeid, tableid string) error

WaitForRouteEntryAvailable wait for route entry available

Types

type AkAuthToken

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

AkAuthToken implement ak auth

func (*AkAuthToken) NextToken

func (f *AkAuthToken) NextToken() (*Token, error)

type AnnotationRequest

type AnnotationRequest struct {
	Loadbalancerid string
	BackendLabel   string
	BackendType    string

	SSLPorts       string
	AddressType    slb.AddressType
	AclStatus      string
	AclID          string
	AclType        string
	VswitchID      string
	ForwardPort    string
	SLBNetworkType string

	ChargeType slb.InternetChargeType
	//Region     		common.Region
	Bandwidth int
	CertID    string

	MasterZoneID string
	SlaveZoneID  string

	HealthCheck            slb.FlagType
	HealthCheckURI         string
	HealthCheckConnectPort int
	HealthyThreshold       int
	UnhealthyThreshold     int
	HealthCheckInterval    int
	HealthCheckDomain      string
	HealthCheckHttpCode    slb.HealthCheckHttpCodeType

	HealthCheckConnectTimeout int                 // for tcp
	HealthCheckType           slb.HealthCheckType // for tcp, Type could be http tcp
	HealthCheckTimeout        int                 // for https and http

	LoadBalancerSpec slb.LoadBalancerSpecType
	Scheduler        string

	StickySession      slb.FlagType
	StickySessionType  slb.StickySessionType
	Cookie             string
	CookieTimeout      int
	PersistenceTimeout int
	AddressIPVersion   slb.AddressIPVersionType

	OverrideListeners string

	PrivateZoneName       string
	PrivateZoneId         string
	PrivateZoneRecordName string
	PrivateZoneRecordTTL  int

	RemoveUnscheduledBackend string
}

AnnotationRequest annotated parameters.

type ClientInstanceSDK

type ClientInstanceSDK interface {
	AddTags(args *ecs.AddTagsArgs) error
	DescribeInstances(args *ecs.DescribeInstancesArgs) (instances []ecs.InstanceAttributesType, pagination *common.PaginationResult, err error)
	DescribeNetworkInterfaces(args *ecs.DescribeNetworkInterfacesArgs) (resp *ecs.DescribeNetworkInterfacesResponse, err error)
}

ClientInstanceSDK instance sdk

type ClientMgr

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

ClientMgr client manager for aliyun sdk

func NewClientMgr

func NewClientMgr(key, secret string) (*ClientMgr, error)

NewClientMgr return a new client manager

func (*ClientMgr) Instances

func (mgr *ClientMgr) Instances() *InstanceClient

Instances return instance client

func (*ClientMgr) LoadBalancers

func (mgr *ClientMgr) LoadBalancers() *LoadBalancerClient

LoadBalancers return loadbalancer client

func (*ClientMgr) MetaData

func (mgr *ClientMgr) MetaData() IMetaData

MetaData return MetaData client

func (*ClientMgr) PrivateZones

func (mgr *ClientMgr) PrivateZones() *PrivateZoneClient

PrivateZones return PrivateZones client

func (*ClientMgr) Routes

func (mgr *ClientMgr) Routes() *RoutesClient

Routes return routes client

func (*ClientMgr) Start

func (mgr *ClientMgr) Start(settoken func(mgr *ClientMgr, token *Token) error) error

type ClientPVTZSDK

type ClientPVTZSDK interface {
	DescribeZones(args *pvtz.DescribeZonesArgs) (zones []pvtz.ZoneType, err error)
	AddZone(args *pvtz.AddZoneArgs) (response *pvtz.AddZoneResponse, err error)
	DeleteZone(args *pvtz.DeleteZoneArgs) (err error)
	CheckZoneName(args *pvtz.CheckZoneNameArgs) (bool, error)
	UpdateZoneRemark(args *pvtz.UpdateZoneRemarkArgs) error
	DescribeZoneInfo(args *pvtz.DescribeZoneInfoArgs) (response *pvtz.DescribeZoneInfoResponse, err error)
	BindZoneVpc(args *pvtz.BindZoneVpcArgs) (err error)
	DescribeRegions() (regions []pvtz.RegionType, err error)
	DescribeZoneRecords(args *pvtz.DescribeZoneRecordsArgs) (records []pvtz.ZoneRecordType, err error)
	DescribeZoneRecordsByRR(zoneId string, rr string) (records []pvtz.ZoneRecordType, err error)
	DeleteZoneRecordsByRR(zoneId string, rr string) error
	AddZoneRecord(args *pvtz.AddZoneRecordArgs) (response *pvtz.AddZoneRecordResponse, err error)
	UpdateZoneRecord(args *pvtz.UpdateZoneRecordArgs) (err error)
	DeleteZoneRecord(args *pvtz.DeleteZoneRecordArgs) (err error)
	SetZoneRecordStatus(args *pvtz.SetZoneRecordStatusArgs) (err error)
}

ClientPVTZSDK private zone sdk interface

type ClientSLBSDK

type ClientSLBSDK interface {
	DescribeLoadBalancers(args *slb.DescribeLoadBalancersArgs) (loadBalancers []slb.LoadBalancerType, err error)
	CreateLoadBalancer(args *slb.CreateLoadBalancerArgs) (response *slb.CreateLoadBalancerResponse, err error)
	DeleteLoadBalancer(loadBalancerId string) (err error)
	ModifyLoadBalancerInstanceSpec(args *slb.ModifyLoadBalancerInstanceSpecArgs) (err error)
	ModifyLoadBalancerInternetSpec(args *slb.ModifyLoadBalancerInternetSpecArgs) (err error)
	DescribeLoadBalancerAttribute(loadBalancerId string) (loadBalancer *slb.LoadBalancerType, err error)
	RemoveBackendServers(loadBalancerId string, backendServers []string) (result []slb.BackendServerType, err error)
	AddBackendServers(loadBalancerId string, backendServers []slb.BackendServerType) (result []slb.BackendServerType, err error)

	StopLoadBalancerListener(loadBalancerId string, port int) (err error)
	StartLoadBalancerListener(loadBalancerId string, port int) (err error)
	CreateLoadBalancerTCPListener(args *slb.CreateLoadBalancerTCPListenerArgs) (err error)
	CreateLoadBalancerUDPListener(args *slb.CreateLoadBalancerUDPListenerArgs) (err error)
	DeleteLoadBalancerListener(loadBalancerId string, port int) (err error)
	CreateLoadBalancerHTTPSListener(args *slb.CreateLoadBalancerHTTPSListenerArgs) (err error)
	CreateLoadBalancerHTTPListener(args *slb.CreateLoadBalancerHTTPListenerArgs) (err error)
	DescribeLoadBalancerHTTPSListenerAttribute(loadBalancerId string, port int) (response *slb.DescribeLoadBalancerHTTPSListenerAttributeResponse, err error)
	DescribeLoadBalancerTCPListenerAttribute(loadBalancerId string, port int) (response *slb.DescribeLoadBalancerTCPListenerAttributeResponse, err error)
	DescribeLoadBalancerUDPListenerAttribute(loadBalancerId string, port int) (response *slb.DescribeLoadBalancerUDPListenerAttributeResponse, err error)
	DescribeLoadBalancerHTTPListenerAttribute(loadBalancerId string, port int) (response *slb.DescribeLoadBalancerHTTPListenerAttributeResponse, err error)

	SetLoadBalancerHTTPListenerAttribute(args *slb.SetLoadBalancerHTTPListenerAttributeArgs) (err error)
	SetLoadBalancerHTTPSListenerAttribute(args *slb.SetLoadBalancerHTTPSListenerAttributeArgs) (err error)
	SetLoadBalancerTCPListenerAttribute(args *slb.SetLoadBalancerTCPListenerAttributeArgs) (err error)
	SetLoadBalancerUDPListenerAttribute(args *slb.SetLoadBalancerUDPListenerAttributeArgs) (err error)

	RemoveTags(args *slb.RemoveTagsArgs) error
	DescribeTags(args *slb.DescribeTagsArgs) (tags []slb.TagItemType, pagination *common.PaginationResult, err error)
	AddTags(args *slb.AddTagsArgs) error

	CreateVServerGroup(args *slb.CreateVServerGroupArgs) (response *slb.CreateVServerGroupResponse, err error)
	DescribeVServerGroups(args *slb.DescribeVServerGroupsArgs) (response *slb.DescribeVServerGroupsResponse, err error)
	DeleteVServerGroup(args *slb.DeleteVServerGroupArgs) (response *slb.DeleteVServerGroupResponse, err error)
	SetVServerGroupAttribute(args *slb.SetVServerGroupAttributeArgs) (response *slb.SetVServerGroupAttributeResponse, err error)
	DescribeVServerGroupAttribute(args *slb.DescribeVServerGroupAttributeArgs) (response *slb.DescribeVServerGroupAttributeResponse, err error)
	ModifyVServerGroupBackendServers(args *slb.ModifyVServerGroupBackendServersArgs) (response *slb.ModifyVServerGroupBackendServersResponse, err error)
	AddVServerGroupBackendServers(args *slb.AddVServerGroupBackendServersArgs) (response *slb.AddVServerGroupBackendServersResponse, err error)
	RemoveVServerGroupBackendServers(args *slb.RemoveVServerGroupBackendServersArgs) (response *slb.RemoveVServerGroupBackendServersResponse, err error)
}

ClientSLBSDK client sdk for slb

type Cloud

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

cloud is an implementation of Interface, LoadBalancer and Instances for Alicloud Services.

func NewMockCloud

func NewMockCloud() (*Cloud, error)

func (*Cloud) AddSSHKeyToAllInstances

func (c *Cloud) AddSSHKeyToAllInstances(user string, keyData []byte) error

AddSSHKeyToAllInstances adds an SSH public key as a legal identity for all instances expected format for the key is standard ssh-keygen format: <protocol> <blob>

func (*Cloud) Clusters

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

Clusters returns the list of clusters.

func (*Cloud) CreateRoute

func (c *Cloud) CreateRoute(clusterName string, nameHint string, tableid string, route *cloudprovider.Route) error

CreateRoute creates the described managed route route.Name will be ignored, although the cloud-provider may use nameHint to create a more user-meaningful name.

func (*Cloud) CurrentNodeName

func (c *Cloud) CurrentNodeName(hostname string) (types.NodeName, error)

CurrentNodeName returns the name of the node we are currently running on On most clouds (e.g. GCE) this is the hostname, so we provide the hostname

func (*Cloud) DeleteRoute

func (c *Cloud) DeleteRoute(clusterName string, tableid string, route *cloudprovider.Route) error

DeleteRoute deletes the specified managed route Route should be as returned by ListRoutes

func (*Cloud) EnsureLoadBalancer

func (c *Cloud) EnsureLoadBalancer(clusterName string, service *v1.Service, nodes []*v1.Node) (*v1.LoadBalancerStatus, error)

EnsureLoadBalancer creates a new load balancer 'name', or updates the existing one. Returns the status of the balancer Implementations must treat the *v1.svc and *v1.Node parameters as read-only and not modify them. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager

func (*Cloud) EnsureLoadBalancerDeleted

func (c *Cloud) EnsureLoadBalancerDeleted(clusterName string, service *v1.Service) error

EnsureLoadBalancerDeleted deletes the specified load balancer if it exists, returning nil if the load balancer specified either didn't exist or was successfully deleted. This construction is useful because many cloud providers' load balancers have multiple underlying components, meaning a Get could say that the LB doesn't exist even if some part of it is still laying around. Implementations must treat the *v1.svc parameter as read-only and not modify it. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager

func (*Cloud) EnsureLoadBalancerWithENI

func (c *Cloud) EnsureLoadBalancerWithENI(name string, service *v1.Service, endpoint *v1.Endpoints) (*v1.LoadBalancerStatus, error)

func (*Cloud) ExternalID

func (c *Cloud) ExternalID(nodeName types.NodeName) (string, error)

ExternalID returns the cloud provider ID of the node with the specified NodeName. Note that if the instance does not exist or is no longer running, we must return ("", cloudprovider.InstanceNotFound)

func (*Cloud) GetLoadBalancer

func (c *Cloud) GetLoadBalancer(clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error)

GetLoadBalancer returns whether the specified load balancer exists, and if so, what its status is. Implementations must treat the *v1.svc parameter as read-only and not modify it. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager TODO: Break this up into different interfaces (LB, etc) when we have more than one type of service

func (*Cloud) GetZone

func (c *Cloud) GetZone() (cloudprovider.Zone, error)

GetZone returns the Zone containing the current failure zone and locality region that the program is running in

func (*Cloud) GetZoneByNodeName

func (c *Cloud) GetZoneByNodeName(nodeName types.NodeName) (cloudprovider.Zone, error)

GetZoneByNodeName returns the Zone containing the current zone and locality region of the node specified by node name This method is particularly used in the context of external cloud providers where node initialization must be down outside the kubelets.

func (*Cloud) GetZoneByProviderID

func (c *Cloud) GetZoneByProviderID(providerID string) (cloudprovider.Zone, error)

GetZoneByProviderID returns the Zone containing the current zone and locality region of the node specified by providerId This method is particularly used in the context of external cloud providers where node initialization must be down outside the kubelets.

func (*Cloud) HasClusterID

func (c *Cloud) HasClusterID() bool

HasClusterID returns true if a ClusterID is required and set

func (*Cloud) Initialize

func (c *Cloud) Initialize(builder ctrlclient.ControllerClientBuilder)

Initialize passes a Kubernetes clientBuilder interface to the cloud provider

func (*Cloud) InstanceExistsByProviderID

func (c *Cloud) InstanceExistsByProviderID(providerID string) (bool, error)

InstanceExistsByProviderID returns true if the instance for the given provider id still is running. If false is returned with no error, the instance will be immediately deleted by the cloud controller manager.

func (*Cloud) InstanceID

func (c *Cloud) InstanceID(nodeName types.NodeName) (string, error)

InstanceID returns the cloud provider ID of the node with the specified NodeName.

func (*Cloud) InstanceType

func (c *Cloud) InstanceType(name types.NodeName) (string, error)

InstanceType returns the type of the specified instance.

func (*Cloud) InstanceTypeByProviderID

func (c *Cloud) InstanceTypeByProviderID(providerID string) (string, error)

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 (*Cloud) Instances

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

Instances returns an implementation of Instances for Alicloud Services.

func (*Cloud) ListClusters

func (c *Cloud) ListClusters() ([]string, error)

ListClusters lists the names of the available clusters.

func (*Cloud) ListInstances

func (c *Cloud) ListInstances(ids []string) (map[string]*node.CloudNodeAttribute, error)

func (*Cloud) ListRoutes

func (c *Cloud) ListRoutes(clusterName string, tableid string) ([]*cloudprovider.Route, error)

ListRoutes lists all managed routes that belong to the specified clusterName

func (*Cloud) LoadBalancer

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

LoadBalancer returns an implementation of LoadBalancer for Alicloud Services.

func (*Cloud) Master

func (c *Cloud) Master(clusterName string) (string, error)

Master gets back the address (either DNS name or IP address) of the master node for the cluster.

func (*Cloud) NodeAddresses

func (c *Cloud) NodeAddresses(name types.NodeName) ([]v1.NodeAddress, error)

NodeAddresses returns the addresses of the specified instance. TODO(roberthbailey): This currently is only used in such a way that it returns the address of the calling instance. We should do a rename to make this clearer.

func (*Cloud) NodeAddressesByProviderID

func (c *Cloud) 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

func (*Cloud) ProviderName

func (c *Cloud) ProviderName() string

ProviderName returns the cloud provider ID.

func (*Cloud) RouteTables

func (c *Cloud) RouteTables(clusterName string) ([]string, error)

RouteTables return route table list

func (*Cloud) Routes

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

Routes returns an implementation of Routes for Alicloud Services.

func (*Cloud) ScrubDNS

func (c *Cloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string)

ScrubDNS filters DNS settings for pods.

func (*Cloud) SetInstanceTags

func (c *Cloud) SetInstanceTags(insid string, tags map[string]string) error

func (*Cloud) UpdateLoadBalancer

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

UpdateLoadBalancer updates hosts under the specified load balancer. Implementations must treat the *v1.svc and *v1.Node parameters as read-only and not modify them. Parameter 'clusterName' is the name of the cluster as presented to kube-controller-manager

func (*Cloud) UpdateLoadBalancerWithENI

func (c *Cloud) UpdateLoadBalancerWithENI(name string, service *v1.Service, endpoint *v1.Endpoints) error

func (*Cloud) Zones

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

Zones returns an implementation of Zones for Alicloud Services.

type CloudConfig

type CloudConfig struct {
	Global struct {
		KubernetesClusterTag string `json:"kubernetesClusterTag"`
		NodeMonitorPeriod    int64  `json:"nodeMonitorPeriod"`
		NodeAddrSyncPeriod   int64  `json:"nodeAddrSyncPeriod"`
		UID                  string `json:"uid"`
		Region               string `json:"region"`
		ZoneID               string `json:"zoneid"`
		VswitchID            string `json:"vswitchid"`
		ClusterID            string `json:"clusterID"`

		DisablePublicSLB bool `json:"disablePublicSLB"`

		AccessKeyID     string `json:"accessKeyID"`
		AccessKeySecret string `json:"accessKeySecret"`
	}
}

CloudConfig wraps the settings for the Alicloud provider.

type CloudDataMock

type CloudDataMock func()

CloudDataMock is a function which set mocked Cloud initial data, include alibaba route/slb/instance

func WithENI

func WithENI() CloudDataMock

func WithInstance

func WithInstance() CloudDataMock

func WithLoadBalancer

func WithLoadBalancer() CloudDataMock

func WithNewInstanceStore

func WithNewInstanceStore() CloudDataMock

func WithNewLoadBalancerStore

func WithNewLoadBalancerStore() CloudDataMock

func WithNewRouteStore

func WithNewRouteStore() CloudDataMock

func WithRouteTableEntrySet

func WithRouteTableEntrySet() CloudDataMock

func WithVRouter

func WithVRouter() CloudDataMock

func WithVpcs

func WithVpcs() CloudDataMock

type FrameWork

type FrameWork struct {
	Cloud         *Cloud
	SVC           *v1.Service
	Nodes         []*v1.Node
	Endpoint      *v1.Endpoints
	CloudDataMock func()
}

func NewDefaultFrameWork

func NewDefaultFrameWork(
	svc *v1.Service,
	nodes []*v1.Node,
	endpoint *v1.Endpoints,
	preset func(),
) *FrameWork

func NewFrameWork

func NewFrameWork(
	cloud *Cloud,
	svc *v1.Service,
	nodes []*v1.Node,
	endpoint *v1.Endpoints,
	preset func(),
) *FrameWork

func NewFrameWorkWithOptions

func NewFrameWorkWithOptions(
	option OptionsFunc,
) *FrameWork

func (*FrameWork) CloudImpl

func (f *FrameWork) CloudImpl() *Cloud

func (*FrameWork) Instance

func (f *FrameWork) Instance() *InstanceClient

func (*FrameWork) InstanceSDK

func (f *FrameWork) InstanceSDK() ClientInstanceSDK

func (*FrameWork) ListenerEqual

func (f *FrameWork) ListenerEqual(id string, p v1.ServicePort, proto string) error

func (*FrameWork) LoadBalancer

func (f *FrameWork) LoadBalancer() *LoadBalancerClient

func (*FrameWork) PVTZSDK

func (f *FrameWork) PVTZSDK() ClientPVTZSDK

func (*FrameWork) Route

func (f *FrameWork) Route() *RoutesClient

func (*FrameWork) RouteSDK

func (f *FrameWork) RouteSDK() RouteSDK

func (*FrameWork) Run

func (f *FrameWork) Run(
	t *testing.T,
	describe string,
	ntype string,
	run func(),
)

func (*FrameWork) RunDefault

func (f *FrameWork) RunDefault(
	t *testing.T,
	describe string,
)

func (*FrameWork) RunWithENI

func (f *FrameWork) RunWithENI(
	t *testing.T,
	describe string,
)

func (*FrameWork) SLBSDK

func (f *FrameWork) SLBSDK() ClientSLBSDK

func (*FrameWork) SLBSpecEqual

func (f *FrameWork) SLBSpecEqual(mlb *slb.LoadBalancerType) error

type Func

type Func func([]interface{}) error

type IListener

type IListener interface {
	Describe() error
	Add() error
	Remove() error
	Update() error
}

IListener listener interface

type IMetaData

type IMetaData interface {
	HostName() (string, error)
	ImageID() (string, error)
	InstanceID() (string, error)
	Mac() (string, error)
	NetworkType() (string, error)
	OwnerAccountID() (string, error)
	PrivateIPv4() (string, error)
	Region() (string, error)
	SerialNumber() (string, error)
	SourceAddress() (string, error)
	VpcCIDRBlock() (string, error)
	VpcID() (string, error)
	VswitchCIDRBlock() (string, error)
	Zone() (string, error)
	NTPConfigServers() ([]string, error)
	RoleName() (string, error)
	RamRoleToken(role string) (metadata.RoleAuth, error)
	VswitchID() (string, error)
}

IMetaData metadata interface

func NewMetaData

func NewMetaData() IMetaData

NewMetaData return new metadata

type InstanceClient

type InstanceClient struct {
	CurrentNodeName types.NodeName
	// contains filtered or unexported fields
}

InstanceClient wrap for instance sdk

func (*InstanceClient) AddCloudTags

func (s *InstanceClient) AddCloudTags(id string, tags map[string]string, region common.Region) error

func (*InstanceClient) ListInstances

func (s *InstanceClient) ListInstances(ids []string) (map[string]*node.CloudNodeAttribute, error)

type InstanceStore

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

type LBStore

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

type Listener

type Listener struct {
	Name string
	// NamedKey Map between ServiceName and Listener from console view.
	NamedKey *NamedKey

	// Proto is the protocol from console view
	Proto string

	// TransforedProto is the real protocol that a listener indicated.
	TransforedProto string

	Port int32

	// NodePort Backend server port
	NodePort int32

	// ServiceName reference from k8s service
	Service *v1.Service

	// LoadBalancerID service connected SLB.
	LoadBalancerID string

	// Action indicate the operate method. ADD UPDATE DELETE
	Action string

	Client ClientSLBSDK

	VGroups *vgroups
}

Listener loadbalancer listener

func (*Listener) Apply

func (n *Listener) Apply() error

Apply apply listener operate . add/update/delete etc.

func (*Listener) Describe

func (n *Listener) Describe() error

Describe describe listener

func (*Listener) Instance

func (n *Listener) Instance() IListener

Instance listener instance

func (*Listener) Remove

func (n *Listener) Remove() error

Remove remove Listener

func (*Listener) Start

func (n *Listener) Start() error

Start start listener

type Listeners

type Listeners []*Listener

Listeners listeners collection

func BuildActionsForListeners

func BuildActionsForListeners(svc *v1.Service, service, console Listeners) (Listeners, error)

1. We update listener to the latest version2 when updation is needed. 2. We assume listener with an empty name to be legacy version. 3. We assume listener with an arbitrary name to be user managed listener. 4. LoadBalancer created by kubernetes is not allowed to be reused.

func BuildListenersFromAPI

func BuildListenersFromAPI(
	service *v1.Service,
	lb *slb.LoadBalancerType,
	client ClientSLBSDK,
	vgrps *vgroups,
) (listeners Listeners)

BuildListenersFromAPI Load current listeners

func BuildListenersFromService

func BuildListenersFromService(
	svc *v1.Service,
	lb *slb.LoadBalancerType,
	client ClientSLBSDK,
	vgrps *vgroups,
) (Listeners, error)

BuildListenersFromService Build expected listeners

type LoadBalancerClient

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

LoadBalancerClient slb client wrapper

func (*LoadBalancerClient) EnsureLoadBalanceDeleted

func (s *LoadBalancerClient) EnsureLoadBalanceDeleted(service *v1.Service) error

EnsureLoadBalanceDeleted make sure slb is deleted

func (*LoadBalancerClient) EnsureLoadBalancer

func (s *LoadBalancerClient) EnsureLoadBalancer(service *v1.Service, nodes interface{}, vswitchid string) (*slb.LoadBalancerType, error)

EnsureLoadBalancer make sure slb is reconciled nodes []*v1.Node

func (*LoadBalancerClient) UpdateDefaultServerGroup

func (s *LoadBalancerClient) UpdateDefaultServerGroup(backends interface{}, lb *slb.LoadBalancerType) error

UpdateDefaultServerGroup update default server group

func (*LoadBalancerClient) UpdateLoadBalancer

func (s *LoadBalancerClient) UpdateLoadBalancer(service *v1.Service, nodes interface{}, withVgroup bool) error

UpdateLoadBalancer make sure slb backend is reconciled

type NamedKey

type NamedKey struct {
	Prefix      string
	CID         string
	Namespace   string
	ServiceName string
	Port        int32
}

NamedKey identify listeners on grouped attributes

func LoadNamedKey

func LoadNamedKey(key string) (*NamedKey, error)

LoadNamedKey build NamedKey from string.

func (*NamedKey) Key

func (n *NamedKey) Key() string

Key key of NamedKey

func (*NamedKey) Reference

func (n *NamedKey) Reference(backport int32) string

Reference reference

func (*NamedKey) ServiceURI

func (n *NamedKey) ServiceURI() string

ServiceURI service URI for the NamedKey.

type OptionsFunc

type OptionsFunc func(f *FrameWork)

type PrivateZoneClient

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

PrivateZoneClient private zone client wrapper

func (*PrivateZoneClient) EnsurePrivateZoneRecord

func (s *PrivateZoneClient) EnsurePrivateZoneRecord(service *v1.Service, ip string, ipVersion slb.AddressIPVersionType) (zone *pvtz.DescribeZoneInfoResponse, record *pvtz.ZoneRecordType, err error)

EnsurePrivateZoneRecord make sure private zone record is reconciled

func (*PrivateZoneClient) EnsurePrivateZoneRecordDeleted

func (s *PrivateZoneClient) EnsurePrivateZoneRecordDeleted(service *v1.Service, ip string, ipVersion slb.AddressIPVersionType) error

EnsurePrivateZoneRecordDeleted make sure private zone record is deleted.

type RamRoleToken

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

func (*RamRoleToken) NextToken

func (f *RamRoleToken) NextToken() (*Token, error)

type RouteSDK

type RouteSDK interface {
	DescribeVpcs(args *ecs.DescribeVpcsArgs) (vpcs []ecs.VpcSetType, pagination *common.PaginationResult, err error)
	DescribeVRouters(args *ecs.DescribeVRoutersArgs) (vrouters []ecs.VRouterSetType, pagination *common.PaginationResult, err error)
	DescribeRouteTables(args *ecs.DescribeRouteTablesArgs) (routeTables []ecs.RouteTableSetType, pagination *common.PaginationResult, err error)
	DeleteRouteEntry(args *ecs.DeleteRouteEntryArgs) error
	CreateRouteEntry(args *ecs.CreateRouteEntryArgs) error
	WaitForAllRouteEntriesAvailable(vrouterId string, routeTableId string, timeout int) error
}

RouteSDK define route sdk interface

type RouteStore

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

type RoutesClient

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

RoutesClient wrap route sdk

func (*RoutesClient) CreateRoute

func (r *RoutesClient) CreateRoute(tabid string, route *cloudprovider.Route, region common.Region, vpcid string) error

CreateRoute creates the described managed route route.Name will be ignored, although the cloud-provider may use nameHint to create a more user-meaningful name.

func (*RoutesClient) DeleteRoute

func (r *RoutesClient) DeleteRoute(tabid string, route *cloudprovider.Route, region common.Region) error

DeleteRoute deletes the specified managed route Route should be as returned by ListRoutes

func (*RoutesClient) Error

func (r *RoutesClient) Error(e error) string

Error implement error

func (*RoutesClient) ListRoutes

func (r *RoutesClient) ListRoutes(tableid string) ([]*cloudprovider.Route, error)

ListRoutes lists all managed routes that belong to the specified clusterName

func (*RoutesClient) RouteTables

func (r *RoutesClient) RouteTables() ([]string, error)

RouteTables return all the tables in the vpc network.

func (*RoutesClient) WithVPC

func (r *RoutesClient) WithVPC(vpcid string, tableids string) error

WithVPC set vpc id and and route table ids.

type ServiceToken

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

ServiceToken is an implemention of service account auth

func (*ServiceToken) NextToken

func (f *ServiceToken) NextToken() (*Token, error)

type Token

type Token struct {
	AccessSecret string `json:"accessSecret,omitempty"`
	UID          string `json:"uid,omitempty"`
	Token        string `json:"token,omitempty"`
	AccessKey    string `json:"accesskey,omitempty"`
}

Token base token info

type TokenAuth

type TokenAuth interface {
	NextToken() (*Token, error)
}

TokenAuth is an interface of token auth method

Directories

Path Synopsis
controller

Jump to

Keyboard shortcuts

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