<p>I have a pod configuration file with which I am able to create a pod that runs some containers with specific names. </p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: hazelcast
spec:
  restartPolicy: Never
  containers:
- name: bkregasp01
  image: hazelcast/hazelcast
  ports:
    - containerPort: 5701
  env:
    - name: JAVA_OPTS
      value: -Dhazelcast.rest.enabled=true
- name: bkregasp05
  image: hazelcast/hazelcast
  ports:
    - containerPort: 5701
  env:
    - name: JAVA_OPTS
      value: -Dhazelcast.rest.enabled=true
</code></pre>

<p>Once I create this pod I can check the containers created via the command </p>

<pre><code>docker ps -a 
</code></pre>

<p>And I can see that the names have been changed: </p>

<pre><code>NAMES
k8s_bkregasp01_hazelcast_default_acf5ebb0-8f2b-11e8-b2f0-0800275a6976_0
k8s_bkregasp05_hazelcast_default_acf5ebb0-8f2b-11e8-b2f0-0800275a6976_0
</code></pre>

<p>How can I avoid this so that the containers keep their original names specified in the configuration file?</p>

Omair 
<blockquote>
  <p>How can I avoid this so that the containers keep their original names specified in the configuration file?</p>
</blockquote>

<p>This is something you can not avoid since k8s depends on such naming convention to locate containers.</p>

<p>So far, the convention including a <em>k8s</em> as prefix plus pod name (e.g., <em>hazelcast</em>), namespace (<em>default</em>). see technical design details from <a href="https://github.com/kubernetes/kubernetes/issues/199" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/199</a></p>
