Setting hostname in Kubernetes Pod Yaml
Hi Everybody, I’m not sure if this is a Kubernetes standard behavior or Podman bug/feature. When I: ================================================== tee test-this.yml <<< 'apiVersion: v1 kind: Pod metadata: name: mypod123 spec: hostname: test456 containers: - name: first image: docker.io/library/debian:bookworm command: ["/bin/sleep"] args: - "infinity" - name: second image: docker.io/library/debian:bullseye command: ["/bin/sleep"] args: - "infinity" - name: third image: docker.io/library/ubuntu:focal command: ["/bin/sleep"] args: - "infinity"' podman play kube test-this.yml ================================================== and then: ================================================== podman exec mypod123-first cat /etc/hostname test456 podman exec mypod123-first hostname mypod123 ================================================== And when I "podman exec -it mypod123-first bash" I can see "root@mypod123" in the prompt. In other words "spec.hostname" does change "/etc/hostname" but does not apply it like reboot on host would do. Can anyone please tell me, is it a bug or feature? Thank you. Kind regards, Rudolf Vesely
On 2/8/22 03:39, Rudolf Vesely via Podman wrote:
Hi Everybody,
I’m not sure if this is a Kubernetes standard behavior or Podman bug/feature.
When I:
================================================== tee test-this.yml <<< 'apiVersion: v1 kind: Pod metadata: name: mypod123 spec: hostname: test456 containers: - name: first image: docker.io/library/debian:bookworm command: ["/bin/sleep"] args: - "infinity" - name: second image: docker.io/library/debian:bullseye command: ["/bin/sleep"] args: - "infinity" - name: third image: docker.io/library/ubuntu:focal command: ["/bin/sleep"] args: - "infinity"'
podman play kube test-this.yml ==================================================
and then:
================================================== podman exec mypod123-first cat /etc/hostname test456
podman exec mypod123-first hostname mypod123 ==================================================
And when I "podman exec -it mypod123-first bash" I can see "root@mypod123" in the prompt.
In other words "spec.hostname" does change "/etc/hostname" but does not apply it like reboot on host would do.
Can anyone please tell me, is it a bug or feature?
Thank you.
Kind regards, Rudolf Vesely _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
That looks like a bug. Please open an issue.
On 2/8/22 03:39, Rudolf Vesely via Podman wrote:
Hi Everybody,
I’m not sure if this is a Kubernetes standard behavior or Podman bug/feature.
When I:
==================================================
tee test-this.yml <<< 'apiVersion: v1
kind: Pod
metadata:
name: mypod123
spec:
hostname: test456
containers:
- name: first
image: docker.io/library/debian:bookworm
command: ["/bin/sleep"]
args: - "infinity" - name: second
image: docker.io/library/debian:bullseye
command: ["/bin/sleep"]
args: - "infinity" - name: third
image: docker.io/library/ubuntu:focal
command: ["/bin/sleep"]
args: - "infinity"'
podman play kube test-this.yml ==============================
and then:
==================================================
podman exec mypod123-first cat /etc/hostname
test456
podman exec mypod123-first hostname
mypod123 =============================================
And when I "podman exec -it mypod123-first bash" I can see "root@mypod123" in the prompt.
In other words "spec.hostname" does change "/etc/hostname" but does not apply it like reboot on host would do.
Can anyone please tell me, is it a bug or feature?
Thank you.
Kind regards,
Rudolf Vesely
Podman mailing list -- podman@lists.podman.io
To unsubscribe send an email to podman-leave@lists.podman.io
That looks like a bug. Please open an issue.
Podman mailing list -- podman@lists.podman.io
To unsubscribe send an email to podman-leave@lists.podman.io
Hi Dan, Done. https://github.com/containers/podman/issues/13176 Thank you. Kind regards, Rudolf Vesely
participants (2)
-
Daniel Walsh -
Rudolf Vesely