Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions content/explugins/k8s_gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ description = "*k8s_gateway* - plugin to resolve all types of external Kubernete
weight = 10
tags = [ "plugin" , "k8s" ]
categories = [ "plugin", "external", "kubernetes" ]
date = "2020-09-19T12:00:00-08:00"
repo = "https://github.com/ori-edge/k8s_gateway"
home = "https://github.com/ori-edge/k8s_gateway/blob/master/README.md"
date = "2025-05-31T12:00:00-08:00"
repo = "https://github.com/k8s-gateway/k8s_gateway"
home = "https://github.com/k8s-gateway/k8s_gateway/blob/master/README.md"
+++

## Description

This plugin is very similar to [k8s_external](https://coredns.io/plugins/k8s_external/) but supporting all types of Kubernetes external resources - Ingress, Service of type LoadBalancer and `networking.x-k8s.io/Gateway` (when it becomes available).
A CoreDNS plugin that is very similar to [k8s_external](https://coredns.io/plugins/k8s_external/) but supporting all types of Kubernetes external resources - Ingress, Service of type LoadBalancer, HTTPRoutes, TLSRoutes, GRPCRoutes from the [Gateway API project](https://gateway-api.sigs.k8s.io/).

This plugin relies on it's own connection to the k8s API server and doesn't share any code with the existing [kubernetes](https://coredns.io/plugins/kubernetes/) plugin. The assumption is that this plugin can now be deployed as a separate instance (alongside the internal kube-dns) and act as a single external DNS interface into your Kubernetes cluster(s).
This plugin relies on its own connection to the k8s API server and doesn't share any code with the existing [kubernetes](https://coredns.io/plugins/kubernetes/) plugin. The assumption is that this plugin can now be deployed as a separate instance (alongside the internal kube-dns) and act as a single external DNS interface into your Kubernetes cluster(s).

## Syntax

Expand All @@ -25,7 +25,7 @@ Optionally, you can specify what kind of resources to watch and the default TTL

```
k8s_gateway example.com {
resources Ingress
resources Ingress Service HTTPRoute DNSEndpoint
ttl 10
}
```
Expand All @@ -50,13 +50,28 @@ With the above configuration the plugin will behave in the following way:

`k8s_gateway` resolves Kubernetes resources with their external IP addresses based on zones specified in the configuration. This plugin will resolve the following type of resources:

| Kind | Matching Against | External IPs are from |
| Kind | Matching Against | External IPs are from |
| ---- | ---------------- | -------- |
| HTTPRoute<sup>[1](#foot1),[1.1](#foot1.1)</sup> | all FQDNs from `spec.hostnames` matching configured zones | `gateway.status.addresses`<sup>[2](#foot2)</sup> |
| TLSRoute<sup>[1.1](#foot1)</sup> | all FQDNs from `spec.hostnames` matching configured zones | `gateway.status.addresses`<sup>[2](#foot2)</sup> |
| GRPCRoute<sup>[1](#foot1),[1.1](#foot1.1)</sup> | all FQDNs from `spec.hostnames` matching configured zones | `gateway.status.addresses`<sup>[2](#foot2)</sup> |
| Ingress | all FQDNs from `spec.rules[*].host` matching configured zones | `.status.loadBalancer.ingress` |
| Service[*] | `name.namespace` + any of the configured zones | `.status.loadBalancer.ingress` |
| Service<sup>[3](#foot3)</sup> | `name.namespace` + any of the configured zones OR any string consisting of lower case alphanumeric characters, '-' or '.', specified in the `coredns.io/hostname` or `external-dns.alpha.kubernetes.io/hostname` annotations (see [this](https://github.com/k8s-gateway/k8s_gateway/blob/master/test/single-stack/service-annotation.yml#L8) for an example) | `.status.loadBalancer.ingress` |
| DNSEndpoint<sup>[4](#foot4)</sup> | `spec.endpoints[*].targets` | |


<a name="f1">1</a>: Requires GatewayAPI crds. Standard 1.0.0+</br>
<a name="f1">1.1</a>: Currently supported version of GatewayAPI CRDs is v1.0.0+ experimental channel.</br>
<a name="f2">2</a>: Gateway is a separate resource specified in the `spec.parentRefs` of HTTPRoute|TLSRoute|GRPCRoute.</br>
<a name="f3">3</a>: Only resolves service of type LoadBalancer</br>
<a name="f4">4</a>: Requires external-dns CRDs</br>

[*]: Only resolves service of type LoadBalancer

Currently only supports A-type queries, all other queries result in NODATA responses.
Currently only supports A-type and AAAA-type queries, all other queries result in NODATA responses.

> This plugin is **NOT** supposed to be used for intra-cluster DNS resolution and by default will not contain the default upstream [kubernetes](https://coredns.io/plugins/kubernetes/) plugin.

## Maintainer

> This plugin is **NOT** supposed to be used for intra-cluster DNS resolution and by default will not contain the default upstream [kubernetes](https://coredns.io/plugins/kubernetes/) plugin.
Changed from ori-edge to k8s_gateway see the following PR [Looking for new Maintainer](https://github.com/ori-edge/k8s_gateway/issues/313)