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 #356

Closed
snowdrop-bot opened this issue Jun 3, 2021 · 0 comments
Closed
Assignees
Labels
7 - Community development upstream/closed The issue has been closed in the upstream repository

Comments

@snowdrop-bot
Copy link
Collaborator

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

quarkusio#17582


$upstream:17582$

@snowdrop-bot snowdrop-bot added the upstream/closed The issue has been closed in the upstream repository label Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7 - Community development upstream/closed The issue has been closed in the upstream repository
Projects
None yet
Development

No branches or pull requests

2 participants