-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
App container unable to connect to network before sidecar is fully running #11130
Comments
@esnible pls feel free to add things I missed. cc @GregHanson |
Currently I tell people to put the following into their .yaml:
It would be better if networking was ready when the app container started. A novel approach would be to slow down the app container until networking was available. A hook could set the CPU for containers other than the sidecar to use Another idea is to have the init container include pilot-agent and fetch /etc/istio |
This may be a duplicate of #9454 |
This may be a duplicate of #4341 |
Hey, we here at Monzo have open sourced our solution to this sequencing problem: |
Removing myself because I am not a sidecar networking guru. That is what we need for this item. |
Long term fix is #11366 or maybe kubernetes/kubernetes#65502 |
As we have |
Consider config postStart for app container to check envoy status. such as: |
I think this makes sense.
|
esnible's solution worked for us for a long period. Unfortunately the issue starts to occur again, and even worse.
Could anyone shed light on this? |
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
It's been a year that this issue (or related issues) have been opened. It would be nice not to have the deployments know that they need to wait for the mesh' sidecar to be ready. That link should not exist and waiting for the sidecar is becoming a best practice and its a known common problem that leads to weak UX and onboarding of new users. |
@howardjohn that's interesting - you probably mean postStart as per https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks Looking at the repository I found those lines: istio/operator/cmd/mesh/testdata/manifest-generate/output/sidecar_template.golden.yaml Line 369 in 0faf513
It doesn't make any sense for me - I used preStop and holdApplicationUntilProxyStarts and ended up with preStop hook only. I understand though that both holdApplicationUntilProxyStarts and .Values.global.proxy.lifecycle.postStart can't be use the same time. |
i am trying to do some setup by connecting to external service from init-container but i am unable connect to external service in ISTIO strict mode. in above document it says there are 3 ways we can do it i want to know whether those 3 ways actually work to resolve the issue? |
Istio sidecar is killing the Postgress DB event listener connection frequently. We have used mentioned above workaround, |
Another workaround is to run the init container as uid 1337
|
There really is no interim fix for this right? I tried setting |
Kubernetes is getting proper sidecar support soon. Istio will be able to leverage this new feature to run the sidecar before any init container runs, which will enable network connectivity for init containers (through istio-proxy). |
Can you give me some link about this "Kubernetes is getting proper sidecar support soon" .. I want to read more about it.. |
There is some work on this in upstream istio already around this new Kubernetes feature:
Related K8S links: |
If you want to eliminate sidecars - check ambient mesh: |
@LukaszRacon is right. However, ambient was included in istio 1.18 but it is still considered alpha feature status and isn't recommended for production use yet. If you can afford to wait, ambient is definitely the way to go. Granted the Sidecar KEP isn't implemented in istio yet either and I don't know the timeline of when it will land |
This is available via feature flag in #45959 |
closing this due to #45959 |
I just want to highlight something that I got confused by: THERE IS NO WAY TO USE THE ISTIO MESH IN This is because the Note, setting |
there is - |
Describe the feature request
We had users who spend very long time to debug why their app container stops working initially when sidecar is used in istio. They have found out the app container could not reach out to network for simple things like clone a file from GitHub before the envoy proxy is ready and running. It is hard to debug this because when they exec into the container after the deployment is running, everything works fine.
Describe alternatives you've considered
the current work group used by folks is to put a big sleep like 20 or 30 seconds in their app container to give enough time for envoy to start up.
This is fine once they discover the issue and understand how istio works better, but it can take days for them to discover the issue.
How can we make the experience better?
can we provide some startup hook so app container won't start till envoy sidecar is ready, if the app container starts very fast and requires network connectivity.
The text was updated successfully, but these errors were encountered: