Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Podman play kube does not respect spec.hostname setting #12393

Closed
dispensable opened this issue Nov 23, 2021 · 1 comment · Fixed by #12466
Closed

Podman play kube does not respect spec.hostname setting #12393

dispensable opened this issue Nov 23, 2021 · 1 comment · Fixed by #12466
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@dispensable
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

After setting customized hostname in play kube yaml file with spec.hostname and use play kube create pod, the container's hostname is still pod name instead of spec.hostname.

Steps to reproduce the issue:

  1. touch test.yaml with content:
# Save the output of this file and use kubectl create -f to import
# it into Kubernetes.
#
# Created with podman-3.4.0
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2021-11-23T10:13:05Z"
  labels:
    app: aaa
  name: aaa
spec:
  hostname: test1234
  containers:
  - command:
    - sleep
    - "6000"
    env:
    - name: TERM
      value: dumb
    - name: DEBIAN_FRONTEND
      value: noninteractive
    image: docker.io/library/debian:buster
    name: test
    resources: {}
    securityContext:
      allowPrivilegeEscalation: true
      capabilities: {}
      privileged: false
      readOnlyRootFilesystem: false
      seLinuxOptions: {}
    workingDir: /
  dnsConfig: {}
  restartPolicy: Never
status: {}
  1. use podman play kube test.yaml start pod

  2. podman exec -it aaa-test hostname should be test1234 but got aaa

Describe the results you received:
pod name

Describe the results you expected:
spec.hostname

Additional information you deem important (e.g. issue happens only occasionally):
If use podman inspect aaa-test --format "{{ .Config.Hostname }}" will got the correct spec.hostname but hostname cmd and python -c "import socket; socket.gethostname()" will got pod name. If create pod with podman pod create --hostname test1234 -n aaa, the hostname been setted correctlly.

Output of podman version:

Version:      3.4.0
API Version:  3.4.0
Go Version:   go1.17.1
Built:        Mon Oct 18 11:00:12 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.23.1
  cgroupControllers: []
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: app-emulation/conmon-2.0.27
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.27, commit: v2.0.27'
  cpus: 32
  distribution:
    distribution: gentoo
    version: unknown
  eventLogger: file
  hostname: theoden
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 2392
      size: 1
    - container_id: 1
      host_id: 362144
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 2392
      size: 1
    - container_id: 1
      host_id: 362144
      size: 65536
  kernel: 5.10.27-gentoo
  linkmode: dynamic
  logDriver: k8s-file
  memFree: 7362101248
  memTotal: 135077969920
  ociRuntime:
    name: crun
    package: app-emulation/crun-1.2
    path: /usr/bin/crun
    version: |-
      crun version 1.2
      commit: 4f6c8e0583c679bfee6a899c05ac6b916022561b
      spec: 1.0.0
      +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +YAJL
  os: linux
  remoteSocket:
    path: /tmp/podman-run-2392/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_AUDIT_WRITE,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_MKNOD,CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: app-emulation/slirp4netns-0.4.2
    version: |-
      slirp4netns version 0.4.2
      commit: 69153b0d1cb82216d6782179ff7c3c5e91c731a1
  swapFree: 0
  swapTotal: 0
  uptime: 1470h 48m 13.58s (Approximately 61.25 days)
plugins:
  log:
  - k8s-file
  - none
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - docker.douban
  - mirror.docker.douban
store:
  configFile: /data/home/username/.config/containers/storage.conf
  containerStore:
    number: 14
    paused: 0
    running: 4
    stopped: 10
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: sys-fs/fuse-overlayfs-1.0.0
      Version: |-
        fusermount3 version: 3.10.3
        fuse-overlayfs: version 1.0.0
        FUSE library version 3.10.3
        using FUSE kernel interface version 7.31
  graphRoot: /home/username/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 34
  runRoot: /tmp/podman-run-2392/containers
  volumePath: /home/username/.local/share/containers/storage/volumes
version:
  APIVersion: 3.4.0
  Built: 1634526012
  BuiltTime: Mon Oct 18 11:00:12 2021
  GitCommit: ""
  GoVersion: go1.17.1
  OsArch: linux/amd64
  Version: 3.4.0

Package info (e.g. output of rpm -q podman or apt list podman):

[U] app-emulation/podman
     Available versions:  (~)3.3.0_rc3^t{tbz2}[1] (~)3.3.1^t{tbz2} (~)3.4.0^st{tbz2} 3.4.1^st ~3.4.2^st {apparmor btrfs +fuse +rootless selinux}
     Installed versions:  3.4.0^st{tbz2}(11:00:45 AM 10/18/2021)(fuse rootless -apparmor -btrfs -selinux)
     Homepage:            https://github.com/containers/podman/
     Description:         Library and podman tool for running OCI-based containers in Pods

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Yes

test with podman v3.4.2 still reproduce this problem

Additional environment details (AWS, VirtualBox, physical, etc.):
physical

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 23, 2021
@rhatdan
Copy link
Member

rhatdan commented Nov 23, 2021

@umohnani8 PTAL

dispensable pushed a commit to dispensable/podman that referenced this issue Dec 1, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants