<p>Here output of strace command</p>
<pre><code>/ # strace hostname -f
execve("/bin/hostname", ["hostname", "-f"], 0x7ffd0fb7df78 /* 84 vars */) = 0
arch_prctl(ARCH_SET_FS, 0x7f36d29e7d48) = 0
set_tid_address(0x7f36d29e831c)         = 34
mprotect(0x7f36d29e4000, 4096, PROT_READ) = 0
mprotect(0x564ae99b0000, 16384, PROT_READ) = 0
getuid()                                = 0
uname({sysname="Linux", nodename="test-st-0", ...}) = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
read(3, "# Kubernetes-managed hosts file."..., 1024) = 248
read(3, "", 1024)                       = 0
close(3)                                = 0
open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 3
fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
read(3, "# Kubernetes-managed hosts file."..., 1024) = 248
read(3, "", 1024)                       = 0
close(3)                                = 0
ioctl(1, TIOCGWINSZ, {ws_row=41, ws_col=173, ws_xpixel=0, ws_ypixel=0}) = 0
writev(1, [{iov_base="test-st-0.test-st.ippbx.svc.clus"..., iov_len=41}, {iov_base="\n", iov_len=1}], 2test-st-0.test-st.ippbx.svc.cluster.local
) = 42
exit_group(0)                           = ?
+++ exited with 0 +++
</code></pre>
<p>Looks as <code>hostname -f</code> take value from <code>/etc/hosts</code> file</p>
<pre><code>/ # cat /etc/hosts
# Kubernetes-managed hosts file.
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe00::1 ip6-allnodes
fe00::2 ip6-allrouters
172.21.0.141    test-st-0.test-st.ippbx.svc.cluster.local       test-st-0
</code></pre>
<p>Test made using this statefulset.</p>
<div class="highlight highlight-source-yaml"><pre><span class="pl-ent">apiVersion</span>: <span class="pl-s">apps/v1</span>
<span class="pl-ent">kind</span>: <span class="pl-s">StatefulSet</span>
<span class="pl-ent">metadata</span>:
  <span class="pl-ent">name</span>: <span class="pl-s">test-st</span>
<span class="pl-ent">spec</span>:
  <span class="pl-ent">podManagementPolicy</span>: <span class="pl-s">Parallel</span>
  <span class="pl-ent">serviceName</span>: <span class="pl-s">test-st</span>
  <span class="pl-ent">replicas</span>: <span class="pl-c1">1</span>
  <span class="pl-ent">selector</span>:
    <span class="pl-ent">matchLabels</span>:
      <span class="pl-ent">app</span>: <span class="pl-s">test-st</span>
  <span class="pl-ent">template</span>:
    <span class="pl-ent">metadata</span>:
      <span class="pl-ent">labels</span>:
        <span class="pl-ent">app</span>: <span class="pl-s">test-st</span>
    <span class="pl-ent">spec</span>:
      <span class="pl-ent">containers</span>:
      - <span class="pl-ent">name</span>: <span class="pl-s">proxy</span>
        <span class="pl-ent">securityContext</span>:
          <span class="pl-ent">privileged</span>: <span class="pl-c1">true</span>
        <span class="pl-ent">image</span>: <span class="pl-s">kamailio/kamailio-ci:master-alpine.debug</span>
        <span class="pl-ent">imagePullPolicy</span>: <span class="pl-s">IfNotPresent</span>
        <span class="pl-ent">command</span>:
          - <span class="pl-s">/bin/sh</span>
        <span class="pl-ent">args</span>:
          - <span class="pl-s"><span class="pl-pds">"</span>-c<span class="pl-pds">"</span></span>
          - <span class="pl-s"><span class="pl-pds">"</span>sleep 360000000000<span class="pl-pds">"</span></span></pre></div>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2119?email_source=notifications&email_token=ABO7UZMMBAUJ7WVWQCH6FADQSOEBZA5CNFSM4JHLXPF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDJCOEY#issuecomment-550643475">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZMZJDQOIWQIMZHXXW3QSOEBZANCNFSM4JHLXPFQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZJ637BEINURF57IWVLQSOEBZA5CNFSM4JHLXPF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDJCOEY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2119?email_source=notifications\u0026email_token=ABO7UZMMBAUJ7WVWQCH6FADQSOEBZA5CNFSM4JHLXPF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDJCOEY#issuecomment-550643475",
"url": "https://github.com/kamailio/kamailio/issues/2119?email_source=notifications\u0026email_token=ABO7UZMMBAUJ7WVWQCH6FADQSOEBZA5CNFSM4JHLXPF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDJCOEY#issuecomment-550643475",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>