istio: Sidecar injection not working with 1.0.3
Describe the bug Sidecar injection does not work with 1.0.3 when the pods have labels with ‘/’ inside name (for exemple, “app.kubernetes.io/name” or “app.kubernetes.io/version”). The error is :
Error creating: Pod "default-apigateway-5756bb6557-64csm" is invalid: [spec.containers[2].env[7].name: Invalid value: "ISTIO_META_app.kubernetes.io/instance": a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*'), spec.containers[2].env[8].name: Invalid value: "ISTIO_META_app.kubernetes.io/name": a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*'), spec.containers[2].env[9].name: Invalid value: "ISTIO_META_app.kubernetes.io/version": a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1', regex used for validation is '[-._a-zA-Z][-._a-zA-Z0-9]*')]
Note that this error appears after moving from istio 1.0.2 to istio 1.0.3.
Steps to reproduce the bug Deploy a pod with standard label (see https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/)
Version
$ istioctl version
Version: 1.0.3
GitRevision: a44d4c8bcb427db16ca4a439adfbd8d9361b8ed3
User: root@0ead81bba27d
Hub: docker.io/istio
GolangVersion: go1.10.4
BuildStatus: Clean
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.0", GitCommit:"0ed33881dc4355495f623c6f22e7dd0b7632b7c0", GitTreeState:"clean", BuildDate:"2018-09-27T17:05:32Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.9", GitCommit:"57729ea3d9a1b75f3fc7bbbadc597ba707d47c8a", GitTreeState:"clean", BuildDate:"2018-06-29T01:07:01Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Installation Istio has been deployed with helm
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 7
- Comments: 19 (7 by maintainers)
Commits related to this issue
- Patch sidecar issue with 1.0.3 Ref: https://github.com/istio/istio/issues/9605 — committed to locationlabs/istio by ChamaraG 6 years ago
There are no workarounds for StatefulSet due to the
statefulset.kubernetes.io/pod-name
added by the StatefulSet controller.https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-name-label
Thanks for the docs, I never used those characters in labels, but they are clearly used 😃
I meant the workaround is to edit the
istio-sidecar-injector
config map inistio-system
as specified in https://github.com/istio/istio/pull/9634/files.That PR has merged now.
@sdake using “/” in labels is the kubernetes official recommended labels, see https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
if 1.0.3 is DOA (is it doa?) we should cut 1.0.4 asap.
Cheers -steve