简体   繁体   English

具有应用程序网关入口 controller 配置的 AKS

[英]AKS with Application gateway ingress controller configuration

I configured application gateway ingress controller for my Kube.netes cluster, but I can't access my pod container app named myapp running on port 8080/TCP.我为我的 Kube.netes 集群配置了应用程序网关入口 controller,但我无法访问在端口 8080/TCP 上运行的名为myapp的 pod 容器应用程序。

I created a service that has the following configuration:我创建了一个具有以下配置的服务:

apiVersion: v1
kind: Service
metadata:
  name: myapp-service
spec:
  selector:
    app: myapp
  ports:
    - port: 8080
      name: myapp-api

and the ingress with the following configuration:以及具有以下配置的入口:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-resource
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
spec:
  rules:
  - http:
      paths:
      - backend:
          service:
            name: myapp-service
            port:
              number: 8080
        path: /
        pathType: Exact

but still every time I access the fronted IP of the application gateway, I get 502 Bad Gateway?但是每次访问应用程序网关的前端 IP 时,我仍然得到 502 Bad Gateway? Am I missing something?我错过了什么吗?

魔法错误

Glad @ Razvan that you resolved the issue yourself.很高兴@Razvan你自己解决了这个问题。 Posting your resolution as an answer to help other community members.将您的解决方案作为答案发布,以帮助其他社区成员。

There can be many reasons for App Gateway 502 errors mainly if the backend health shows as unhealthy in Application Gateway. App Gateway 502错误的原因可能有很多,主要是如果后端运行状况在应用程序网关中显示为不健康

That you resolved using the correct annotation which in turn returned the 404 Error .您使用正确的注释解决了问题,该注释又返回了404 Error It is resolved by adding the following annotation to the ingress: appgw.ingress.kube.netes.io/health-probe-status-codes: "200 -399, 404 "通过向入口添加以下注释来解决: appgw.ingress.kube.netes.io/health-probe-status-codes: "200 -399, 404 "

After adding the health probes , the backend service will become healthy .添加健康探测后,后端服务将变得健康

There is a similar issue on Microsoft Q&A , where the 502 Bad Gateway error on Azure Applicate Gateway Ingress is solved by Ingress Annotations as well as the Probes Path correctly and also few reasons mentioned here which causes this error. Microsoft Q&A上有一个类似的问题,其中 Azure Applicate Gateway Ingress 上的502 Bad Gateway 错误Ingress Annotations以及 Probes Path 正确解决,并且这里提到的导致此错误的原因很少。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用自定义 su.net 为 AKS 群集启用应用程序网关入口 Controller (AGIC) 加载项 - Enable the Application Gateway Ingress Controller (AGIC) add-on for an AKS cluster using custom subnet AKS Istio Ingress 网关证书无效 - AKS Istio Ingress gateway Certificate is not valid Azure 流量管理器给出 SSL 错误,而 App 网关 URL 在 AKS 上使用 Azure App 网关入口 controller 时工作 - Azure Traffic manager gives SSL error while App gateway URL works while using Azure App gateway ingress controller on AKS 通过 Bicep 模板使用应用程序网关入口加载项创建 AKS 集群 - Create AKS Cluster with Application Gateway Ingress Add-on via Bicep Template 允许 Azure 应用程序网关路由 AKS 中的所有子路径 - Allow Azure Application Gateway to route all sub paths in AKS Helm install NGINX ingress controller 尝试用错误的区域查找 AKS DNS - Helm install NGINX ingress controller tries to look up AKS DNS with wrong region AKS ISTIO 网关不可访问 - AKS ISTIO Gateway is not accessiable 为什么即使我将 AppGateway 用作入口 Controller,也会在 AKS 中创建 Azure 负载均衡器? - Why Azure Load Balancer gets created in AKS even though I have used AppGateway as an Ingress Controller? AKS 入口路由重新加载问题 - AKS ingress route reloading issue 在 nginx-ingress 后面的 aks 上托管 django - Hosting django on aks behind nginx-ingress
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM