<p>In process install of my kubernetes cluster, I ran into the problem of naming pods. <br>
How to add to the name of the container the name of the node on which it is was deployed?<br></p>

<p>Exemple of my Daemon Set yaml:</p>

<pre><code>.... 
spec:
  template:
    spec:
      name: CONTAINER-NAME-HOST-NAME
....
</code></pre>

<p>Naming convention falls under the <a href="https://www.rfc-editor.org/rfc/rfc1123#section-2" rel="nofollow noreferrer">RFC 1123 definition</a> of a DNS label.</p>
<p><code>Starting from v1.4 names must not be longer than 253 characters.</code></p>
<p><code>Name should be expressed by the regular expression: [a-z0-9]([-a-z0-9]*[a-z0-9])?</code></p>
<p><code>Underscore &quot;_&quot; is not allowed.</code></p>
<p>You can see applicable code in GitHub for <a href="https://github.com/GoogleCloudPlatform/kubernetes/blob/53a9d106c4aabcd550cc32ae4e8004f32fb0ae7b/pkg/api/validation/validation.go#L280" rel="nofollow noreferrer">checking container names</a>, <a href="https://github.com/GoogleCloudPlatform/kubernetes/blob/7f2d0c0f710617ef1f5eec4745b23e0d3f360037/pkg/util/validation.go#L26" rel="nofollow noreferrer">defining acceptable names</a>.</p>
