-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Knative should not modify the istio-proxy container spec #15367
Comments
Hi @hamishforbes, makeContainer does the following:
Once you put a container in the Knative spec it is kind of expected to be managed by Knative and not all projects conform to that, so I view this is issue an enhancement request for the Istio integration. |
This issue is stale because it has been open for 90 days with no |
/remove-lifecycle stale |
Context
Istio provides 2 mechanisms for customising the spec of the
istio-proxy
sidecar container.Limited customisation is possible via annotations (.e.g
sidecar.istio.io/proxyCPU
)but you can also include a container named 'istio-proxy' with
image: 'auto'
in your pod spec.The istio injection webhook then merges this with the rest of the required config for the sidecar to work correctly.
So you end up with a pod spec that looks something like
The problem is that in knative-serving this container gets passed through makeContainer and the containerMask
Most of the time these modifications are pretty benign and don't cause any problems, a few superfluous env vars etc, no big deal.
However...
I am trying to enable the istio/kubernetes native sidecars functionality.
When this is active the istio injector mutating webhook adds a default lifecycle to the
istio-proxy
container.This is incompatible with the lifecycle added by knative. You end up with
httpGet
andexec
defined in the preStop and the cluster rejects the pod creationYou could argue that the Istio mutating webhook should remove the
httpGet
field to ensure the preStop is valid.But ideally knative shouldn't be interfering with this container spec either.
I've tested a quick fix in one of our dev clusters by adding this to the
BuildUserContainers
functionwhich works fine but there might be a better solution you would like to implement.
What version of Knative?
1.13.0
Expected Behavior
istio-proxy
container should be untouchedActual Behavior
Knative modifies the istio-proxy container spec resulting in an invalid pod spec preventing pods from being launched
Steps to Reproduce the Problem
Install istio and knative.
Enable native sidecars by setting
values.pilot.env.ENABLE_NATIVE_SIDECARS=true
in Helm.Any knative services will fail to create pods
The text was updated successfully, but these errors were encountered: