Documentation ¶
Index ¶
- func NewEndpointsController(ctx context.Context, kubeClient kubernetes.Interface, instance *KusciaCoreDNS, ...) controllers.IController
- func NewPodController(ctx context.Context, kubeClient kubernetes.Interface, instance *KusciaCoreDNS, ...) controllers.IController
- type EndpointsController
- type KusciaCoreDNS
- func (e *KusciaCoreDNS) IsNameError(err error) bool
- func (e *KusciaCoreDNS) Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error)
- func (e *KusciaCoreDNS) MinTTL(state request.Request) uint32
- func (e *KusciaCoreDNS) Name() string
- func (e *KusciaCoreDNS) Records(ctx context.Context, state request.Request, exact bool) ([]msg.Service, error)
- func (e *KusciaCoreDNS) Reverse(ctx context.Context, state request.Request, exact bool, opt plugin.Options) (services []msg.Service, err error)
- func (e *KusciaCoreDNS) Serial(state request.Request) uint32
- func (e *KusciaCoreDNS) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
- func (e *KusciaCoreDNS) Services(ctx context.Context, state request.Request, exact bool, opt plugin.Options) (services []msg.Service, err error)
- func (e *KusciaCoreDNS) Start(ctx context.Context, kubeClient kubernetes.Interface) error
- func (e *KusciaCoreDNS) StartControllers(ctx context.Context, kubeclient kubernetes.Interface) error
- func (e *KusciaCoreDNS) Transfer(ctx context.Context, state request.Request) (int, error)
- type PodController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEndpointsController ¶
func NewEndpointsController(ctx context.Context, kubeClient kubernetes.Interface, instance *KusciaCoreDNS, namespace string) controllers.IController
NewEndpointsController create a new *EndpointsController
func NewPodController ¶
func NewPodController(ctx context.Context, kubeClient kubernetes.Interface, instance *KusciaCoreDNS, namespace string) controllers.IController
NewPodController create a new *PodController.
Types ¶
type EndpointsController ¶
type EndpointsController struct {
// contains filtered or unexported fields
}
EndpointsController sync namespaces' services. For each service - If `ObjectMeta.Annotations` contains `cname: gateway`, insert A record with gateway IP. - Otherwise, insert A records with endpoints IPs.
func (*EndpointsController) Name ¶
func (c *EndpointsController) Name() string
func (*EndpointsController) Run ¶
func (c *EndpointsController) Run(workers int) error
Run begins watching and syncing.
func (*EndpointsController) Stop ¶
func (c *EndpointsController) Stop()
type KusciaCoreDNS ¶
type KusciaCoreDNS struct { Next plugin.Handler Fall fall.F Zones []string Namespace string EnvoyIP string Upstream *upstream.Upstream Cache *cache.Cache // contains filtered or unexported fields }
KusciaCoreDNS is a plugin talk to kubernetes.
func KusciaParse ¶
func KusciaParse(c *caddy.Controller, namespace, envoyIP string) (*KusciaCoreDNS, error)
func (*KusciaCoreDNS) IsNameError ¶
func (e *KusciaCoreDNS) IsNameError(err error) bool
IsNameError implements the ServiceBackend interface.
func (*KusciaCoreDNS) Lookup ¶
func (e *KusciaCoreDNS) Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error)
Lookup implements the ServiceBackend interface.
func (*KusciaCoreDNS) MinTTL ¶
func (e *KusciaCoreDNS) MinTTL(state request.Request) uint32
MinTTL implements the Transferer interface.
func (*KusciaCoreDNS) Name ¶
func (e *KusciaCoreDNS) Name() string
Name implements the Handler interface.
func (*KusciaCoreDNS) Records ¶
func (e *KusciaCoreDNS) Records(ctx context.Context, state request.Request, exact bool) ([]msg.Service, error)
Records looks up records in cache. If exact is true, it will lookup just this name. This is used when find matches when completing SRV lookups for instance.
func (*KusciaCoreDNS) Reverse ¶
func (e *KusciaCoreDNS) Reverse(ctx context.Context, state request.Request, exact bool, opt plugin.Options) (services []msg.Service, err error)
Reverse implements the ServiceBackend interface.
func (*KusciaCoreDNS) Serial ¶
func (e *KusciaCoreDNS) Serial(state request.Request) uint32
Serial implements the Transferer interface.
func (*KusciaCoreDNS) ServeDNS ¶
func (e *KusciaCoreDNS) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error)
ServeDNS implements the plugin.Handler interface.
func (*KusciaCoreDNS) Services ¶
func (e *KusciaCoreDNS) Services(ctx context.Context, state request.Request, exact bool, opt plugin.Options) (services []msg.Service, err error)
Services implements the ServiceBackend interface.
func (*KusciaCoreDNS) Start ¶
func (e *KusciaCoreDNS) Start(ctx context.Context, kubeClient kubernetes.Interface) error
Start create and run controllers to list-watch resources.
func (*KusciaCoreDNS) StartControllers ¶
func (e *KusciaCoreDNS) StartControllers(ctx context.Context, kubeclient kubernetes.Interface) error
type PodController ¶
type PodController struct {
// contains filtered or unexported fields
}
PodController sync namespace's pods. For each pod, if `PodSpec.subdomain` is specified, insert A record with FQDN "<hostname>.<subdomain>.<namespace>".
func (*PodController) Name ¶
func (c *PodController) Name() string
func (*PodController) Run ¶
func (c *PodController) Run(int) error
func (*PodController) Stop ¶
func (c *PodController) Stop()