Automatic sidecar injection doesn't work

Hello,

I’m currently using your tool and this brings an added value to my architecture. I tested the manual injection which works very well. I can use it in a script or via a deployment script which directly includes the sidecar installation inside the self service. But to be honest, I would like to use the automatic sidecar injection with the webhook that I find very elegant.
However, after a few days of testing and troubleshooting, I don’t find the solution. I tested it on OKD3.11 on centos and minishift, I have the same result, the sidecar is not injected …
I summarized all the tests that I made based on your documentation on a github post https://github.com/istio/istio/issues/11808. I also reviewed all the blog posts written about the topic. I arrive at the point that I’m going into circle… Could you please help me ? just give some clues to unblock the situation ?
Thanks in advance,
Olivier

Hi, @opotmans

I haven’t tried the auto-injection recently but AFAIK, minishift doesn’t have webhooks enabled by default. Most, likely, all validations mentioned in Istio docs will pass because the platform supports it, but they are just not enabled.

Looks like minishift has an addon to enable webhooks. See: https://github.com/minishift/minishift/pull/3044#issue-235672581

May be you can try using the addon and check if it fixes your issue.

Hello Edgar,
Thanks for the question.
I installed and activated the istio addon on minishift. I also checked the configuration file via the command oc get mutatingwebhookconfiguration istio-sidecar-injector -o yaml | grep “namespaceSelector:” -A5
namespaceSelector was empty so I adapted the file like this
namespaceSelector:
matchLabels:
istio-injection: enabled
and I observed that the match by activating the logs in the sidecar injection container… (please see the github below which shows all the tests and validations I made.
Thanks for your support
Olivier

Hi Opatmans,

The minishift addon is based on Maistra, which is a version of Istio that’s customized to work with the builders and other functionality in OpenShift. In order to use the auto injection in Maistra, you need to use an annotation instead: sidecar.istio.io/inject: “true”

@opotmans The version in Minishift is out of date. We’re working on updating that. Can you try istiooc (https://github.com/Maistra/origin/releases) in the meantime? That’s a version of oc cluster up that we developed with Istio included.

Docs can be found here: https://maistra.io/docs/install/