CoreDNS plugin implementing K8s multi-cluster services DNS spec.

multicluster

Name

multicluster - implementation of Multicluster DNS

Description

This plugin implements the Kubernetes DNS-Based Multicluster Service Discovery Specification.

Syntax

multicluster [ZONES...] {
    kubeconfig KUBECONFIG [CONTEXT]
    noendpoints
    fallthrough [ZONES...]
}
  • kubeconfig KUBECONFIG [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).
  • noendpoints will 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 example in-addr.arpa and ip6.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.local zone. Connect to Kubernetes in-cluster.

.:53 {
    multicluster clusterset.local
}

Installation

See CoreDNS documentation about Compile Time Enabling or Disabling Plugins.

Recompile coredns

Add the plugin to plugins.cfg file. The ordering of plugins matters, add it just below kubernetes plugin that has very similar functionality:

...
kubernetes:kubernetes
multicluster:github.com/coredns/multicluster
...

Follow the coredns README file to build it.

Modify cluster's corefile

To enable the plugin for clusterset.local zone, add multicluster configuration to the corefile. Resulting corefile may look like this:

.:53 {
    errors
    health
    multicluster clusterset.local
    kubernetes cluster.local in-addr.arpa ip6.arpa {
      pods insecure
      fallthrough in-addr.arpa ip6.arpa
    }
    prometheus :9153
    forward . /etc/resolv.conf
    cache 30
    loop
    reload
    loadbalance
}
Owner
CoreDNS
Cloud Native DNS
CoreDNS
Comments
  • error: cannot use e (type *Endpoints) as type

    error: cannot use e (type *Endpoints) as type "k8s.io/apimachinery/pkg/apis/meta/v1"

    Hi guys,

    I am having trouble compiling the project. When adding the plugin in the plugin.cfg list I get the following error:

    # github.com/coredns/multicluster/object
    /go/pkg/mod/github.com/coredns/[email protected]/object/endpoint.go:104:2: cannot use e (type *Endpoints) as type "k8s.io/apimachinery/pkg/apis/meta/v1".Object in return argument:
    	*Endpoints does not implement "k8s.io/apimachinery/pkg/apis/meta/v1".Object (missing GetZZZ_DeprecatedClusterName method)
    /go/pkg/mod/github.com/coredns/[email protected]/object/endpoint.go:152:2: cannot use e (type *Endpoints) as type "k8s.io/apimachinery/pkg/apis/meta/v1".Object in return argument:
    	*Endpoints does not implement "k8s.io/apimachinery/pkg/apis/meta/v1".Object (missing GetZZZ_DeprecatedClusterName method)
    /go/pkg/mod/github.com/coredns/[email protected]/object/namespace.go:31:2: cannot use n (type *Namespace) as type "k8s.io/apimachinery/pkg/apis/meta/v1".Object in return argument:
    	*Namespace does not implement "k8s.io/apimachinery/pkg/apis/meta/v1".Object (missing GetZZZ_DeprecatedClusterName method)
    

    go version go1.18.2

  • bad prefix in one of the setup tests(?): 'kubernetes .. ' instead of 'multicluster ..'

    bad prefix in one of the setup tests(?): 'kubernetes .. ' instead of 'multicluster ..'

    Hi guys,

    I went through your setup_test.go file, and saw that the last test was config as 'kubernetes ..' instead of 'multicluster ...' in the plugin setup for the config map: in setup_test.go , line 34:

     `kubernetes coredns.local clusterset.local {
                fallthrough
                 }`,
    			false,
    			"",
    			2,
    			fall.Root,
    		},
    

    other test cases were with a multicluster prefix, as I thought should be (for example):

    		{
    			`multicluster coredns.local clusterset.local`,
    			false,
    			"",
    			2,
    			fall.Zero,
    		},
    

    Is there a reason for the different prefixes? Thanks.

  • error: failed to list *v1alpha1.ServiceImport: the server could not find the requested resource (get serviceimports.multicluster.x-k8s.io)

    error: failed to list *v1alpha1.ServiceImport: the server could not find the requested resource (get serviceimports.multicluster.x-k8s.io)

    Hello all,

    I've successfully deployed the plugin on my cluster. But when the pod start, it shows the errors: reflector.go:324] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: failed to list *v1alpha1.ServiceImport: the server could not find the requested resource (get serviceimports.multicluster.x-k8s.io) pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Failed to watch *v1alpha1.ServiceImport: failed to list *v1alpha1.ServiceImport: the server could not find the requested resource (get serviceimports.multicluster.x-k8s.io )

  • Change plugin name in one of 'setup_test' tests

    Change plugin name in one of 'setup_test' tests

    Fix typo in plugin name in one of the tests, changed plugin name in the test from 'kubernetes' to 'multicluster'

    Signed-off-by: Itay nakash [email protected]

  • Update for parity with changes in record functions

    Update for parity with changes in record functions

    Plugin does not build with coredns main branch, I tried at coredns commit a929b0b1ecbb0f87b0bd0cd0a40ce38893dce9c0

    lauralorenz@lauralorenz:~/coredns/coredns$ make
    CGO_ENABLED=0  go build -v -ldflags="-s -w -X github.com/coredns/coredns/coremain.GitCommit=a929b0b1-dirty" -o coredns
    github.com/coredns/multicluster
    # github.com/coredns/multicluster
    ../../go/pkg/mod/github.com/coredns/[email protected]/multicluster.go:131:18: assignment mismatch: 2 variables but plugin.A returns 3 values
    ../../go/pkg/mod/github.com/coredns/[email protected]/multicluster.go:133:18: assignment mismatch: 2 variables but plugin.AAAA returns 3 values
    ../../go/pkg/mod/github.com/coredns/[email protected]/multicluster.go:135:18: assignment mismatch: 2 variables but plugin.TXT returns 3 values
    ../../go/pkg/mod/github.com/coredns/[email protected]/multicluster.go:148:12: assignment mismatch: 2 variables but plugin.A returns 3 values
    make: *** [Makefile:16: coredns] Error 2
    

    Appears to be due to function signature changes for records in https://github.com/coredns/coredns/pull/4715 meaning this plugin is currently incompatible as of coredns 1.9.1.

  • Create go.yml

    Create go.yml

    Description

    [Describe what this change achieves]

    Issues Resolved

    [List any issues this PR will resolve]

    Check List

    • [ ] Commits are signed per the DCO using --signoff

    By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

  • Remove the reference to the package github.com/vanekjar/coredns-multicluster/

    Remove the reference to the package github.com/vanekjar/coredns-multicluster/

    Description

    Remove the reference to the package github.com/vanekjar/coredns-multicluster/

    Issues Resolved

    Consistency

    Check List

    • [ ] Commits are signed per the DCO using --signoff

    By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

  • Coredns build steps

    Coredns build steps

    Description

    • Add the step to build the coredns binary and docker more easily
    • Remove the reference to the package github.com/vanekjar/coredns-multicluster/

    Issues Resolved

    Improve stability

    Check List

    • [ ] Commits are signed per the DCO using --signoff

    By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

  • Full support for headless services

    Full support for headless services

    closes #1

    Adding support for headless services. Following multi-cluster DNS spec. Examples of supported queries:

    A query

    $ dig A nginx.my-namespace.svc.clusterset.local
    
    ;; ANSWER SECTION:
    nginx.my-namespace.svc.clusterset.local.	5 IN	A	10.244.0.9
    nginx.my-namespace.svc.clusterset.local.	5 IN	A	10.244.0.10
    nginx.my-namespace.svc.clusterset.local.	5 IN	A	10.244.0.8
    

    SRV query

    $ dig SRV nginx.my-namespace.svc.clusterset.local
    
    ;; ANSWER SECTION:
    nginx.my-namespace.svc.clusterset.local.	5 IN	SRV	0 33 80 10-244-0-10.clusterid.nginx.my-namespace.svc.clusterset.local.
    nginx.my-namespace.svc.clusterset.local.	5 IN	SRV	0 33 80 10-244-0-8.clusterid.nginx.my-namespace.svc.clusterset.local.
    nginx.my-namespace.svc.clusterset.local.	5 IN	SRV	0 33 80 10-244-0-9.clusterid.nginx.my-namespace.svc.clusterset.local.
    

    Endpoint query

    $ dig 10-244-0-10.clusterid.nginx.my-namespace.svc.clusterset.local
    
    ;; ANSWER SECTION:
    10-244-0-10.clusterid.nginx.my-namespace.svc.clusterset.local.	5 IN A 10.244.0.10
    
  • Add support for headless services

    Add support for headless services

    Currently, only ClusterIP is supported. Add support for headless services.

    See Multi-Cluster DNS spec.

    Affected part of the code https://github.com/vanekjar/coredns-multicluster/blob/bdb34f77f97d6f50a37788613f5a6b1f516379fa/multicluster.go#L353

Integrate AWS EKS Anywhere cluster with AWS Services
 Integrate AWS EKS Anywhere cluster with AWS Services

This article provides step-by-step instruction on integrating AWS EKS Anywhere with AWS Services so the applications running on customer data center can securely connect with these services.

Mar 6, 2022
A Go client implementing a client-side distributed consumer group client for Amazon Kinesis.
A Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

Kinesumer is a Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

Jan 5, 2023
support multi autosolve instances for AYCD

AYCD AutoSolve Go Client Client for connecting to the AYCD AutoSolve network

Jun 26, 2022
Package figtree provides a multi-paradigm SDK for sophisticated configuration file access

Package figtree provides a multi-paradigm SDK for sophisticated configuration file access. Motivation Figtree syntax is based on classic key/value pai

Dec 31, 2021
Backgammon Web API. Sophisticed neural net based multi-ply evalution engine for Backgammon moves

Backgammon Web API. Sophisticed neural net based multi-ply evalution engine for Backgammon moves.

Dec 25, 2022
Simple RESTful API for WhatsApp in Golang (using the Whatsmeow multi device library)
Simple RESTful API for WhatsApp in Golang (using the Whatsmeow multi device library)

WUZAPI WuzAPI is an implementation of @tulir/whatsmeow library as a simple RESTful API service with multiple device support and concurrent sessions. W

Dec 30, 2022
Go(lang) client library for accessing information of an Apache Mesos cluster.

megos Go(lang) client library for accessing an Apache Mesos cluster. Features Determine the Mesos leader Get the current state of every mesos node (ma

Sep 27, 2022
Open Cluster Management API

Open Cluster Management API Community, discussion, contribution, and support Getting Started Prerequisites Security Response The api repository define

Dec 23, 2022
Create an ESK cluster using CDK and Golang.

Welcome to your CDK Go project! This is a blank project for Go development with CDK. NOTICE: Go support is still in Developer Preview. This implies th

Feb 14, 2022
Cloud governance reports from native services in a clear and readable digest
Cloud governance reports from native services in a clear and readable digest

cloudig, or Cloudigest, is a simple CLI tool for creating reports from various cloud sources with user-provided comments. It is written in Go and curr

Nov 10, 2022
The MinIO Admin Go Client SDK provides APIs to manage MinIO services

Golang Admin Client API Reference The MinIO Admin Golang Client SDK provides APIs to manage MinIO services. This quickstart guide will show you how to

Dec 30, 2022
The Fabric Token SDK is a set of API and services that lets developers create token-based distributed application on Hyperledger Fabric.

The Fabric Token SDK is a set of API and services that let developers create token-based distributed application on Hyperledger Fabric.

Dec 14, 2022
NKN-ESI (or nESI) is an NKN based Energy Services Interface (ESI).

nkn-esi NKN-ESI (or nESI) is an NKN based Energy Services Interface (ESI). An ESI supports a distributed marketplace for energy services on the electr

Mar 18, 2022
Sample CDK projects developed by AWS Professional Services (ProServe)

AWS CDK Examples - ProServe This repository contains a set of CDK example projects which have been developed by AWS Professional Services (ProServe).

Dec 27, 2022
The Bhojpur Ara is a software product used for automated resource assembly within Bhojpur.NET Platform ecosystem to enable delivery of applications and services.

Bhojpur Ara - Automated Resource Assembly The Bhojpur Ara is a service product used for automated resource assembly within the Bhojpur.NET Platform ec

Apr 28, 2022
Nvote - Decentralized, vote-driven community similar to services like Reddit and HackerNews. Built on nostr

NVote Nvote is a decentralized, vote-driven community similar to services like R

Jan 4, 2023
Service that wrap up different movies-related APIs like IMDB and match it to streaming services
Service that wrap up different movies-related APIs like IMDB and match it to streaming services

Service that wrap up different movies-related APIs like IMDB and match it to streaming services. That way you can check in which platforms you can find your favorite movies.

Feb 10, 2022
Mock all the services. Intuitive YAML DSL for HTTP, gRPC, Kafka, and AMQP mocks.

OpenMock OpenMock is a Go service that can mock services in integration tests, staging environment, or anywhere. The goal is to simplify the process o

Nov 28, 2022
Mattermost Plugin - Starts meeting with Google Meet
Mattermost Plugin - Starts meeting with Google Meet

Mattermost Plugin - Starts meeting with Google Meet

Sep 16, 2022