Skip to content

Allow traffic going outside the cluster#1123

Merged
mdemirhan merged 4 commits intoknative:masterfrom
mdemirhan:istioegress2
Jun 12, 2018
Merged

Allow traffic going outside the cluster#1123
mdemirhan merged 4 commits intoknative:masterfrom
mdemirhan:istioegress2

Conversation

@mdemirhan
Copy link
Copy Markdown
Contributor

  • Changed the default installation to allow traffic going outside without getting terminated by Istio's sidecar.
  • Refactored config map informer in route controller to use a shared factory and reuse the same factory within the revision controller as well.
  • NOTE: k8sflag with Dynamic setting was tested; however it was very inconsistent in getting updates to the config map, missing more than half of the updates. Because of that, ConfigMap informers are used to get changes in the config map.

…hout getting terminated by Istio's sidecar.

* Refactored config map informer in route controller to use a shared factory and reuse the same factory within the revision controller as well.
NOTE: k8sflag with Dynamic setting was tested; however it was very inconsistent in getting updates to the config map, missing more than half of the updates. Because of that, ConfigMap informers are used to get changes in the config map.
@mdemirhan mdemirhan requested review from grantr, tcnghia and vaikas June 9, 2018 02:31
@google-prow-robot google-prow-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 9, 2018
@mdemirhan
Copy link
Copy Markdown
Contributor Author

@vaikas-google and @grantr Funnily enough, we now need config map updates in another controller as well and I refactored my checkin today to do the thing I said we didn't need :) Please take a look.

My first shot at this change was to use k8sflag package but it was very frequently missing updates and never getting them. That is why k8sflag with Dynamic option is not used here.

@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/controller/route/route.go 78.9% 78.9% -0.0
pkg/controller/route/route_test.go 78.9% 78.9% -0.0
pkg/controller/revision/ela_pod.go 92.0% 94.6% 2.6
pkg/controller/revision/revision.go 74.8% 76.0% 1.1
pkg/controller/revision/revision_test.go 74.8% 76.0% 1.1

*TestCoverage feature is being tested, do not rely on any info here yet

Comment thread cmd/controller/main.go
elaInformerFactory := informers.NewSharedInformerFactory(elaClient, time.Second*30)
buildInformerFactory := buildinformers.NewSharedInformerFactory(buildClient, time.Second*30)
servingSystemInformerFactory := kubeinformers.NewFilteredSharedInformerFactory(kubeClient,
time.Minute*5, pkg.GetServingSystemNamespace(), nil)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious where the 5 minutes comes from. Others are in 30 resync so just curious.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With other informers, we end up reconciling everything every 30 seconds. I didn't think that we needed that aggressive reconcilliation for domain configuration or the network configuration - those should change only once in the lifetime of the cluster if ever. Also, the reconcilliation is needed only if we somehow missed the original notification that gets sent when the configuration changes (I don't know how we would miss the notification - may be when there are successive deletes and creates the ordering might cause an issue?).

Let me know if you want me to change this to 30 seconds.

Comment thread config/config-network.yaml Outdated
namespace: knative-serving-system
data:
# Specifies the IP ranges that Istio sidecar will intercept.
# Replace this with the IP ranges of your cluster.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add an example of how to determine what this range is?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hehe, I see it now below. perhaps:
Replace this with the IP ranges of your cluster (see below for some examples).

or just leave it as is. Just when I was reading this the first time, I was like roh-roh?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add an extra (see below...) :)

Comment thread pkg/controller/revision/ela_pod.go Outdated
podTemplateAnnotations[sidecarIstioInjectAnnotation] = "true"

// Inject the IP ranges for istio sidecar configuration.
// We will inject this value only if all of the following is true:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

following are true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Comment thread pkg/controller/revision/ela_pod.go Outdated
// Inject the IP ranges for istio sidecar configuration.
// We will inject this value only if all of the following is true:
// - the config map contains a non-empty value
// - the user doesn't specify this annotation in their configuration
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'in their configuration', meaning the pod template? Perhaps clarify.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is correct. Clarified in the comments.

// - the user doesn't specify this annotation in their configuration
// - configured values are valid CIDR notation IP addresses
// If these conditions are not met, this value will be left untouched.
// * is a special value that is accepted as a valid.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does * mean? It's valid, but is it obvious from Istio configuration? Does this mean all traffic is then intercepted?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is correct. I clarified in the comments.

@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/controller/route/route.go 78.9% 78.9% -0.0
pkg/controller/route/route_test.go 78.9% 78.9% -0.0
pkg/controller/revision/ela_pod.go 92.0% 94.6% 2.6
pkg/controller/revision/revision.go 74.8% 75.7% 0.9
pkg/controller/revision/revision_test.go 74.8% 75.7% 0.9

*TestCoverage feature is being tested, do not rely on any info here yet

@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/controller/route/route.go 78.9% 78.9% -0.0
pkg/controller/route/route_test.go 78.9% 78.9% -0.0
pkg/controller/revision/revision.go 74.8% 75.7% 0.9
pkg/controller/revision/revision_test.go 74.8% 75.7% 0.9
pkg/controller/revision/ela_pod.go 92.0% 94.6% 2.6

*TestCoverage feature is being tested, do not rely on any info here yet

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Jun 9, 2018

/lgtm

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 9, 2018
@josephburnett
Copy link
Copy Markdown
Contributor

My first shot at this change was to use k8sflag package but it was very frequently missing updates and never getting them. That is why k8sflag with Dynamic option is not used here.

Can you tell me more about this? It does take a minute for the kubelet to pickup config map changes and update the mounted filesystem.

# Conflicts:
#	pkg/controller/service/service.go
@google-prow-robot google-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 12, 2018
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/controller/route/route.go 78.2% 78.0% -0.3
pkg/controller/route/route_test.go 78.2% 78.0% -0.3
pkg/controller/revision/pod.go 92.0% 94.6% 2.6
pkg/controller/revision/revision.go 74.3% 75.2% 1.0
pkg/controller/revision/revision_test.go 74.3% 75.2% 1.0

*TestCoverage feature is being tested, do not rely on any info here yet

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Jun 12, 2018

/lgtm
/approve

@google-prow-robot google-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 12, 2018
@google-prow-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mdemirhan, vaikas-google

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-prow-robot google-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 12, 2018
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/. Say /test pull-knative-serving-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/controller/route/route.go 78.0% 78.2% 0.2
pkg/controller/route/route_test.go 78.0% 78.2% 0.2
pkg/controller/revision/pod.go 92.0% 94.6% 2.6
pkg/controller/revision/revision.go 74.3% 75.2% 1.0
pkg/controller/revision/revision_test.go 74.3% 75.2% 1.0

*TestCoverage feature is being tested, do not rely on any info here yet

@mdemirhan mdemirhan merged commit ad03dbb into knative:master Jun 12, 2018
@google-prow-robot
Copy link
Copy Markdown

google-prow-robot commented Jun 12, 2018

@mdemirhan: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-knative-serving-go-coverage f955a8a link /test pull-knative-serving-go-coverage

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@mdemirhan mdemirhan deleted the istioegress2 branch June 13, 2018 19:21
nak3 added a commit to nak3/serving that referenced this pull request Jun 2, 2022
* Add update-ci to generate ci configs

* Update README

* Exclude mutli and init container image

* Update to better message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants