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

NodePort cannot be defined if the service contains several ports #17582

Closed
cmoulliard opened this issue Jun 1, 2021 · 1 comment · Fixed by #17659
Closed

NodePort cannot be defined if the service contains several ports #17582

cmoulliard opened this issue Jun 1, 2021 · 1 comment · Fixed by #17659
Assignees
Labels
Milestone

Comments

@cmoulliard
Copy link

Describe the bug

The Kubernetes nodePort cannot be defined for one specific port if the service contains several ports but only globally using the following property quarkus.kubernetes.node-port.

Here is what I tried to configure for a service able to expose 2 ports: 8080 and 5005 and where it is needed to specify 2 nodeports: 30000, 31000

quarkus.kubernetes.service-type=NodePort
quarkus.kubernetes.ports.http.name=http
quarkus.kubernetes.ports.http.host-port=8080
quarkus.kubernetes.ports.http.container-port=8080
quarkus.kubernetes.ports.http.node-port=30000

quarkus.kubernetes.ports.remote.name=http
quarkus.kubernetes.ports.remote.host-port=5005
quarkus.kubernetes.ports.remote.container-port=5005
quarkus.kubernetes.ports.remote.node-port=31000

See code:

Expected behavior

apiVersion: v1
kind: Service
metadata:
  ...
spec:
  ports:
  - name: http
    port: 8080
    targetPort: 8080
    nodePort: 30000
  - name: remote
    port: 5005
    targetPort: 5005
    nodePort: 31000
  selector:
    app.kubernetes.io/name: chapter-6-quarkus-rest-debug
    app.kubernetes.io/version: "1.0"
  type: NodePort

Actual behavior

apiVersion: v1
kind: Service
metadata:
...
spec:
  ports:
  - name: http
    port: 8080
    targetPort: 8080
  - name: remote
    port: 5005
    targetPort: 5005
  selector:
    app.kubernetes.io/name: chapter-6-quarkus-rest-debug
    app.kubernetes.io/version: "1.0"
  type: NodePort

To Reproduce

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).

Or attach an archive containing the reproducer to the issue.

Steps to reproduce the behavior:

  1. Generate a quarkus project
  2. Add the extension quarkus-kubernetes
  3. Add the properties as defined hereafter
  4. ./mvnw clean package

Configuration

quarkus.kubernetes.service-type=NodePort
quarkus.kubernetes.ports.http.name=http
quarkus.kubernetes.ports.http.host-port=8080
quarkus.kubernetes.ports.http.container-port=8080
quarkus.kubernetes.ports.http.node-port=30000

quarkus.kubernetes.ports.remote.name=http
quarkus.kubernetes.ports.remote.host-port=5005
quarkus.kubernetes.ports.remote.container-port=5005
quarkus.kubernetes.ports.remote.node-port=31000

Environment (please complete the following information):

Quarkus version or git rev

1.13.4.Final
@cmoulliard cmoulliard added the kind/bug Something isn't working label Jun 1, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 1, 2021

/cc @geoand

@geoand geoand self-assigned this Jun 3, 2021
@geoand geoand added kind/enhancement New feature or request and removed kind/bug Something isn't working labels Jun 3, 2021
geoand added a commit to geoand/quarkus that referenced this issue Jun 3, 2021
geoand added a commit to geoand/quarkus that referenced this issue Jun 4, 2021
geoand added a commit to geoand/quarkus that referenced this issue Jun 4, 2021
geoand added a commit that referenced this issue Jun 4, 2021
Allow specifying per-port nodePort
@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jun 4, 2021
@gsmet gsmet modified the milestones: 2.1 - main, 2.0.0.Final Jun 7, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 7, 2021
Resolves: quarkusio#17582
(cherry picked from commit 6db9384)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants