【问题标题】:AKS azure/application-gateway health annotations doesn't update the health probe in Application GatewayAKS 天蓝色/应用程序网关运行状况注释不会更新应用程序网关中的运行状况探测
【发布时间】:2023-03-31 21:23:01
【问题描述】:

我有一个带有 AKS 的 Azure 应用程序网关,我在其中创建了带有以下注释的入口对象。

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: "myingress"
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
    appgw.ingress.kubernetes.io/backend-path-prefix: "/path/"
    appgw.ingress.kubernetes.io/health-probe-hostname: "myhost"
    appgw.ingress.kubernetes.io/health-probe-port: "myport"
    appgw.ingress.kubernetes.io/health-probe-path: "/path/health"
    appgw.ingress.kubernetes.io/health-probe-status-codes: "200-399, 403"
    appgw.ingress.kubernetes.io/health-probe-interval: "20"
    appgw.ingress.kubernetes.io/health-probe-timeout: "15"
    appgw.ingress.kubernetes.io/health-probe-unhealthy-threshold: "5"
spec:
  rules:
  - host: "myhost"
    http:
      paths:
      - path: /something/path/*
        pathType: Prefix
        backend:
          service:
            name: "myservice"
            port:
              number: "8080"

但是,我没有看到此信息传递到应用网关。

-- App Gwy config --            {
-- App Gwy config --                "id": "/subscriptions/mysubscription/resourceGroups/my-rg/providers/Microsoft.Network/applicationGateways/mygateway/probes/pb-ns-myservice-8080-myingress",
-- App Gwy config --                "name": "pb-ns-myservice-8080-myingress",
-- App Gwy config --                "properties": {
-- App Gwy config --                    "host": "myhost",
-- App Gwy config --                    "interval": 30,
-- App Gwy config --                    "match": {},
-- App Gwy config --                    "minServers": 0,
-- App Gwy config --                    "path": "/path/health",
-- App Gwy config --                    "pickHostNameFromBackendHttpSettings": false,
-- App Gwy config --                    "protocol": "Http",
-- App Gwy config --                    "timeout": 30,
-- App Gwy config --                    "unhealthyThreshold": 3
-- App Gwy config --                }
-- App Gwy config --            }

任何帮助将不胜感激。

【问题讨论】:

    标签: kubernetes-ingress azure-aks azure-application-gateway


    【解决方案1】:

    上述注释在 AGIC 版本号 1.4.0.Github Issue #1178 中可用
    要检查版本号,请运行以下命令:

    k describe pod -l app=ingress-azure -n kube-system | grep "Image:"
    

    结果:图片:mcr.microsoft.com/azure-application-gateway/kubernetes-ingress:1.4.0
    验证版本号应该是 1.4.0 或更高。

    注意:虽然 AKS-AGIC 插件会自动部署最新版本的 AGIC。但是,截至今天,它不会升级所需的版本。您需要通过 Helm 图表手动升级 AGIC 版本。按照以下链接中提到的步骤操作
    https://docs.microsoft.com/en-us/azure/application-gateway/ingress-controller-install-existing#install-ingress-controller-as-a-helm-chart

    【讨论】:

      【解决方案2】:

      我和 TS 有同样的问题,但我也安装并运行了 1.4.0:

      Containers:
        ingress-azure:
          Container ID: containerd://c2d74b1e8ca81394c85d9e5c484f125020d0f7c2ce07872bf1fc9d5bb15e317a
          Image: mcr.microsoft.com/azure-application-gateway/kubernetes-ingress:1.4.0
          Image ID: mcr.microsoft.com/azure-application-gateway/kubernetes-ingress@sha256:ae323e343be86e04bd74bdb707bf0e027a17ccf0423435a51cdaac0c13072e6b    
      

      如何解决?

      【讨论】:

      • 有趣。您能否在 azure > your-resource-group > application-gateway > health-probe(从左侧菜单)> ingress-object 中进行验证。如果您看到您在 ingress-object 中提供的配置是否反映。如果没有,请检查 AKS 是否真的与应用程序网关连接。您需要在应用程序网关和 AKS 群集之间创建网络对等互连。 docs.microsoft.com/en-us/azure/application-gateway/… 注意:AKS 位于它自己的资源组中,与应用程序网关分开。
      猜你喜欢
      • 2019-09-22
      • 1970-01-01
      • 2021-04-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-12
      • 1970-01-01
      • 2020-04-10
      相关资源
      最近更新 更多