ingress2gateway icon indicating copy to clipboard operation
ingress2gateway copied to clipboard

Error for named ports

Open gebinic opened this issue 9 months ago • 2 comments

What happened:

I executed ./ingress2gateway print --providers ingress-nginx and got an error:

# Encountered 3 errors # paths.backends[0].service.port: Invalid value: "name": named ports not supported: http # paths.backends[0].service.port: Invalid value: "name": named ports not supported: http # paths.backends[0].service.port: Invalid value: "name": named ports not supported: http

What you expected to happen:

I expected a successful conversion from Ingress to Gateway.

How to reproduce it (as minimally and precisely as possible):

Deploy an nginx and an application with a named port in your k8s cluster.

gebinic avatar Jan 23 '25 16:01 gebinic

Thanks @gebinic

Can you please paste your input (meaning ingresses in the cluster you are trying to convert)?

The tool does not support named ports now, but wanted to see your input to provide a more tailored response Thanks,

LiorLieberman avatar Jan 31 '25 18:01 LiorLieberman

Ingress:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    meta.helm.sh/release-name: my-app
    meta.helm.sh/release-namespace: my-namespace
  labels:
    app: spring
    app.kubernetes.io/managed-by: Helm
    chart: spring-2.1.2
    group: app-ingress
    heritage: Helm
    release: my-app
  name: my-app
  namespace: my-namespace
spec:
  rules:
  - host: myHost.com
    http:
      paths:
      - backend:
          service:
            name: my-app
            port:
              name: http
        path: /my-app
        pathType: Prefix
  tls:
  - hosts:
    - myHost.com
    secretName: my-tls-secrets

Service:

apiVersion: v1
kind: Service
metadata:
  annotations:
    meta.helm.sh/release-name: my-app
    meta.helm.sh/release-namespace: my-namespace
  labels:
    app: spring
    app.kubernetes.io/managed-by: Helm
    chart: spring-2.1.2
    heritage: Helm
    release: my-app
  name: my-app
  namespace: my-namespace
spec:
  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: 8080
  - name: grpc
    port: 8090
    protocol: TCP
    targetPort: 8090
  - name: management
    port: 8558
    protocol: TCP
    targetPort: 8558
  selector:
    app: my-app
  type: ClusterIP

gebinic avatar Feb 03 '25 11:02 gebinic

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar May 04 '25 12:05 k8s-triage-robot

/assign

gavinkflam avatar May 05 '25 00:05 gavinkflam

I see that this is fixed but when will there be a new relaease because the last (0.4.0) is form January.

steled avatar Oct 24 '25 13:10 steled

hi @LiorLieberman, could we release a new version please?

gavinkflam avatar Oct 26 '25 03:10 gavinkflam

Hi @gavinkflam will come up with a RC tomorrow. Sorry for the delay!

LiorLieberman avatar Nov 07 '25 00:11 LiorLieberman

@gavinkflam https://github.com/kubernetes-sigs/ingress2gateway/releases/tag/v0.5.0-rc1

LiorLieberman avatar Nov 07 '25 21:11 LiorLieberman