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

Enhancement: giving an option to specify a nodePort #115

Open
miloslavkrisko opened this issue Dec 5, 2024 · 1 comment
Open

Enhancement: giving an option to specify a nodePort #115

miloslavkrisko opened this issue Dec 5, 2024 · 1 comment

Comments

@miloslavkrisko
Copy link

miloslavkrisko commented Dec 5, 2024

Hello as i am preparing the changes to support multiple docker registries and other stuff as setting the high available nexus deployment i noticed that the services.yaml are missing a component which would enable to define a nodePort value instead of having it defined randomly once the type is set as NodePort.

Change is simple in services.yaml:


  ports:
  - name: nexus-ui
     protocol: {{ .Values.service.nexus.protocol }}
     port: {{ .Values.service.nexus.port }}
     targetPort: {{ .Values.service.nexus.targetPort }}
     {{- if and (eq .Values.service.nexus.type "NodePort") (not (empty .Values.service.nexus.nodePort)) }}
     nodePort: {{ .Values.service.nexus.nodePort }}
     {{- end }}


For the second service it would be:


  ports:
   - name: docker-{{ $registry.port }}
      protocol: {{ $.Values.nexus.docker.protocol }}
      port: {{ $registry.port }}
      targetPort: {{ $registry.targetPort }}
      {{- if and (eq $.Values.nexus.docker.type "NodePort") (not (empty .registry.nodePort)) }}
      nodePort: {{ .registry.nodePort }}
      {{- end }}
     

Same way would be just a nodePort: line added to the values.yaml
That way instead of getting a random nodePorts people can keep it organized. This may also be beneficial from the security perspective that people may not need to open whole nodePort documented range but instead could choose a much smaller portion.

@miloslavkrisko
Copy link
Author

I edited the initial proposition by adding an extention to check if that value is not empty. If that will be not defined then the section will not be taken and randomized value will be used, but still for those who wants to use the defined values it can be easily added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant