application-gateway-kubernetes-ingress: AGIC Removes Custom Error Pages on Listeners

I have custom error pages applied to listeners in App Gateway. AGIC seems to be removing these any time it performs an update to the AGW. Is there a way I can define the custom error pages as part of the ingress resource?

To Reproduce Set custom error pages on listeners for 403 and 502 errors. Perform a kubernetes deploy Observe the listeners no longer have custom error pages applied.

Ingress Controller details

Name:           ingress-azure-1579727113-5c8f655454-zmgvb
Namespace:      default
Priority:       0
Node:           aks-stdd4sv3-29704773-vmss000000/10.250.16.97
Start Time:     Tue, 28 Jan 2020 15:40:00 -0600
Labels:         aadpodidbinding=ingress-azure-1579727113
                app=ingress-azure
                pod-template-hash=5c8f655454
                release=ingress-azure-1579727113
Annotations:    prometheus.io/port: 8123
                prometheus.io/scrape: true
Status:         Running
IP:             10.250.16.117
Controlled By:  ReplicaSet/ingress-azure-1579727113-5c8f655454
Containers:
  ingress-azure:
    Container ID:   docker://5cf43d7fb60321928a32fff0fefdcb15d06b09108e4bdb820c44208e00cccaba
    Image:          mcr.microsoft.com/azure-application-gateway/kubernetes-ingress:1.0.0
    Image ID:       docker-pullable://mcr.microsoft.com/azure-application-gateway/kubernetes-ingress@sha256:c295f99ae66443c5a392fd894620fcd1fc313b9efdec96d13f166fefb29780a9
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Tue, 04 Feb 2020 15:14:16 -0600
    Last State:     Terminated
      Reason:       Error
      Exit Code:    2
      Started:      Tue, 28 Jan 2020 15:40:25 -0600
      Finished:     Tue, 04 Feb 2020 15:13:20 -0600
    Ready:          True
    Restart Count:  1
    Liveness:       http-get http://:8123/health/alive delay=15s timeout=1s period=20s #success=1 #failure=3
    Readiness:      http-get http://:8123/health/ready delay=5s timeout=1s period=10s #success=1 #failure=3
    Environment Variables from:
      ingress-azure-1579727113  ConfigMap  Optional: false
    Environment:
      AZURE_CONTEXT_LOCATION:  /etc/appgw/azure.json
      AGIC_POD_NAME:           ingress-azure-1579727113-5c8f655454-zmgvb (v1:metadata.name)
      AGIC_POD_NAMESPACE:      default (v1:metadata.namespace)
    Mounts:
      /etc/appgw/azure.json from azure (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from ingress-azure-1579727113-token-8xfvp (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  azure:
    Type:          HostPath (bare host directory volume)
    Path:          /etc/kubernetes/azure.json
    HostPathType:  File
  ingress-azure-1579727113-token-8xfvp:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  ingress-azure-1579727113-token-8xfvp
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:          <none>

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 6
  • Comments: 22

Commits related to this issue

Most upvoted comments

Unfortunately in ps but sets a custom url at the gateway level.

$resourceGroup = “your rg” $AppGWName = “your gw” $customError502Url = “your url” $customError403Url = “your url” $AppGw = Get-AzApplicationGateway -Name $AppGWName -ResourceGroupName $resourceGroup $updatedGW = Add-AzApplicationGatewayCustomError -ApplicationGateway $AppGw -StatusCode HttpStatus502 -CustomErrorPageUrl $customError502Url $updatedGW = Add-AzApplicationGatewayCustomError -ApplicationGateway $AppGw -StatusCode HttpStatus403 -CustomErrorPageUrl $customError403Url Set-AzApplicationGateway -ApplicationGateway $AppGw

Any updates on that opened PR? Any plans on implementing and releasing such a feature?