kubehostport

package module
v0.0.0-...-32d5992 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

coreha

Name

coreha - serve A records of node IP-s for specific pods

Description

CoreDNS plugin to discover IPv4 addresses of Kubernetes nodes, where deployed specific pods with hostPort. Plugin will select pods with specified label key and answer on A requests IP-addresses of their nodes.

Syntax

In-cluster deploy

kubeapi
coreha [ZONES...] {
  ttl TTL
  labelKey kubernetes.pod/label
  strictHostPort BOOL
}

For local deploy add path to kubeconfig

kubeapi {
    kubeconfig ~/.kube/config
}

Example

.:1053 {
  kubeapi {
    kubeconfig ~/.kube/config
  }
  coreha coreha.my-cluster.shturval {
    ttl 15
    labelKey shturval.link/serviceName
    strictHostPort true
  }
}

How to build

# assume go and git already setup
# clone coredns repo
git clone https://github.com/coredns/coredns.git && cd coredns/

# add plugin to plugin.cfg
echo "coreha:github.com/shturval-tech/coreha" >> ./plugin.cfg

# build coredns
make

# check plugins after build
./coredns -plugins

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubeHostport

type KubeHostport struct {
	Next  plugin.Handler
	Zones []string

	Fall fall.F
	// contains filtered or unexported fields
}

KubeHostport is a plugin that creates records for a Kubernetes cluster's nodes with specific pods.

func New

func New(zones []string) *KubeHostport

New returns a initialized KubeHostport.

func (*KubeHostport) Name

func (k *KubeHostport) Name() string

Name implements the Handler interface.

func (*KubeHostport) Ready

func (k *KubeHostport) Ready() bool

Ready implements the ready.Readiness interface.

func (*KubeHostport) ServeDNS

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

ServeDNS implements the plugin.Handler interface.

Jump to

Keyboard shortcuts

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