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

help request: How to use Ingress CRD with host and port #11236

Open
Richard0706 opened this issue May 7, 2024 · 3 comments
Open

help request: How to use Ingress CRD with host and port #11236

Richard0706 opened this issue May 7, 2024 · 3 comments

Comments

@Richard0706
Copy link

Description

About apisix's ingress crd,I know that it can be configured like this:

apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: httpbin-route
spec:
  http:
    - name: route-1
      match:
        hosts:
          - local.httpbin.org
        paths:
          - /*
      backends:
        - serviceName: httpbin
          servicePort: 80

But I need to configure my upstream node, it is not a k8s service,how can i do it,like this:

apiVersion: apisix.apache.org/v2
kind: ApisixRoute
metadata:
  name: httpbin-route
spec:
  http:
    - name: route-1
      match:
        hosts:
          - local.httpbin.org
        paths:
          - /*
      backends:
        - host: 192.168.1.80
          port: 8090

this can't possibly work!apisix.apache.org/v2,does it have the ability to configure endpoints?
I know I can define an upstream service with host and port ,and then use CRD, but I don't want to do that. I need your help.

Environment

  • APISIX version (run apisix version):3.2 LTS
  • Operating system (run uname -a):
  • OpenResty / Nginx version (run openresty -V or nginx -V):
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@zlhgo
Copy link
Contributor

zlhgo commented May 8, 2024

you can write custom k8s service and ep at your own.

@shreemaan-abhishek
Copy link
Contributor

shreemaan-abhishek commented May 8, 2024

AFAIK, it's not possible to do this. @zlhgo's suggestion seems right.

EDIT:

seems like there is a way: https://apisix.apache.org/docs/ingress-controller/1.6.0/tutorials/external-service/#external-domain-upstream

@Richard0706
Copy link
Author

AFAIK, it's not possible to do this. @zlhgo's suggestion seems right.

EDIT:

seems like there is a way: https://apisix.apache.org/docs/ingress-controller/1.6.0/tutorials/external-service/#external-domain-upstream

Thanks for your suggestion, but it doesn't solve my problem. When I configure ApisixUpstream using ip and port it is wrong:
Domain must match lowercase RFC 1123 subdomain. a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters,
This does not comply with the DNS specification. Can you give me a demo of the upstream service configuration IP and port, like this:

spec:
  externalNodes:
  - type: Domain
    name: 192.168.1.80:8080

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

No branches or pull requests

3 participants