object: fix object cleanup (#27)
This commit add object cleanup to be consistent with similar code in the kubernetes plugin.
It also does a clone of the EndpointSlice labels so that it’s not erased by the function
EndpointSliceToEndpointsfrom the kubernetes plugin fixing an important bug in the multicluster code as it was previously not able to retrieve any labels which essentially prevented any interaction with headless services.Signed-off-by: Arthur Outhenin-Chalandre arthur@cri.epita.fr
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
multicluster
Name
multicluster - implementation of Multicluster DNS
Description
This plugin implements the Kubernetes DNS-Based Multicluster Service Discovery Specification.
Syntax
kubeconfigKUBECONFIG [CONTEXT] authenticates the connection to a remote k8s cluster using a kubeconfig file. [CONTEXT] is optional, if not set, then the current context specified in kubeconfig will be used. It supports TLS, username and password, or token-based authentication. This option is ignored if connecting in-cluster (i.e., the endpoint is not specified).noendpointswill turn off the serving of endpoint records by disabling the watch on endpoints. All endpoint queries and headless service queries will result in an NXDOMAIN.fallthrough[ZONES…] If a query for a record in the zones for which the plugin is authoritative results in NXDOMAIN, normally that is what the response will be. However, if you specify this option, the query will instead be passed on down the plugin chain, which can include another plugin to handle the query. If [ZONES…] is omitted, then fallthrough happens for all zones for which the plugin is authoritative. If specific zones are listed (for examplein-addr.arpaandip6.arpa), then only queries for those zones will be subject to fallthrough.Startup
When CoreDNS starts with the multicluster plugin enabled, it will delay serving DNS for up to 5 seconds until it can connect to the Kubernetes API and synchronize all object watches. If this cannot happen within 5 seconds, then CoreDNS will start serving DNS while the multicluster plugin continues to try to connect and synchronize all object watches. CoreDNS will answer SERVFAIL to any request made for a Kubernetes record that has not yet been synchronized.
Examples
Handle all queries in the
clusterset.localzone. Connect to Kubernetes in-cluster.Installation
See CoreDNS documentation about Compile Time Enabling or Disabling Plugins.
Recompile coredns
Add the plugin to
plugins.cfgfile. The ordering of plugins matters, add it just belowkubernetesplugin that has very similar functionality:Follow the coredns README file to build it.
Modify cluster’s corefile
To enable the plugin for
clusterset.localzone, addmulticlusterconfiguration to thecorefile. Resultingcorefilemay look like this: