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

[kong] remove default controller binary arg and add debug no-probe setting for controller #481

Merged
merged 3 commits into from
Oct 29, 2021

Conversation

rainest
Copy link
Contributor

@rainest rainest commented Oct 28, 2021

What this PR does / why we need it:

Two changes to allow running the controller via Delve without local chart modifications:

  1. Remove the hard-coded /kong-ingress-controller arg from the controller. It's currently wrong and should never have been necessary due to our images' entrypoints.
  2. Add a hidden .ingressController.disableProbes value to disable readiness and liveness probes entirely. Debugger pauses break the probes and force a restart, and they can't be configured away because Helm will always add in the default HTTP probe unless you set your own HTTP probe (and no HTTP probes work, since they're all paused). While enabling this does allow you to use a debugger, it also causes all hell to break loose because the controller becomes ready immediately, even if it fails to start and exits. It usually fails to start because Kong takes a bit to come online. Don't know of any way around that other than manually killing PID 1 to restart the container (we have no admin API retry config), so it's quite janky and really should not be exposed to users.

Special notes for your reviewer:

AFAIK we no longer test anything with CLI args since the chart uses envvars for everything. They do work as expected, however (testing on 2.0):

14:46:31-0700 esenin $ helm upgrade trk /tmp/symkong --set ingressController.args={"--help"}          
Release "trk" has been upgraded. Happy Helming!
...

14:47:23-0700 esenin $ kubectl logs trk-kong-5b6bfbc98f-4dbtd -c ingress-controller | head
Usage:
   [flags]

Flags:
      --admission-webhook-cert string                 admission server PEM certificate value
      --admission-webhook-cert-file string            admission server PEM certificate file path; if both this and the cert value is unset, defaults to /admission-webhook/tls.crt
...

I'm fairly sure no older versions would actually require this arg given the entrypoint, but worst case you can add it back via user-configured args.

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • PR is based off the current tip of the next branch and targets next, not main
  • New or modified sections of values.yaml are documented in the README.md
  • Title of the PR and commit headers start with chart name (e.g. [kong])

Remove the hard-coded /kong-ingress-controller arg from the controller
container arguments.

This argument is no longer correct as of 2.0, where the binary is
instead /manager. It is apparently ignored. Removing it does not
interfere with normal start or configured arguments

This argument appears unnecessary for older versions of the controller.
We've had /kong-ingress-controller or /manager as our entrypoint since
we created the Dockerfile, so it's always invoked anyway.

Removing this arg allows for alternative images that do not use the
contorller binary and whose binary /is/ confused by the extra argument
(namely Delve-based images).
@rainest rainest requested a review from a team as a code owner October 28, 2021 21:58
Add a .ingressController.disableProbes value. When set to any value, the
controller container will not have readiness or liveness probes.

This setting is intentionally omitted from values.yaml and
documentation. It is for use only with debuggers and should not be used
under normal circumstances.
@rainest rainest changed the title [kong] remove default controller binary arg [kong] remove default controller binary arg and add debug no-probe setting for controller Oct 28, 2021
Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

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

Typo and then LGTM 👍

charts/kong/templates/_helpers.tpl Outdated Show resolved Hide resolved
Co-authored-by: Shane Utt <shaneutt@linux.com>
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.

None yet

2 participants