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 exec into ingress-nginx-controll pod, when any type of sidecar is injected into the controller pod #9703

Merged
merged 1 commit into from
May 1, 2023

Conversation

JacobHenner
Copy link
Contributor

What this PR does / why we need it:

Add support for --container flag, which sets an explicit container name for exec operations. Defaults to controller.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • CVE Report (Scanner found CVE and adding report)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation only

Which issue/s this PR fixes

Fixes #4361
Fixes #4362
Fixes #9702

How Has This Been Tested?

Tested relevant commands against existing installation of the latest ingress-nginx, supplying valid and invalid --container {container} options, and omitting the flag entirely.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added unit and/or e2e tests to cover my changes.
  • All new and existing tests passed.
  • Added Release Notes.

Does my pull request need a release note?

Any user-visible or operator-visible change qualifies for a release note. This could be a:

  • CLI change
  • API change
  • UI change
  • configuration schema change
  • behavioral change
  • change in non-functional attributes such as efficiency or availability, availability of a new platform
  • a warning about a deprecation
  • fix of a previous Known Issue
  • fix of a vulnerability (CVE)

No release notes are required for changes to the following:

  • Tests
  • Build infrastructure
  • Fixes for unreleased bugs

For more tips on writing good release notes, check out the Release Notes Handbook

Added support for the --container flag in the kubectl plugin, which can be supplied to override the default controller container name for commands that invoke `kubectl exec`. (@jacobhenner)

Add support for --container flag, which sets an explicit container name
for exec operations. Defaults to `controller`.

Signed-off-by: Jacob Henner <[email protected]>
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 7, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot
Copy link
Contributor

Welcome @JacobHenner!

It looks like this is your first PR to kubernetes/ingress-nginx 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/ingress-nginx has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Mar 7, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @JacobHenner. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/docs labels Mar 7, 2023
@k8s-ci-robot k8s-ci-robot requested review from rikatz and strongjz March 7, 2023 04:15
@longwuyuan
Copy link
Contributor

@JacobHenner it will be a very useful & generally helpful discussion, if this really is a generic problem. And if triaged to be a problem and changes are made to make exec work in controller pod with sidecars, it could help a lot with debugging.

On the flip side though, the very fact that the ingress-nginx-controller pod is not like a frontend or a backend application pod, brings in several other considerations. Someone needs to elaborate & describe the small tiny details, with regard to the possibility of any and every possible sidecar that can be injected, including a service-mesh sidecar, and its implications on securing + hardening the controller (and maybe even mitigating perceivable problems).

The project itself is in a stabilization phase where features are not being worked on, until the project achieves the stabilization goals. Then the situation is complicated by lack of resources and the increased attention to CVEs & other security/performance related priorities. The PR history has some of that story. Then we have a almost ready implementation of OpenTelemetry for traces and the prometheus support is available since a while.

That was FYI. Please wait for other comments. Hence this is not so much as a bug, currently. When a developer engages on this and triaging is complete, more info may come out of this discussion.

/remove-kind bug
/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 7, 2023
@k8s-ci-robot
Copy link
Contributor

@longwuyuan: Those labels are not set on the issue: kind/bug

In response to this:

@JacobHenner it will be a very useful & generally helpful discussion, if this really is a generic problem. And if triaged to be a problem and changes are made to make exec work in controller pod with sidecars, it could help a lot with debugging.

On the flip side though, the very fact that the ingress-nginx-controller pod is not like a frontend or a backend application pod, brings in several other considerations. Someone needs to elaborate & describe the small tiny details, with regard to the possibility of any and every possible sidecar that can be injected, including a service-mesh sidecar, and its implications on securing + hardening the controller (and maybe even mitigating perceivable problems).

The project itself is in a stabilization phase where features are not being worked on, until the project achieves the stabilization goals. Then the situation is complicated by lack of resources and the increased attention to CVEs & other security/performance related priorities. The PR history has some of that story. Then we have a almost ready implementation of OpenTelemetry for traces and the prometheus support is available since a while.

That was FYI. Please wait for other comments. Hence this is not so much as a bug, currently. When a developer engages on this and triaging is complete, more info may come out of this discussion.

/remove-kind bug
/kind feature

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.

@k8s-ci-robot k8s-ci-robot removed the needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Mar 7, 2023
@longwuyuan
Copy link
Contributor

/retitle allow exec into pod when any sidecar is injected into pod

@k8s-ci-robot k8s-ci-robot changed the title Add support for --container flag allow exec into pod when any sidecar is injected into pod Mar 7, 2023
@longwuyuan
Copy link
Contributor

/retitle allow exec into ingress-nginx-controll pod, when any type of sidecar is injected into the controller pod

@k8s-ci-robot k8s-ci-robot changed the title allow exec into pod when any sidecar is injected into pod allow exec into ingress-nginx-controll pod, when any type of sidecar is injected into the controller pod Mar 7, 2023
Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

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

Just a quickly review, looks good

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 10, 2023
@github-actions
Copy link

This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach #ingress-nginx-dev on Kubernetes Slack.

@github-actions github-actions bot added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Apr 26, 2023
@k8s-triage-robot
Copy link

The lifecycle/frozen label can not be applied to PRs.

This bot removes lifecycle/frozen from PRs because:

  • Commenting /lifecycle frozen on a PR has not worked since March 2021
  • PRs that remain open for >150 days are unlikely to be easily rebased

You can:

  • Rebase this PR and attempt to get it merged
  • Close this PR with /close

Please send feedback to sig-contributor-experience at kubernetes/community.

/remove-lifecycle frozen

@k8s-ci-robot k8s-ci-robot removed the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Apr 26, 2023
@rikatz
Copy link
Contributor

rikatz commented May 1, 2023

We can also use on a probably followup https://kubernetes.io/docs/reference/labels-annotations-taints/#kubectl-kubernetes-io-default-container and make the defaulting to our container more generic.

@longwuyuan maybe you want to change it on helm charts :)

/lgtm
/approve
Thanks

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 1, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JacobHenner, rikatz

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 1, 2023
@rikatz
Copy link
Contributor

rikatz commented May 1, 2023

/lifecycle active

@k8s-ci-robot k8s-ci-robot added the lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. label May 1, 2023
@k8s-ci-robot k8s-ci-robot merged commit ae989d7 into kubernetes:main May 1, 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. area/docs cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. lifecycle/active Indicates that an issue or PR is actively being worked on by a contributor. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
6 participants