Kubernetes: how to using '--add-host'?

12/28/2015

my project need add 1 line to /etc/hosts, with docker i did:

docker run --rm --add-host=kafka:10.0.x.xx kafka/backend

I want add config in replication controller but can't find config or env.

Pls suggest to me solution ? Thanks !!

-- user3171689
kubernetes

1 Answer

12/28/2015

AFAIK there's nothing directly comparable to Docker's --add-host, which really only adds an entry to /etc/hosts, in your case kafka 10.0.x.x, but here is a SO question that contains answers that should be helpful for your case (assuming a few things here since you didn't provide a context what you want to achieve).

-- Michael Hausenblas
Source: StackOverflow