-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cluster Local KService generates ExternalIP Ingress #7233
Comments
Hi, can you please let me know what is your istio version..? I don't have a cluster-local-gateway service on knative v0.13 |
Hi @Uvindu96! |
Summarizing @tcnghia 's triaging and debugging in this Slack thread: https://knative.slack.com/archives/CA9RHBGJX/p1584101161136200 Here is the complete YAML of the created VirtualServices: apiVersion: v1
items:
- apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
annotations:
networking.knative.dev/ingress.class: istio.ingress.networking.knative.dev
serving.knative.dev/creator: system:serviceaccount:kubeflow:default
serving.knative.dev/lastModifier: system:serviceaccount:kubeflow:default
creationTimestamp: "2020-03-12T19:05:00Z"
generation: 1
labels:
serving.knative.dev/route: flowers-sample-pvc-predictor-default
serving.knative.dev/routeNamespace: default
name: flowers-sample-pvc-predictor-default
namespace: default
ownerReferences:
- apiVersion: networking.internal.knative.dev/v1alpha1
blockOwnerDeletion: true
controller: true
kind: Ingress
name: flowers-sample-pvc-predictor-default
uid: 5f369b51-6494-11ea-9209-42010a80002d
resourceVersion: "1938889"
selfLink: /apis/networking.istio.io/v1alpha3/namespaces/default/virtualservices/flowers-sample-pvc-predictor-default
uid: 5f3ac797-6494-11ea-9209-42010a80002d
spec:
gateways:
- knative-serving/cluster-local-gateway
- knative-serving/knative-ingress-gateway
hosts:
- flowers-sample-pvc-predictor-default.default
- flowers-sample-pvc-predictor-default.default.svc
- flowers-sample-pvc-predictor-default.default.svc.cluster.local
http:
- headers:
request:
add:
K-Network-Hash: cd6e79ef2641adf5255f319d214db248
match:
- authority:
prefix: flowers-sample-pvc-predictor-default.default
gateways:
- knative-serving/cluster-local-gateway
retries:
attempts: 3
perTryTimeout: 600s
route:
- destination:
host: flowers-sample-pvc-predictor-default-dz2vl.default.svc.cluster.local
port:
number: 80
headers:
request:
add:
Knative-Serving-Namespace: default
Knative-Serving-Revision: flowers-sample-pvc-predictor-default-dz2vl
weight: 100
timeout: 600s
websocketUpgrade: true
- apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
annotations:
networking.knative.dev/ingress.class: istio.ingress.networking.knative.dev
serving.knative.dev/creator: system:serviceaccount:kubeflow:default
serving.knative.dev/lastModifier: system:serviceaccount:kubeflow:default
creationTimestamp: "2020-03-12T19:05:00Z"
generation: 1
labels:
serving.knative.dev/route: flowers-sample-pvc-predictor-default
serving.knative.dev/routeNamespace: default
name: flowers-sample-pvc-predictor-default-mesh
namespace: default
ownerReferences:
- apiVersion: networking.internal.knative.dev/v1alpha1
blockOwnerDeletion: true
controller: true
kind: Ingress
name: flowers-sample-pvc-predictor-default
uid: 5f369b51-6494-11ea-9209-42010a80002d
resourceVersion: "1938887"
selfLink: /apis/networking.istio.io/v1alpha3/namespaces/default/virtualservices/flowers-sample-pvc-predictor-default-mesh
uid: 5f3899a9-6494-11ea-9209-42010a80002d
spec:
gateways:
- mesh
hosts:
- flowers-sample-pvc-predictor-default.default
- flowers-sample-pvc-predictor-default.default.svc
- flowers-sample-pvc-predictor-default.default.svc.cluster.local
http:
- headers:
request:
add:
K-Network-Hash: cd6e79ef2641adf5255f319d214db248
match:
- authority:
prefix: flowers-sample-pvc-predictor-default.default
gateways:
- mesh
retries:
attempts: 3
perTryTimeout: 600s
route:
- destination:
host: flowers-sample-pvc-predictor-default-dz2vl.default.svc.cluster.local
port:
number: 80
headers:
request:
add:
Knative-Serving-Namespace: default
Knative-Serving-Revision: flowers-sample-pvc-predictor-default-dz2vl
weight: 100
timeout: 600s
websocketUpgrade: true
kind: List
metadata:
resourceVersion: ""
selfLink: "" As you can see from the first VirtualService, the VS includes the http:
match:
gateways:
- knative-serving/cluster-local-gateway So no traffic passes through the
A fix for this issue should make sure that the public gateway is not mentioned when handling a cluster-local service. In the meantime, one can use a dummy |
While looking at the Ingress created for the given KService, I noticed something weird: rules:
- hosts:
- flowers-sample-pvc-predictor-default.default.svc.cluster.local
http:
paths:
- retries:
attempts: 3
perTryTimeout: 10m0s
splits:
- appendHeaders:
Knative-Serving-Namespace: default
Knative-Serving-Revision: flowers-sample-pvc-predictor-default-zhdws
percent: 100
serviceName: flowers-sample-pvc-predictor-default-zhdws
serviceNamespace: default
servicePort: 80
timeout: 10m0s
visibility: ExternalIP
visibility: ExternalIP Visibility is ExternalIP while it should be ClusterLocal.
|
I opened knative-extensions/net-istio#44 to track the VirtualService generation bug. |
After upgrade to Knative 0.13, this is fixed as some changes in Ingress hosts. Hope it helps. refer to #7264 We run into a similar situation (Knative 0.12)with both enabled knative-ingress-gateway and cluster-local-gateway, but the services are failing with error |
/assign @tcnghia |
/assign @richterdavid |
/assign @shreejad |
This issue is stale because it has been open for 90 days with no |
Currently, creating a cluster local Kservice results in the following Kingress:
There are 2 "visibility" fields - ".spec.visibility" and ".spec.rules[0].visibility" I think #6732 fixed the issue of ".spec.rules[0].visibility" being "ExternalIP". Now it is "ClusterLocal" as seen in the above YAML. I'm not sure if the ".spec.visibility" field should be "ClusterLocal". In Kservices which are externally exposed, the ".spec.visibility" field does not exist. |
/remove-lifecycle stale |
According to knative/networking#129, the .spec.visibility field should be deprecated. Will investigate more about why it is still visible in cluster local services. |
The ".spec.visibility" field in KIngress has been removed in Knative version 0.18. The cluster I previously tested on was 0.17, which is why the field was still showing up. Closing this bug as it is no longer present in the latest Knative version. |
/close |
@shreejad: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
In what area(s)?
/area networking
What version of Knative?
0.11.x
More specifically: https://github.com/kubeflow/manifests/tree/v1.0-branch/knative/knative-serving-install/base
Expected Behavior
I have a cluster-local-gateway in the istio-system namespace.
I have also edit config-istio to look like this:
And config-domain:
Then, I create the following KNative Service:
I expect that the KNative Service will be exposed only via the cluster-local-gateway.
Actual Behavior
I get IngressNotConfigured:
The logs of the networking-istio deployment say:
In addition, I see VirtualServices created that point to a non-existent Gateway:
I would expect the KNative Service to only be exposed to the cluster-local-gateway.
Steps to Reproduce the Problem
Start a KNative Service with the configuration (cluster-local-gateway, config-istio, config-domain) provided above.
The text was updated successfully, but these errors were encountered: