I think, you need to define backend like below under spec: The error message indicates the same message
spec:
backend:
serviceName: appname
servicePort: 80
If the Answer is helpful, please click "Accept Answer" and upvote it
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I using AKS to host some backend apps, these apps are based on asp .net 6.0 containers, and use 80 port to communicate.
I created a ingress which point the host to service and the service related to deployment. And the DNS zone is related the host to the frontend ip address of appgw.
When I using the browser to access the webapi page the status is timed out. and the backend health of appgw show the status is unhealthy with message:
Received invalid status code: 404 in the backend server’s HTTP response. As per the health probe configuration, 200-399 is the acceptable status code. Either modify probe configuration or resolve backend issues. To learn more visit - https://aka.ms/StatusCodeMismatch.
But if I use VPN to connect to the virtual network and use the pod's ip address to access it and it is succeed.
Weird, right?
The ingress yaml:
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: ingressxxxxapi
namespace: default
uid: fc1bd1e4-1da9-43b9-add2-d5ba4bc0ad22
resourceVersion: '16194356'
generation: 2
creationTimestamp: '2022-02-28T06:34:15Z'
annotations:
kubernetes.io/ingress.class: azure/application-gateway
managedFields:
- manager: Mozilla
operation: Update
apiVersion: networking.k8s.io/v1
time: '2022-02-28T06:34:15Z'
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.: {}
f:kubernetes.io/ingress.class: {}
f:spec:
f:rules: {}
- manager: appgw-ingress
operation: Update
apiVersion: extensions/v1beta1
time: '2022-02-28T06:34:16Z'
fieldsType: FieldsV1
fieldsV1:
f:status:
f:loadBalancer:
f:ingress: {}
spec:
rules:
- host: api.xxxx.biz
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: xxxxerapi
port:
number: 80
status:
loadBalancer:
ingress:
- ip: 20.24.x.x
I think, you need to define backend like below under spec: The error message indicates the same message
spec:
backend:
serviceName: appname
servicePort: 80
If the Answer is helpful, please click "Accept Answer" and upvote it