Skip to content
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

TCP probe the user-container from the queue-proxy before marking the pod ready. #2915

Merged
merged 20 commits into from
Jan 17, 2019

Conversation

markusthoemmes
Copy link
Contributor

@markusthoemmes markusthoemmes commented Jan 15, 2019

As we cannot easily run the TCP probe from kubernetes to check the user-container is up because of Istio interfering, this adds a TCP probe that's run as part of the queue-proxy's readinessProbe. The queue-proxy will only report itself ready once the TCP probe to the user-container has succeeded.

This also externalizes the health state as kept in the queue-proxy to enable testability of that code.

Fixes #2912

Release Note

Hardened container startup and actually check the user-container for general availability.

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 15, 2019
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 15, 2019
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@markusthoemmes: 1 warning.

In response to this:

As we cannot easily run the TCP probe from kubernetes to check the user-container is up because of Istio interfering, this adds a TCP probe that's run as part of the queue-proxy's readinessProbe. The queue-proxy will only report itself ready once the TCP probe to the user-container has succeeded.

This also externalizes the health state as kept in the queue-proxy to enable testability of that code.

Fixes #2912

TODO:

  • Tests

Release Note

Hardened container startup and actually check the user-container for general availability.

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.

pkg/queue/health/health_state.go Outdated Show resolved Hide resolved
Copy link
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

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

Thanks!

cmd/queue/main.go Outdated Show resolved Hide resolved
cmd/queue/main.go Outdated Show resolved Hide resolved
cmd/queue/main.go Outdated Show resolved Hide resolved
cmd/queue/main.go Outdated Show resolved Hide resolved
pkg/queue/health/health_state.go Outdated Show resolved Hide resolved
pkg/queue/health/health_state.go Outdated Show resolved Hide resolved
pkg/queue/health/health_state.go Outdated Show resolved Hide resolved
@markusthoemmes markusthoemmes force-pushed the tcp-probe branch 3 times, most recently from 8f97764 to 5a80457 Compare January 16, 2019 13:47
@markusthoemmes markusthoemmes changed the title [WIP] TCP probe the user-container from the queue-proxy before marking the pod ready. TCP probe the user-container from the queue-proxy before marking the pod ready. Jan 16, 2019
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 16, 2019
@markusthoemmes
Copy link
Contributor Author

Finally the thing works!

/test pull-knative-serving-integration-tests

@markusthoemmes
Copy link
Contributor Author

/assign @tcnghia

cmd/queue/main.go Outdated Show resolved Hide resolved
pkg/queue/health/health_state.go Show resolved Hide resolved
pkg/queue/health/health_state_test.go Outdated Show resolved Hide resolved
@markusthoemmes
Copy link
Contributor Author

@vagababov thanks for your feedback, addressed all your comments I believe.

Copy link
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

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

Just nits. Thanks for bearing with me :-)

cmd/queue/main.go Outdated Show resolved Hide resolved
pkg/queue/health/probe_test.go Outdated Show resolved Hide resolved
@vagababov
Copy link
Contributor

/test pull-knative-serving-integration-tests

…pod as ready.

As we cannot easily run the TCP probe from kubernetes to check the user-container is up because of Istio interfering, this adds a TCP probe that's run as part of the queue-proxy's readinessProbe. The queue-proxy will only report itself ready once the TCP probe to the user-container has succeeded.

This also externalizes the health state as kept in the queue-proxy to enable testability of that code.
@knative-metrics-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/queue/health/health_state.go Do not exist 100.0%
pkg/queue/health/probe.go Do not exist 100.0%

@markusthoemmes
Copy link
Contributor Author

TestRunLatestService flake

/test pull-knative-serving-integration-tests

1 similar comment
@markusthoemmes
Copy link
Contributor Author

TestRunLatestService flake

/test pull-knative-serving-integration-tests

@tcnghia
Copy link
Contributor

tcnghia commented Jan 17, 2019

/lgtm
/approve
Thanks @markusthoemmes @vagababov

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 17, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markusthoemmes, tcnghia, vagababov

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 17, 2019
@knative-prow-robot knative-prow-robot merged commit 72b23f0 into knative:master Jan 17, 2019
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants