Specify hostname, subdomain via annotation on podspec.

The hostname is a DNS A record, if the subdomain maps to a service name
in the same namespace
This commit is contained in:
Abhishek Shah
2016-02-02 10:59:54 -08:00
parent 4e00333f9b
commit a3c00aadd5
13 changed files with 261 additions and 54 deletions

View File

@@ -23,6 +23,18 @@ import (
"k8s.io/kubernetes/pkg/util/intstr"
)
const (
// The annotation value is a string specifying the hostname to be used for the pod e.g 'my-webserver-1'
PodHostnameAnnotation = "pod.beta.kubernetes.io/hostname"
// The annotation value is a string specifying the subdomain e.g. "my-web-service"
// If specified, on the the pod itself, "<hostname>.my-web-service.<namespace>.svc.<cluster domain>" would resolve to
// the pod's IP.
// If there is a headless service named "my-web-service" in the same namespace as the pod, then,
// <hostname>.my-web-service.<namespace>.svc.<cluster domain>" would be resolved by the cluster DNS Server.
PodSubdomainAnnotation = "pod.beta.kubernetes.io/subdomain"
)
// FindPort locates the container port for the given pod and portName. If the
// targetPort is a number, use that. If the targetPort is a string, look that
// string up in all named ports in all containers in the target pod. If no