title: Setting the hostname for a container running in Kubernetes
body: <p>I want to set the hostname in a container running inside Kubernetes, but Kubernetes appears to be overriding whatever I set at runtime.</p>
  
  <p>I've tried both setting /etc/hostname in the docker image I'm having Kubernetes use, and including <code>echo "host.example.com &gt; /etc/hostname"</code> in the CMD in the Dockerfile.</p>
  
  <p>There appears to be a docker flag <code>-h</code> to set the hostname. Is there a way for me to specify in my replication controller that it should start the container with a special flag?</p>
  
  <p>The container's Debian, if it helps.</p>