I followed the docs https://istio.io/docs/tasks/traffic-management/ingress/kubernetes-ingress/ , only the example which is in the docs can work. When i create a ingress configuration of my app, it can’t work.
here is my configuration:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: istio
meta.helm.sh/release-name: identity-api
meta.helm.sh/release-namespace: identity
creationTimestamp: null
generation: 1
labels:
app.kubernetes.io/instance: identity-api
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: identity-api
app.kubernetes.io/version: 1.16.0
helm.sh/chart: identity-api-0.1.0
name: identity-api-public
selfLink: /apis/extensions/v1beta1/namespaces/identity/ingresses/identity-api-public
spec:
rules:
- host: identity-api-staging.unity.cn
http:
paths:
- backend:
serviceName: identity-api-http-api
servicePort: http-api
path: /
tls:
- hosts:
- identity-api-staging.unity.cn
secretName: unity-cn-tls
status:
loadBalancer: {}
Every time I visit url, I return 404.
below is the log of ingressgateway:
2020-06-07T23:15:06.655159552+08:00 stdout F {"protocol":"HTTP/2","upstream_service_time":"-","upstream_local_address":"-","duration":"0","upstream_transport_failure_reason":"-","route_name":"default","downstream_local_address":"172.20.0.108:8443","user_agent":"curl/7.64.1","response_code":"404","response_flags":"-","start_time":"2020-06-07T15:15:00.804Z","method":"GET","request_id":"bd59a027-2763-9d7c-8c92-e5e80021bf21","upstream_host":"-","x_forwarded_for":"58.33.9.194","requested_server_name":"identity-api-staging.unity.cn","bytes_received":"0","istio_policy_status":"-","bytes_sent":"0","upstream_cluster":"-","downstream_remote_address":"58.33.9.194:32068","authority":"identity-api-staging.unity.cn","path":"/system/healthz"}
when i use this command to look the route.
istioctl proxy-config routes istio-ingressgateway-7df7c4f8bf-6zc7w -n istio-system -o json
[
{
"name": "https.443.https-443-ingress-identity-api-public-identity-0.identity-api-public-istio-autogenerated-k8s-ingress.istio-system",
"virtualHosts": [
{
"name": "blackhole:443",
"domains": [
"*"
],
"routes": [
{
"name": "default",
"match": {
"prefix": "/"
},
"directResponse": {
"status": 404
}
}
]
}
],
"validateClusters": false
},
{
"name": "http.80",
"virtualHosts": [
{
"name": "httpbin.example.com:80",
"domains": [
"httpbin.example.com",
"httpbin.example.com:*"
],
"routes": [
{
"match": {
"prefix": "/status",
"caseSensitive": true
},
"route": {
"cluster": "outbound|8000||httpbin.default.svc.cluster.local",
"timeout": "0s",
"retryPolicy": {
"retryOn": "connect-failure,refused-stream,unavailable,cancelled,retriable-status-codes",
"numRetries": 2,
"retryHostPredicate": [
{
"name": "envoy.retry_host_predicates.previous_hosts"
}
],
"hostSelectionRetryMaxAttempts": "5",
"retriableStatusCodes": [
503
]
},
"maxGrpcTimeout": "0s"
},
"metadata": {
"filterMetadata": {
"istio": {
"config": "/apis/networking.istio.io/v1alpha3/namespaces/default/virtual-service/httpbin-example-com-ingress-istio-autogenerated-k8s-ingress"
}
}
},
"decorator": {
"operation": "httpbin.default.svc.cluster.local:8000/status*"
}
}
]
}
],
"validateClusters": false
},
what’s wrong with the configuration?