-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Linkerd Init Container Can Run Before Other Injected Init Containers #4758
Comments
By default, the Linkerd
It seems to work for me:
Can you check your |
hi @atkinson137 can you provide detail about how the linkerd proxy was injected into your container? Did you use the I tested this by adding the Can you confirm that the |
@cpretzer I can confirm the init container is successful without the
@ihcsim I do not see any errors in the init container:
|
In today's testing, I was not able to reproduce the issue with my
|
@atkinson137 Thanks for clarifying. So, yeah, this looks to be contention over which initContainer is injected last by its respective webhook. Long-term, we think this will be resolved with the Kubernetes Sidecar Resource. In the short term, you might be able to use the Let me know if this helps. |
@cpretzer The containers all start properly when applying This is an ok fix for me as we are not using 443 for our applications at the moment and Vault is served over HTTPS. |
I just experienced the same thing with checking a database is ready before spinning up the container... It caused Skaffold deploy to fail: template:
metadata:
annotations:
linkerd.io/inject: enabled
labels:
app: go-app-user-auth-service
spec:
initContainers:
- name: check-db-ready
image: gushcloud/postgresql-client:latest
command: ['sh', '-c', 'until pg_isready -h timescaledb-service -p 5432; do echo waiting for database; sleep 2; done;'] |
@saul-gush I think what's happening is Take
If this works as I am expecting, |
@saul-gush Never mind the previous comment. The behavior I was trying to get is already the default behavior of init containers: Each init container must complete successfully before the next one starts |
Bug Report
What is the issue?
Init containers cannot access network resources because the proxy has not started yet.
How can it be reproduced?
Create a pod with an init container with a simple command, such as
wget google.com
Example:
The pod will never initialize as the init containers cannot complete successfully without network availability. I've tried using both the Linkerd Init Container and the CNI, neither allow init containers to make network requests.
Logs, error output, etc
Here is the log from the wget
The connection is instantly refused because there is no network route through the proxy, as the proxy container has yet to start.
linkerd check
outputEnvironment
Possible solution
I am not familiar enough with the Linkerd codebase to propose a solution.
Additional context
I have only been able to find #1760 that references anything similar to my issue. Perhaps I am simply missing some configuration as I cannot believe so many run Linkerd without having init containers that require a network resource.
The text was updated successfully, but these errors were encountered: