-
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
Migrate to Istio v1alpha3 Gateway / VirtualService #1228
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Verified that helloworld sample still works with this PR.
- Reviewed about one third of this PR. Will try to finish the rest of this PR within this week.
&RouteRule{}, | ||
&RouteRuleList{}, | ||
&VirtualService{}, | ||
&Gateway{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also define GatewayList. Do we want to add it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
WebsocketUpgrade bool `json:"websocketUpgrade,omitempty"` | ||
|
||
// Timeout for HTTP requests. | ||
Timeout string `json:"timeout,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no objection but just curious: why the type of timeout is string? Looks like originally it is Duration prototype: https://istio.io/docs/reference/config/istio.networking.v1alpha3/#HTTPRoute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if there is a way to deserialize the duration strings "10m", "1h", etc into a Duration struct.
All Istio objects are processed as JSON, which is basically map[string]string, and then parsed into protobuf on their side.
return rs.IsReady() && !rs.IsInactive() | ||
} | ||
|
||
func (rs *RevisionStatus) IsRoutable() bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference btw status Active and Routable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when revisions are in Inactive state, we can still route traffic to it through the activator
@@ -113,9 +113,7 @@ const ( | |||
// RouteConditionReady is set when the service is configured | |||
// and has available backends ready to receive traffic. | |||
RouteConditionReady RouteConditionType = "Ready" | |||
// RouteConditionIngressReady is set when the route's underlying ingress | |||
// resource has been set up. | |||
RouteConditionIngressReady RouteConditionType = "IngressReady" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we just delete this condition instead of replacing it with RouteConditionGatewayReady?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we only have a single Gateway that we create at the time of setup (see config/202-gateway.yaml), the Gateway is always ready.
configV1alpha2 *configv1alpha2.ConfigV1alpha2Client | ||
servingV1alpha1 *servingv1alpha1.ServingV1alpha1Client | ||
networkingV1alpha3 *networkingv1alpha3.NetworkingV1alpha3Client | ||
servingV1alpha1 *servingv1alpha1.ServingV1alpha1Client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because of gofmt autoindent.
} | ||
|
||
// NewForConfig creates a new NetworkingV1alpha3Client for the given config. | ||
func NewForConfig(c *rest.Config) (*NetworkingV1alpha3Client, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename this function to "NewForNetworking" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Config here refers to the "c *rest.Config" parameter.
// panics if there is an error in the config. | ||
func NewForConfigOrDie(c *rest.Config) *ConfigV1alpha2Client { | ||
func NewForConfigOrDie(c *rest.Config) *NetworkingV1alpha3Client { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename to "NewForNetworkingOrDie" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as previous comment.
For helloworld example, looks like the VirtualService only matches host "route-example.default.demo-domain.com" and "route-example-service.default.svc.cluster.local", but misses host "*.route-example.default.demo-domain.com". Below is the spec of VirtualService:
|
466f032
to
fd89f7b
Compare
/test pull-knative-serving-go-coverage |
/test pull-knative-serving-integration-tests |
@ZhiminXiang since sample/helloworld/sample.yaml doesn't have named TrafficTarget, that is to be expected. |
/test pull-knative-serving-integration-tests |
/test pull-knative-serving-intergration-tests |
/assign @mdemirhan Feel free to /assign myself or mattmoor if you need approval after Mustafa has given a /lgtm |
@mdemirhan I updated a link to #1376 (the upstream issue istio/istio#5588 has been fixed, will be out on 1.0 release). I've also rebased. It's ready for another look. |
The timeout headers were added when we used v1alpha2 in order to allow more time for 0->1 scaling. I accidentally undo that change when moving to v1alpha3. This adds it back.
The following is the coverage report on pkg/. Say
*TestCoverage feature is being tested, do not rely on any info here yet |
pkg/controller/route/route.go
Outdated
c.ServingClientSet.ServingV1alpha1().Configurations(r.Namespace), | ||
c.ServingClientSet.ServingV1alpha1().Revisions(r.Namespace), | ||
r) | ||
// Even if targetErr != n`il, we still need to finish updating the labels so that the updates to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to stamp this now to avoid more merge hell, let's get this in and fix the typo in a follow up
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mattmoor, mdemirhan, tcnghia The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Update samples to not use Ingress. This is follow-up of knative/serving#1228. We moved to Istio v1alpha3 / Gateway which requires a different way to get the external IP address to send traffic to our samples. * Also update the command to find service domain.
* Update samples to not use Ingress. This is follow-up of knative/serving#1228. We moved to Istio v1alpha3 / Gateway which requires a different way to get the external IP address to send traffic to our samples. * Also update the command to find service domain.
Fixes #1047 #794 #348
In this change we also move from an N Ingresses model to a single shared Gateway for all of Knative services. We also create our own load-balanced service to do so in order to avoid conflict with users when using the
istio-ingressgateway
service, since Gateways can not share the service for ingresses.