bcsscheduler

package
v1.29.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BcsScheduler

type BcsScheduler struct {
	Next plugin.Handler // next plugin
	// contains filtered or unexported fields
}

BcsScheduler plugin for reading service/endpoints info from bcs-scheduler

func NewScheduler

func NewScheduler(config *ConfigItem) *BcsScheduler

NewScheduler create bcs scheduler backend

func (*BcsScheduler) Debug

func (bcs *BcsScheduler) Debug() string

Debug returns a string used when returning debug services.

func (*BcsScheduler) InitSchedulerCache

func (bcs *BcsScheduler) InitSchedulerCache() error

InitSchedulerCache bcs scheduler backend init it

func (*BcsScheduler) IsNameError

func (bcs *BcsScheduler) IsNameError(err error) bool

IsNameError return true if err indicated a record not found condition

func (*BcsScheduler) Lookup

func (bcs *BcsScheduler) Lookup(state request.Request, name string, typ uint16) (*dns.Msg, error)

Lookup is used to find records else where.

func (*BcsScheduler) MinTTL

func (bcs *BcsScheduler) MinTTL(state request.Request) uint32

MinTTL returns the minimum TTL to be used in the SOA record.

func (*BcsScheduler) Name

func (bcs *BcsScheduler) Name() string

Name implements the Handler interface.

func (*BcsScheduler) PrimaryZone

func (bcs *BcsScheduler) PrimaryZone() string

PrimaryZone Get zone info

func (*BcsScheduler) Records

func (bcs *BcsScheduler) Records(state request.Request, exact bool) ([]msg.Service, error)

Records looks up services in bcs. If exact is true, it will lookup just this name. This is used when find matches when completing SRV lookups for instance.

func (*BcsScheduler) Reverse

func (bcs *BcsScheduler) Reverse(state request.Request, exact bool, opt plugin.Options) (svcList []msg.Service,
	err error)

Reverse communicates with the backend to retrieve service definition based on a IP address instead of a name. I.e. a reverse DNS lookup.

func (*BcsScheduler) Serial

func (bcs *BcsScheduler) Serial(state request.Request) uint32

Serial returns a SOA serial number to construct a SOA record.

func (*BcsScheduler) ServeDNS

func (bcs *BcsScheduler) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)

ServeDNS implements the plugin.Handler interface.

func (*BcsScheduler) Services

func (bcs *BcsScheduler) Services(state request.Request, exact bool, opt plugin.Options) (svcs []msg.Service,
	err error)

Services communicates with the backend to retrieve the service definition. if func Services is called, it means domain must belong to this cluster, Exact indicates on exact much are that we are allowed to recurs.

func (*BcsScheduler) Start

func (bcs *BcsScheduler) Start() error

Start start all go event with context

func (*BcsScheduler) Stop

func (bcs *BcsScheduler) Stop() error

Stop stop all event, clean cache and exit

func (*BcsScheduler) Transfer

func (bcs *BcsScheduler) Transfer(ctx context.Context, state request.Request) (int, error)

Transfer handles a zone transfer it writes to the client just like any other handler.

type ConfigItem

type ConfigItem struct {
	Zones        []string    // zone list
	Cluster      string      // cluster id for mesos
	Register     []string    // registery for server node
	ResyncPeriod int         // resync all data from scheduler zookeeper
	Endpoints    []string    // scheduler event storage endpoints
	EndpointPath string      // path for original datas
	KubeConfig   string      // path of kubeconfig for kube-apiserver
	EndpointCA   string      // ca for endpoints
	EndpointKey  string      // key for endpoint
	EndpointCert string      // cert for endpoint
	Storage      []string    // link for storage
	StoragePath  string      // path for DNS data storage
	StorageCA    string      // ca for storage
	StorageKey   string      // key for storage
	StorageCert  string      // cert for storage
	UpStream     []string    // dns upstream
	Fallthrough  bool        // pass to next plugin when no data
	Proxy        proxy.Proxy // proxy for upstream
	MetricPort   uint        // port for prometheus metric
}

ConfigItem item from bcs-scheduler config file

type ForwardClusterIpDomainError

type ForwardClusterIpDomainError struct {
	ClusterIP string
}

ForwardClusterIpDomainError err

func (ForwardClusterIpDomainError) Error

Error 用于错误处理

Directories

Path Synopsis
Package metrics xxx
Package metrics xxx

Jump to

Keyboard shortcuts

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