Skip to content
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

Istio 1.0.3 version, sidecar can't be injected in statefulset #9982

Closed
FirstDiscoverer opened this issue Nov 15, 2018 · 8 comments
Closed

Istio 1.0.3 version, sidecar can't be injected in statefulset #9982

FirstDiscoverer opened this issue Nov 15, 2018 · 8 comments
Assignees

Comments

@FirstDiscoverer
Copy link

Describe the bug

When I use the isti 1.0.3 version, deploying with deploy is normal, using statefulset deployment fails, the following exception occurs

create Pod nginx-0 in StatefulSet nginx failed error: Pod "nginx-0" is invalid: spec.containers[1].env[8].name: Invalid value: "ISTIO_META_statefulset.kubernetes.io/pod-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]*')

Version
k8s

Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:08:19Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

istio

1.0.3
@mabushey
Copy link

I believe this change in istio.yaml will fix that specific problem:

-        [[ if .ObjectMeta.Labels ]]
-        - name: ISTIO_METAJSON_LABELS
-          value: |
-                 [[ toJson .ObjectMeta.Labels ]]
+        [[ range $k,$v := .ObjectMeta.Labels ]]
+        - name: ISTIO_META_[[ $k ]]
+          value: "[[ $v ]]"

However the containers will still not internally route to each other in 1.0.3, at least when they are all in a custom namespace.

@FaKod
Copy link

FaKod commented Nov 16, 2018

Same here for Prometheus Operator

creating a Pod fails because Pod has the annotation:

statefulset.kubernetes.io/pod-name: "prometheus-kube-prometheus-0"

Obviously ISTIO_META_statefulset.kubernetes.io/pod-name is not a valid ENV name.

So, what can I do with (defined in ConfigMap istio-sidecar-injector and merged with #9208):

    [[ range $k,$v := .ObjectMeta.Labels ]]
    - name: ISTIO_META_[[ $k ]]
      value: "[[ $v ]]"
    [[ end ]]

to add a check or to create a valid ENV name?

@douglas-reid
Copy link
Contributor

@mandarjog Can you provide comments here?

@FaKod
Copy link

FaKod commented Nov 23, 2018

should be fixed in 1.0.4 (see #9634)

@rafik8
Copy link

rafik8 commented Nov 27, 2018

upgrading to 1.0.4 and be able to have my MariaDB broken deployment (in 1.0.3) working.

@esnible
Copy link
Contributor

esnible commented Dec 17, 2018

This may be a duplicate of #9571

@stale
Copy link

stale bot commented Mar 17, 2019

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.

@stale stale bot added the stale label Mar 17, 2019
@stale
Copy link

stale bot commented Apr 16, 2019

This issue has been automatically closed because it has not had activity in the last month and a half. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

@stale stale bot closed this as completed Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants