Issue: Ingress controller is not able to route the request to the configured backend via a Headless Service. Seeing conflict when the APIs of my server starts with /api with some of existing APIs(I think so).
I have included the details below,
Cluster information:
Kubernetes version: 1.19
Cloud being used: AWS EKS
Installation method: Using EKSCTL
Host OS: Amazon Linux
CNI and version: -
CRI and version: -
Ingress Controller YAML
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: cluster-ingress-controller
spec:
rules:
- http:
paths:
- path: /api
backend:
serviceName: apiserver-service
servicePort: 9200
Ingress Description
$ kubectl describe ingress cluster-ingress-controller
Warning: extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
Name: cluster-ingress-controller
Namespace: default
Address:
Default backend: default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
Host Path Backends
---- ---- --------
*
/api apiserver-service:9200 (<ip>:9200,<ip>:9200)
Connection Request
Started the K8s proxy to access it via localhost. Fired the following request.
$ curl http://127.0.0.1:8001/api/v1/health
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {
},
"status": "Failure",
"message": "the server could not find the requested resource",
"reason": "NotFound",
"details": {
},
"code": 404
}
Please provide some help in order to access this request as according to me /api
is by default directed to some other location(server) and hence, it is not able to find my custom Healthcheck API.