Coder Social home page Coder Social logo

Use of native SidecarContainers (init container with `restartPolicy: Always`) results in pod status getting stuck on `Init` about argo-rollouts HOT 3 OPEN

martynd avatar martynd commented on June 12, 2024 5
Use of native SidecarContainers (init container with `restartPolicy: Always`) results in pod status getting stuck on `Init`

from argo-rollouts.

Comments (3)

martynd avatar martynd commented on June 12, 2024 1

@phyzical Im not sure actually as the use cases we have get the restart always init containers added at pod creation via mutation webhooks (istio and gcsfuse csi)

It may be possible to manually edit the live rollout object to have the correct restart policy (similar to other cases where argo doesnt want to change things due to managed fields) but I suspect you will get a validation error there too

I recall from [https://github.com//issues/3130](this bug) that the deployment part of the rollout spec is validated against the k8s libraries deployment validation which would be fine since its a valid 1.28+ spec deployment spec except that rollouts is built against the 1.26 k8s apis

That said, it looks like the 1.7 branch is built against 1.29 as of this commit 2dc71e3 which should at least get it to validate

from argo-rollouts.

phyzical avatar phyzical commented on June 12, 2024

We will also need to add logic to allow the spec to support redinessProbe and startupProbe for initContainers with the restartPolicy set to Always

 spec.template.spec.initContainers[1].readinessProbe: Forbidden: may not be set for init containers

side question,

@martynd are you able to confirm that the rollout spec works with restartPolicy when i try to add this i find that the live manifest never adds its but i do see it in the desired manifest?

from argo-rollouts.

phyzical avatar phyzical commented on June 12, 2024

I gave "release-1.7" tag a go, didn't help sadl.

turns out i missed part of the error from before its actually is invalid: spec.template.spec.initContainers[1].readinessProbe: Forbidden: may not be set for init containers without restartPolicy=Always

So i wondered if the restart policy for normal containers propagated, and it turns out it doesnt for that either.

that makes me think this is by design and couuuld explain the side effects your experiencing ? @martynd

Ill have another sniff at the source to see if theres any comments as to why it does this

edit: hmmm but i see this ref

"title": "RestartPolicy defines the restart behavior of individual containers in a pod.\nThis field may only be set for init containers, and the only allowed value is \"Always\".\nFor non-init containers or when this field is not specified,\nthe restart behavior is defined by the Pod's restart policy and the container type.\nSetting the RestartPolicy as \"Always\" for the init container will have the following effect:\nthis init container will be continually restarted on\nexit until all regular containers have terminated. Once all regular\ncontainers have completed, all init containers with restartPolicy \"Always\"\nwill be shut down. This lifecycle differs from normal init containers and\nis often referred to as a \"sidecar\" container. Although this init\ncontainer still starts in the init container sequence, it does not wait\nfor the container to complete before proceeding to the next init\ncontainer. Instead, the next init container starts immediately after this\ninit container is started, or after any startupProbe has successfully\ncompleted.\n+featureGate=SidecarContainers\n+optional"

Ah actually, the helm's crds still havn't been updated so pining the containing to 1.7 doesn't help the crd side ofc

After manually applying the updated crd all works as expected thanks 🦆

from argo-rollouts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.