Skip to content

Support a non-default cluster domain #261

@andyasp

Description

@andyasp

As mentioned in #258 (review), when constructing pod endpoints the cluster domain is hardcoded to the default cluster.local. It could be nice to support a non-default value.

Code reference:

func StatefulSetPodFQDN(namespace, statefulSetName string, ordinal int, serviceName string) string {
	// The DNS entry for a pod of a stateful set is
	// $(statefulset name)-(ordinal).$(service name).$(namespace).svc.cluster.local
	// https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id
	//
	// Ending that with a trailing "." to signify an absolute domain name
	// https://datatracker.ietf.org/doc/html/rfc1034#section-3.1
	return fmt.Sprintf("%v-%v.%v.%v.svc.cluster.local.",
		statefulSetName,
		ordinal,
		serviceName,
		namespace,
	)
}

Kubernetes documentation: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions