Skip to content

Add helm flags to control the app probe rewrite beahvior.#10344

Merged
istio-testing merged 10 commits intoistio:release-1.1from
incfly:health-flag
Dec 13, 2018
Merged

Add helm flags to control the app probe rewrite beahvior.#10344
istio-testing merged 10 commits intoistio:release-1.1from
incfly:health-flag

Conversation

@incfly
Copy link
Copy Markdown

@incfly incfly commented Dec 7, 2018

For #9150

istioctl kube-inject and auto injection has slightly different code path. The existing override changes only happen on istioctl level.

.Values.global.sidecarInjectorWebhook.rewriteAppHTTPProbe controls the sidecar injection template's option rewriteAppHTTPProbe. During injection, we'll then consult this flag to determine whether spec will be rewritten.

Jianfei Hu added 6 commits November 28, 2018 12:55
…s check. (istio#9266)

* WIP injector change to modify istio-proxy.

* move out to app_probe.go

* Iterating sidecartmpl to find the statusPort.

* use the same name for ready path.

* Get rewrite work, almost.

* Some clean up on test and check one container criteria.

* fix the injected test file.

* Add inject test for readiness probe itself.

* Add missing added test file.

* fix helm test.

* fix lint.

* update header based finding the port.

* return to previous injected file status.

* fixing TestIntoResource test.

* sed fixing all remaining injecting files.

* handling named port.

* fixing merginge failure.

* remove the debug print.

* lint fixing.

* Apply the suggestions for finding statusPort arg.

* Address comments, regex support more port value format.

* add app_probe_test.go

* add more test.

* merge fix the test.
@incfly incfly requested review from costinm and nmittler December 7, 2018 19:47
@incfly incfly removed the request for review from GregHanson December 7, 2018 19:47
if sidecarTemplate, err = inject.GenerateTemplateFromParams(&inject.Params{
InitImage: inject.InitImageName(hub, tag, debugMode),
ProxyImage: inject.ProxyImageName(hub, tag, debugMode),
RewriteAppHTTPProbe: false,
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.

should this be a flag?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done.

}
}

// TODO: plumbing wh.sidecarConfig.RewriteHTTPPRobe to the injectionData.
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.

nit: add your github handle in the TODO

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

@nmittler nmittler left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

data:
config: |-
policy: {{ .Values.global.proxy.autoInject }}
rewriteAppHTTPProbe: {{ .Values.sidecarInjectorWebhook.rewriteAppHTTPProbe }}
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.

Confused - why ?

Typically we use pod annotations to allow user to opt in/out of a specific feature.

#
sidecarInjectorWebhook:
enabled: true
rewriteAppHTTPProbe: false
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.

Lots of comments please.

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.

Once again - after reverting please add comments explaining what it does. Nobody can understand - rewrite how, when to set, why, etc. Don't assume all users are familiar with the your implementation details and goals.

injectCmd.PersistentFlags().BoolVar(&enableCoreDump, "coreDump",
true, "Enable/Disable core dumps in injected Envoy sidecar (--coreDump=true affects "+
"all pods in a node and should only be used the cluster admin)")
injectCmd.PersistentFlags().BoolVar(&rewriteAppHTTPProbe, "rewriteAppProbe", false, "Whether injector "+
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.

If it's a flag - why do you need it on the config map ?

Copy link
Copy Markdown
Contributor

@mandarjog mandarjog left a comment

Choose a reason for hiding this comment

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

/lgtm

@istio-testing
Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: incfly, mandarjog, nmittler

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

@istio-testing istio-testing merged commit f265b86 into istio:release-1.1 Dec 13, 2018
@incfly incfly deleted the health-flag branch December 13, 2018 19:50
@tiswanso
Copy link
Copy Markdown
Contributor

This PR is causing e2e-simple to fail when run with auto-sidecar injection. Seems like the new helm chart param sidecarInjectorWebhook.rewriteAppHTTPProbe should default to true (maybe only when auth is enabled?).

The istio-cni release-1.1 nightly is failing due to it.

Copy link
Copy Markdown
Contributor

@costinm costinm left a comment

Choose a reason for hiding this comment

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

Please revert - it seems to break stuff, the 'rewriteAppHTTPProbe is in different places ( under confg in istio-remote, under template in istio/templates.

{
name: "one-container",
sidecar: &SidecarInjectionSpec{
RewriteAppHTTPProbe: 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.

This doesn't make any sense - why would this be part of the spec, next to containers ?

Copy link
Copy Markdown
Contributor

@costinm costinm left a comment

Choose a reason for hiding this comment

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

As I mentioned in other PRs, having a global setting without a way to gradually rollout and test is extremely dangerous and should be avoided. We should certainly not set global options unless a feature
is extensively tested ( including by production users with real workloads, like @Stono )

Please add an annotation, so users can turn on for testing and off if they run into troubles for specific workloads.

@nmittler
Copy link
Copy Markdown
Contributor

@incfly can you address the concerns above from @costinm?

@incfly
Copy link
Copy Markdown
Author

incfly commented Dec 18, 2018

  • I'll first take a look at the breakage first. rewriteAppHTTPProbe is default to false to retain the current behavior. Not sure where it introduce the delta.
  • It is possible to gradually rolled out. You don't turn on rewriteAppProbe and istio kube-inject has additional flag to control on per deployment base.
  • I do remember to add an e2e test for this. Look at some issues, go test -v ./tests/integration2/examples/pilot does not work #10524. Right now the helm flag is off everywhere.

@tiswanso
Copy link
Copy Markdown
Contributor

To add info on what I've seen with this change... I think this has introduced a delta (at least for e2e-simple) for the e2e test framework run with sidecar injection enabled v. the default with istioctl kube-inject. I don't see how the e2e-simple would pass without the rewriteAppHTTPProbe=true so, I'm suspecting that the e2e test is running with it set for the istioctl kube-inject case. IMO, that delta in behavior is really bad and should be fixed by either changing the default for the flag or by having the makefile set it all the time for the e2e tests.

@incfly
Copy link
Copy Markdown
Author

incfly commented Dec 18, 2018

I filed bug #10557. Let's move AI(s) over there.

@tiswanso
Copy link
Copy Markdown
Contributor

tiswanso commented Dec 18, 2018

@incfly -- I think pilot/pkg/kube/inject/app_probe.go L51-53 is what changed the default behavior--at least compared to master. I'm not familiar with what was happening for the liveness probes prior to the existence of app_probe.go.

@costinm
Copy link
Copy Markdown
Contributor

costinm commented Dec 18, 2018

kube-inject is not an option - many users use automatic sidecar injector, and it is what we recommend.

Please use a pod annotation - so users can opt in and out per pod, like we do with many other features ( including mixer, policy, etc). There is not use case for having this as (only) a global setting.

incfly pushed a commit to incfly/istio that referenced this pull request Dec 19, 2018
@incfly incfly mentioned this pull request Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants