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

Error for named ports #209

Open
gebinic opened this issue Jan 23, 2025 · 2 comments
Open

Error for named ports #209

gebinic opened this issue Jan 23, 2025 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@gebinic
Copy link

gebinic commented Jan 23, 2025

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 gebinic added the kind/bug Categorizes issue or PR as related to a bug. label Jan 23, 2025
@LiorLieberman
Copy link
Member

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,

@gebinic
Copy link
Author

gebinic commented Feb 3, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants