On 2017-09-05 6:19 pm, 'Tim Hockin' via Kubernetes user discussion and
Q&A wrote:
We do not have a mechanism to express what you want to express, then.
You control the cluster suffix and the subdomain, and the pod name,
but even with all of those in play, the hostname comes out as
`<pod>.<subdomain>.svc.<suffix>`, I am pretty sure. I am open to
proposals on how to allow what you want.
Docker allows us to launch containers this way. For example, I can
perform the following:
sudo docker run -d -h "$(openssl rand -hex 8).ourdomain.com" -p
33334:33333 the-container-image
And then the container that gets launched will successfully report back
a fully-qualified hostname that includes the domain name when I issue a
hostname -f.
In answer to your comment about proposals on how to allow what I want, I
guess conceptually I'd think the following:
Kubernetes is already setting the hostname for each pod that gets
launched - usually in the form of
<service-name>-<replicaset-id>-<some-unique-hash>. I guess then what
would make sense to me is that this be changed to be
<service-name>-<replicaset-id>-<some-unique-hash>.<cluster-domain>. In
most cases, then, your fully-qualified pod hostname would look like
abc-1234567-12345.cluster.local. But if you chose to override the
cluster domain on your cluster, you could then easily make it change to
abc-1234567-12345.yourdomain.com.
Any reason why this couldn't work, or shouldn't be done? (I.e., any
particular reason why a pod hostname should not always be set to a
fqdn?)
Thanks,
DR
--
You received this message because you are subscribed to the Google Groups "Kubernetes
user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.