title: can I give hostname for each container in kubernetes
body: <pre><code>agent {
          kubernetes {
              yaml &quot;&quot;&quot;
  spec:
    
    containers:
    - name: abc
      image: myrepo/abc:v1.0
      tty: true
      command:
       - cat
      resources:
        requests:
          memory: &quot;16Gi&quot;
          cpu: &quot;8000m&quot;
        limits:
          memory: &quot;64Gi&quot;
          cpu: &quot;8000m&quot;
      securityContext:
        runAsGroup: 500
        runAsUser: 500
    - name: mssqldb
      image: myrepo/mssql:2019-latest
      tty: true
      readinessProbe:
        initialDelaySeconds: 10
        failureThreshold: 10
        periodSeconds: 3
        tcpSocket:
          port: 1433
      securityContext:
        runAsUser: 11001
        runAsGroup: 0
      resources:
        requests:
          memory: &quot;4Gi&quot;
          cpu: &quot;4000m&quot;
        limits:
          memory: &quot;8Gi&quot;
          cpu: &quot;8000m&quot;
  &quot;&quot;&quot;
              defaultContainer 'abc'
              
          }
      }
  </code></pre>
  <p>I am running this in my pipeline, but what I am trying to do is to have a hostname for each container, because container to be able to communicate with each other, plus I want to add another container as a client that will try to connect to the server which is the abc container.
  when I added hostname before containers part, i get same hostname for all the container which I don't really get, unless it is giving a hostname for the host luanching the containers (ps: when trying the hostname command it gives a random name that changes each time, unless I define the hostname)</p>