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

Allow to disable probe #1519

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Allow to disable probe #1519

merged 1 commit into from
Aug 3, 2023

Conversation

nak3
Copy link
Contributor

@nak3 nak3 commented Aug 3, 2023

Proposed Changes

Currently it is not possible to disable {readiness,liveness}Probes. It is a problem for kourier gateway.
(Kourier's proble uses admin interface so users cannot change the admin config (admin.address) for debug without disabling the probe. More specifically please find /tmp/envoy.admin in bootstrap.yaml and 300-gateway.yaml)

Hence this patch changes to disable probe when users explicitly set the empty overrideProbe.

For example, if they have the following setting:

  workloads:
  - livenessProbes:
    - container: kourier-gateway
    name: 3scale-kourier-gateway

then, drop livenessProbes from 3scale-kourier-gateway deployment.

Release Note

Disable probe when explicitly settting the empty overrideProbe.

@knative-prow knative-prow bot requested review from houshengbo and maximilien August 3, 2023 03:03
@knative-prow knative-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 3, 2023
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Patch coverage: 60.00% and project coverage change: -0.12% ⚠️

Comparison is base (7a1cfbf) 79.22% compared to head (ec55e75) 79.10%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1519      +/-   ##
==========================================
- Coverage   79.22%   79.10%   -0.12%     
==========================================
  Files          40       40              
  Lines        1800     1809       +9     
==========================================
+ Hits         1426     1431       +5     
- Misses        272      275       +3     
- Partials      102      103       +1     
Files Changed Coverage Δ
pkg/reconciler/common/workload_override.go 83.97% <60.00%> (-1.74%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nak3
Copy link
Contributor Author

nak3 commented Aug 3, 2023

/cc @houshengbo @skonto @ReToCode

@knative-prow knative-prow bot requested review from ReToCode and skonto August 3, 2023 03:17
@@ -183,6 +184,11 @@ func replaceProbes(override *base.WorkloadOverride, ps *corev1.PodTemplateSpec)
FailureThreshold: override.FailureThreshold,
TerminationGracePeriodSeconds: override.TerminationGracePeriodSeconds,
}
if *overrideProbe == (v1.Probe{}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if my logic got something wrong:
Line 179 overrideProbe := &v1.Probe{...}, *overrideProbe is for sure equal to (v1.Probe{}). so Line 192 will never reach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

L192 will still reachable.

  • The new logic happens only when users didn't specify any override probe. (=overrideProbe is empty.)
  • L192 will be reached when users specify some override probe && the target manifest does not have any probe. (=overrideProbe is not empty but the manifest's containers[i].ReadinessProbe is empty.)

@@ -204,6 +210,11 @@ func replaceProbes(override *base.WorkloadOverride, ps *corev1.PodTemplateSpec)
FailureThreshold: override.FailureThreshold,
TerminationGracePeriodSeconds: override.TerminationGracePeriodSeconds,
}
if *overrideProbe == (v1.Probe{}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The same to the above comment.

@houshengbo
Copy link
Contributor

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Aug 3, 2023
@knative-prow
Copy link

knative-prow bot commented Aug 3, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: houshengbo, nak3

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 knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 3, 2023
@knative-prow knative-prow bot merged commit f936e22 into knative:main Aug 3, 2023
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants