Closed rsletten closed 4 years ago
@haircommander WDYT?
We have the hostPort options wired up, but it's possible there's somewhere it's dropped. I'll try to look at this later today
I remember from working on https://github.com/containers/libpod/pull/5642/, port parsing should be fine, but there's no bind to individual IP supported.
As of 1.9 it's not supported https://github.com/containers/libpod/blob/d985723506a29766ed21585ba8541033db6bd572/pkg/adapter/pods.go#L798
Where did pkg/adapter go in v2?
I can confirm this.
ports:
- containerPort: 9095
hostIP: 10.4.0.61
hostPort: 9095
protocol: TCP
This yaml create a container like:
PORTS
0.0.0.0:9095->9095/tcp
We should fix this for v2.0
@ashley-cui PTAL
@mheon Unfortunately it is not fixed in v2.0.
This is a real problem. It is currently not possible to use a port twice if you have multiple IPs on the host.
A friendly reminder that this issue had no activity for 30 days.
@ashley-cui Did you ever get a chance to look at this? @ryanchpowell Any chance you could look at this?
@rhatdan Didn't get a chance to look at it, but should be free to take it today, unless @ryanchpowell wants it
@ashley-cui you take it.
@rhatdan How do I write tests for this? Since IP's change from machine to machine
This issue seems to be fixed with the PR. In which version will this be shipped?
I installed 2.0.4
and the issue is still there.
I test it , it's ok in 2.0.4
@x70b1
root@develop:~# podman pod create --name test -p 127.0.0.1:5000:5000/tcp
ab80c59f25f86548e4a650844ea4e7eaa7af003299e7096675b003553271f88d
root@develop:~# podman run -dt -i --pod test alpine top -d 10
8839a33de99021534a3876e9b7cda8a7d5caa054022c3bea07a5112e604b5295
root@develop:~# podman generate kube test
# Generation of Kubernetes YAML is still under development!
#
# Save the output of this file and use kubectl create -f to import
# it into Kubernetes.
#
# Created with podman-2.0.2
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: "2020-08-04T13:06:22Z"
labels:
app: test
name: test
spec:
containers:
- command:
- top
- -d
- "10"
env:
- name: PATH
value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- name: TERM
value: xterm
- name: container
value: podman
- name: HOSTNAME
value: test
image: docker.io/library/alpine:3.12
name: kindmeitner
ports:
- containerPort: 5000
hostIP: 127.0.0.1
hostPort: 5000
protocol: TCP
resources: {}
securityContext:
allowPrivilegeEscalation: true
capabilities: {}
privileged: false
readOnlyRootFilesystem: false
seLinuxOptions: {}
stdin: true
tty: true
workingDir: /
status: {}
---
metadata:
creationTimestamp: null
spec: {}
status:
loadBalancer: {}
root@develop:~# podman --version
podman version 2.0.4
@zhangguanzhang What did you exactly test?
The problem here is that podman listen on all adresses instead of the defined one.
# netstat -tulpen | grep conmon
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 0 23029 1096/conmon
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 0 23030 1096/conmon
# podman --version
podman version 2.0.4
That is my kubernetes.yaml:
spec:
...
- image: localhost/nginx
name: nginx
ports:
- containerPort: 80
hostIP: 192.168.100.1
hostPort: 80
protocol: tcp
- containerPort: 443
hostIP: 192.168.100.1
hostPort: 443
protocol: tcp
Looks like it didn't get into 2.0.4 but is in master
Well, then lets hope for 2.0.5 :crossed_fingers:
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
podman generate kube doesn't seem to create any kube yaml which would run the equivalent of
podman pod create -p 192.168.1.239:5000:5000/tcp
Or podman play kube doesn't create the pod with the hostIP assigned to the container.
Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Additional environment details (AWS, VirtualBox, physical, etc.):
VM on Proxmox