Actually, you can get stable hostnames without full petset.

in v1.2 set the pod annotations `pod.beta.kubernetes.io/hostname` and
`pod.beta.kubernetes.io/subdomain`, and create a Service with
metadata.name=<subdomain> and clusterIP=None.

in v1.3 set the pod.spec.hostname and .subdomain fields instead

https://github.com/kubernetes/kubernetes/blob/master/build/kube-dns/README.md#a-records-and-hostname-based-on-pods-hostname-and-subdomain-fields

On Mon, Jun 27, 2016 at 2:52 PM, Rodrigo Campos <[email protected]> wrote:
> Are you sure the hostname is needed? You usually use services to connect to
> others. Or why do you need the hostname?
>
> To have a stable name to communicate, you can do two things: use a service
> for each replica or use PerSets.
>
> PerSets is coming in alpha in the upcoming kubernetes 1.3 release, in a few
> days. But, alpha might be to experimental for you. So you might consider
> using services or maybe explain in detail what you want achieve and people
> can come up with better ideas in the mailing list :)
>
> On Monday, June 27, 2016, Thomas Privat <[email protected]> wrote:
>>
>> Hello All,
>>
>> My application is running on 3 pods, each pod needs to know the hostname
>> from the other pods.
>> In the case that one pod crashes and will be restarted, how can I pass the
>> hostnames from the running pods into the new one via the env variables ?
>>
>> Cheers!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Containers at Google" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/google-containers.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Containers at Google" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/google-containers.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Containers at Google" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-containers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to