Skip to content

Sidecar Containers  #753

Closed
Closed

Description

@Joseph-Irving

Enhancement Description

/sig node

Please keep this description up to date. This will help the Enhancement Team to track the evolution of the enhancement efficiently.

Activity

  1. added
    kind/featureCategorizes issue or PR as related to a new feature.
    sig/appsCategorizes an issue or PR as relevant to SIG Apps.
    sig/nodeCategorizes an issue or PR as relevant to SIG Node.
    on Jan 29, 2019
  2. Joseph-Irving commented on Jan 29, 2019

    @Joseph-Irving
    ContributorAuthor

    @enisoc @dchen1107 @fejta @thockin @kow3ns @derekwaynecarr, opened this tracking issue so that we can discuss.

  3. assigned and unassigned on Jan 29, 2019
  4. kow3ns commented on Jan 31, 2019

    @kow3ns
    Member

    /assign

  5. Joseph-Irving commented on Feb 1, 2019

    @Joseph-Irving
    ContributorAuthor

    @derekwaynecarr I've done some scoping out of the kubelet changes required for next week's sig-node meeting, I believe that changes are only needed in the kuberuntime package, specifically kuberuntime_manager.go in and kuberuntime_container.go.

    In kuberuntime_manager.go you could modify computePodActions to implement the shutdown triggering (kill sidecars when all non-sidecars have permanently exited), and starting up the sidecars first.

    In kuberuntime_container.go you could modify killContainersWithSyncResult for terminating the sidecars last and sending the preStop hooks (the preStop hooks bit was a bit debatable, it wasn't settled whether that should be done or not. @thockin had a good point about why you might not want to encourage that behaviour, see comment).

    Let me know if you want me to investigate any further.

  6. resouer commented on Feb 1, 2019

    @resouer

    @kow3ns The discussion makes more sense to me if maybe we can define a full description of containers sequence in Pod spec (sig-app), and how to handle the sequence in kubelet for start, restart and cascading consideration (sig-node). Let's catch the Feb 5 sig-node meeting to give more inputs.

    cc @Joseph-Irving

  7. luksa commented on Feb 7, 2019

    @luksa

    The proposal says that sidecars only run after the init containers run. But what if the use-case requires the sidecar to run while/before the init containers run. For example, if you'd like route the pod's traffic through a proxy running as a sidecar (as in Istio), you probably want that proxy to be in place while the init containers run in case the init container itself does network calls.

  8. Joseph-Irving commented on Feb 14, 2019

    @Joseph-Irving
    ContributorAuthor

    @luksa I think there's the possibility of looking at having sidecars that run in init phase at some point but currently the proposal is not going to cover that use case. There is currently no way to have concurrent containers running in the init phase so that would be potentially a much larger/messier change than what is being suggested here.

  9. Joseph-Irving commented on Feb 14, 2019

    @Joseph-Irving
    ContributorAuthor

    Update on this KEP:
    I've spoken to both @derekwaynecarr and @dchen1107 from sig-node about this and they did not express any major concerns about the proposal. I will raise a PR to the KEP adding some initial notes around implementation details and clarifying a few points that came up during the discussion.

    We still need to agree on the API, it seems there is consensus that a simple way of marking containers as sidecars is prefered over more in depth ordering flags. Having a bool is somewhat limiting though so perhaps something more along the lines of containerLifecycle: Sidecar would be preferable so that we have the option of expanding in the future.

  10. luksa commented on Feb 14, 2019

    @luksa

    @Joseph-Irving Actually, neither the boolean nor the containerLifecycle: Sidecar are appropriate for proper future extensibility. Instead, containerLifecycle should be an object, just like deployment.spec.strategy, with type: Sidecar. This would allow us to then introduce additional fields. For the "sidecar for the whole lifetime of the pod" solution, it would be expressed along these lines:

    containerLifecycle: 
      type: Sidecar
      sidecar:
        scope: CompletePodLifetime
    

    as opposed to

    containerLifecycle: 
      type: Sidecar
      sidecar:
        scope: AfterInit
    

    Please forgive my bad naming - I hope the names convey the idea.

    But there is one problem with the approach where we introduce containerLifecycle to pod.spec.containers. Namely, it's wrong to have sidecars that run parallel to init containers specified under pod.spec.containers. So if you really want to be able to extend this to init containers eventually, you should find an alternative solution - one that would allow you to mark containers as sidecars at a higher level - i.e. not under pod.spec.containers or pod.spec.initContainers, but something like pod.spec.sidecarContainers, which I believe you already discussed, but dismissed. The init containers problem definitely calls for a solution along these lines.

  11. Joseph-Irving commented on Feb 14, 2019

    @Joseph-Irving
    ContributorAuthor

    @luksa You could also solve the init problem by just allowing an init container to be marked as a sidecar and have that run alongside the init containers. As I understand it, the problem is that init containers sometimes need sidecars, which is different from needing a container that runs for the entire lifetime of the pod.

    The problem with pod.spec.sidecarContainers is that it's a far more complex change, tooling would need to updated and the kubelet would require a lot of modifying to support another set of containers. The current proposal is far more modest, it's only building on what's already there.

  12. 324 remaining items

  13. dipesh-rawat commented on Mar 18, 2025

    @dipesh-rawat
    Member

    Hi @SergeyKanzhelev @Joseph-Irving 👋, v1.33 Enhancements team here,

    I see this KEP is tracked for code freeze with the required PR for stable graduation merged. I noticed there are some concerns/discussions around the graduation of this KEP (refer #753 (comment) and kubernetes/kubernetes#127701) . With code freeze deadline later this week, could we please confirm if this KEP is still planned for stable graduation and targeting this v1.33 release cycle, so the release team can ensure accurate status tracking?

    Thanks!

  14. moved this from Tracked for code freeze to At Risk for Docs Freeze in 1.33 Enhancements Trackingon Apr 3, 2025
  15. moved this from At Risk for Docs Freeze to Tracked for Docs Freeze in 1.33 Enhancements Trackingon Apr 7, 2025
  16. moved this from Implemented to Done in SIG Node 1.33 KEPs planningon May 13, 2025
  17. jenshu commented on May 16, 2025

    @jenshu
    Contributor

    Hi @SergeyKanzhelev 👋, 1.34 Enhancements Lead here,

    Given that this KEP has graduated to stable and the status in kep.yaml has been updated to implemented, I will close the issue.

    /remove-label lead-opted-in
    /remove-label tracked/yes
    /close

  18. removed
    lead-opted-inDenotes that an issue has been opted in to a release
    tracked/yesDenotes an enhancement issue is actively being tracked by the Release Team
    on May 16, 2025
  19. k8s-ci-robot commented on May 16, 2025

    @k8s-ci-robot
    Contributor

    @jenshu: Closing this issue.

    Details

    In response to this:

    Hi @SergeyKanzhelev 👋, 1.34 Enhancements Lead here,

    Given that this KEP has graduated to stable and the status in kep.yaml has been updated to implemented, I will close the issue.

    /remove-label lead-opted-in
    /remove-label tracked/yes
    /close

    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-sigs/prow repository.

  20. moved this from Backlog to Closed in SIG Appson May 16, 2025
  21. added a commit that references this issue on Dec 19, 2025
  22. added a commit that references this issue on Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

kind/api-changeCategorizes issue or PR as related to adding, removing, or otherwise changing an APIkind/featureCategorizes issue or PR as related to a new feature.sig/appsCategorizes an issue or PR as relevant to SIG Apps.sig/nodeCategorizes an issue or PR as relevant to SIG Node.stage/stableDenotes an issue tracking an enhancement targeted for Stable/GA status

Type

No type

Projects

  • Status
    Closed

Relationships

None yet

Development

No branches or pull requests

Issue actions

⌂ 换网址