Skip to content

[BUG] hostPort defined on container ports from "expose" #1691

@albanm

Description

@albanm

Expected Behavior

The expose keyword's documentation is pretty clear: "Expose ports without publishing them to the host machine".

A port defined in expose should be declared as simple container port, a service should be created to allow access by others pods, but it should not be bound to the host.

Actual Behavior

The container port is created with "hostPort".

Steps To Reproduce

  1. create docker-compose with a service with expose: - "8080"
  2. use kompose convert
  3. check the deployment, it contains hostPort

Kompose Version

1.30.0 (9d8dcb518)

Docker-Compose file

version: '3'
services:
  test:
    image: test/test
    expose:
      - "8080"

Anything else?

No response

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions