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

PortName is requeried for Multi-port Services #279

Open
kulukami opened this issue Oct 21, 2024 · 0 comments
Open

PortName is requeried for Multi-port Services #279

kulukami opened this issue Oct 21, 2024 · 0 comments
Assignees
Labels
assess We still haven't decided if this will be worked on or not base core enhancement New feature or request

Comments

@kulukami
Copy link

Is your feature request related to a problem? Please describe.

container.ports [] set multiple ports in service_manifest.yml, but only first one 5003 shown in k8s control dashboard.

Here is the scaler kubernetes_ctl.py, it parse spec.container.ports as a list[int]

service.spec.ports = [V1ServicePort(port=int(_p)) for _p in spec.container.ports]

But as k8s docs describes:

Multi-port Services
For some Services, you need to expose more than one port. Kubernetes lets you configure multiple port definitions on a Service object. When using multiple ports for a Service, you must give all of your ports names so that these are unambiguous. For example:

apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  selector:
    app.kubernetes.io/name: MyApp
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: 9376
    - name: https
      protocol: TCP
      port: 443
      targetPort: 9377

Describe the solution you'd like
A update for odm.module of DockerConfig ports like the k8s ports: V1ServicePort

Or simply adding name for each port while creating k8s pods in scaler kubernetes_ctl.py,

service.spec.ports = [V1ServicePort(port=int(_p),name="port_{}".format(spec.container.ports.index(_p))) for _p in spec.container.ports]
@kulukami kulukami added assess We still haven't decided if this will be worked on or not enhancement New feature or request labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assess We still haven't decided if this will be worked on or not base core enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants