Kong与AWS应用程序负载平衡器

发布于 2025-02-09 13:27:28 字数 1346 浏览 2 评论 0原文

我正试图创建一个alb-ingress-controller,并指向孔 - 普罗克西。由于Kong Controller仅支持Classic Loadbalancer和网络LoadBalancer,因此

我遵循了[https://discuss.konghq.com/t/kong-with-with-application-load-load-balancer/6568]的所有上述步骤指向Kong-Proxy服务。

假设我想为某些应用程序创建一个入口资源,以前我正在使用Kong Ingress创建这样的Ingress

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: foo
  namespace: default
spec:
  ingressClassName: kong
  rules:
  - http:
      paths:
      - path: /foo
        pathType: Prefix
        backend:
          service:
            name: foo-service
            port:
              number: 5000

,因为我们拥有Kong Proxy的ALB,我正在创建这样的入口,

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: foo
  namespace: default
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/certificate-arn: "certificate arn here"
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
    alb.ingress.kubernetes.io/target-type: ip 
spec:
  rules:
  - http:
      paths:
      - path: /foo
        pathType: Prefix
        backend:
          service:
            name: foo-service
            port:
              number: 5000

我的疑问是如何进行此操作穿过孔门户?因为这似乎是另一种Abs Intress资源。

我是新手,所以如果我在这里犯了任何错误,请启发我

I was trying to create an alb-ingress-controller and point to kong-proxy. Since kong controller supports only classic loadbalancer and network loadbalancer

I followed all the mentioned steps from [https://discuss.konghq.com/t/kong-with-aws-application-load-balancer/6568] and created an alb ingress which points to the kong-proxy service.

Suppose i want to create an ingress resource for some application, previously i was creating using the kong ingress for example like this

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: foo
  namespace: default
spec:
  ingressClassName: kong
  rules:
  - http:
      paths:
      - path: /foo
        pathType: Prefix
        backend:
          service:
            name: foo-service
            port:
              number: 5000

Now since we have an alb infront of the kong proxy, i am creating the ingress like this

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: foo
  namespace: default
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/certificate-arn: "certificate arn here"
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
    alb.ingress.kubernetes.io/target-type: ip 
spec:
  rules:
  - http:
      paths:
      - path: /foo
        pathType: Prefix
        backend:
          service:
            name: foo-service
            port:
              number: 5000

My doubt is how will this go through the kong gateway? Because it just seems like an another alb ingress resource.

I am new to this, so please enlighten me ,if i made any mistakes here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

残月升风 2025-02-16 13:27:28

您的Alb Intress应该指向Kong代理。该请求将通过您的alb - > Kong -Proxy-> foo-service

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: foo
  namespace: default
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/certificate-arn: "certificate arn here"
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
    alb.ingress.kubernetes.io/target-type: ip 
spec:
  rules:
  - http:
      paths:
      - path: /foo
        pathType: Prefix
        backend:
          service:
            name: kong-proxy 
            port:
              number: 80

上面的入口将意味着Ingress Controller使用以下内容配置ALB:

  • 两个侦听器:http:80https:443
  • http:80将将流量转发到kong-target-group
  • https:443的规则将具有指定的SSL证书集
  • https:443规则向Kong-Target-Group
  • Kong-Target-group将使用Kong-Proxy服务的NodePort,并将您的K8S群集节点作为注册目标

Your alb ingress should point to the kong proxy. The request will go through your alb -> kong-proxy -> foo-service.

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: foo
  namespace: default
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/certificate-arn: "certificate arn here"
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
    alb.ingress.kubernetes.io/target-type: ip 
spec:
  rules:
  - http:
      paths:
      - path: /foo
        pathType: Prefix
        backend:
          service:
            name: kong-proxy 
            port:
              number: 80

The above ingress will mean that the ingress controller configures the alb with the following:

  • two listeners: HTTP : 80 and HTTPS : 443
  • HTTP : 80 rules that will forward traffic to the kong-target-group
  • the HTTPS : 443 will have the specified SSL certificate set
  • HTTPS : 443 rules that will forward traffic to the kong-target-group
  • the kong-target-group will use the NodePort of the kong-proxy service and will have your k8s cluster nodes as the registered targets
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文