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

Support multi-port services #170

Open
geiralund opened this issue May 8, 2020 · 4 comments
Open

Support multi-port services #170

geiralund opened this issue May 8, 2020 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@geiralund
Copy link

geiralund commented May 8, 2020

We do need to expose a gRPC endpoint for one of our services. The service does already expose an HTTP endpoint. Due to compatibility, we would like the service to support both protocols and reuse the same code in the service. Currently, we'll have to create two deploys, with different service manifest to expose both the gRPC endpoint and HTTP endpoint.

Kubernetes lets you configure multiple port definitions on a Service object and it would be great if we could have the same concept in naiserator.

Any ideas?

@Kyrremann Kyrremann added the enhancement New feature or request label May 8, 2020
@gtcno
Copy link
Contributor

gtcno commented May 8, 2020

@jhrv Foreslo workaround/løsning: Lag en egen svc med flere porter.
Som f.eks

kind: Service
metadata:
  labels:
    app: dp-inntekt-api-grpc
    team: teamdagpenger
  name: dp-inntekt-api-grpc
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 8099
  - name: grpc
    port: 50051
    protocol: TCP
    targetPort: 50051
  selector:
    app: dp-inntekt-api

Da er problemet redusert til om nais deploy støtter services og om RBAC tillater deploy
av services

Error from server (Forbidden): error when creating "./nais/nais-dev-deploy.yaml": services is forbidden: User "system:serviceaccount:default:serviceuser-teamdagpenger" cannot create resource "services" in API group "" in the namespace "default"

@audunstrand
Copy link

When this was implementet in FIAAS, we realised you also need to make it possible to decalre which port is used for healthchecks and metrics

@mortenlj
Copy link
Contributor

mortenlj commented May 8, 2020

When this was implementet in FIAAS, we realised you also need to make it possible to decalre which port is used for healthchecks and metrics

..and which ports should get which ingress URL. The FIAAS spec is documented here, it might give some ideas:
https://github.com/fiaas/fiaas-deploy-daemon/blob/master/docs/v3_spec.md

@kimtore kimtore added this to the Spec v2 milestone May 11, 2020
@kimtore
Copy link
Contributor

kimtore commented May 11, 2020

suggestion for v2?

spec:
  port: 80 // deprecated/removed
  ports:
  - name: http
    port: 80
    protocol: TCP // optional
    targetPort: 8099
  - name: grpc
    port: 50051
    protocol: TCP
    targetPort: 50051

@kimtore kimtore changed the title Support fort multi-port services in Naiserator? Support for multi-port services in Naiserator? Aug 3, 2020
@kimtore kimtore changed the title Support for multi-port services in Naiserator? Support multi-port services Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants