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

serviceaccount in sidecar not inject into pod with another serviceaccount #56

Open
like-inspur opened this issue Feb 1, 2021 · 0 comments

Comments

@like-inspur
Copy link
Contributor

like-inspur commented Feb 1, 2021

What's going on?

config serviceaccount in sidecar want to inject into a pod with another serviceaccount

Expected Behavior

sidecar serviceaccount should inject successfullly in pod sidecar container
But pod container still mount old serviceaccount, serviceaccount in sidecar not inject into pod

Reproducer

sidecar config add seviceaccount

apiVersion: v1
data:
  sidecar-telegraf-elasticsearch: |
    name: sidecar-telegraf-elasticsearch
    containers:
    - name: telegraf
      image: registry-jinan-lab.inspurcloud.cn/library/common/telegraf:1.9.1-14
      imagePullPolicy: IfNotPresent
      ports:
      - containerPort: 9126
        name: prometheus
      volumeMounts:
      - name: telegraf
        mountPath: /etc/telegraf
    serviceAccountName: lma-sidecar
    volumes:
    - name: telegraf
      configMap:
        name: telegraf-elasticsearch

sidecar inject pod but not with lma-sidecar serviceaccount but with elasticsearch serviceaccount

  - image: registry-jinan-lab.inspurcloud.cn/library/common/telegraf:1.9.1-14
    imagePullPolicy: IfNotPresent
    name: telegraf
    ports:
    - containerPort: 9126
      name: prometheus
      protocol: TCP
    resources: {}
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /etc/telegraf
      name: telegraf
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: elasticsearch-token-m5bs9
      readOnly: true

Version Deets

  • Kubernetes Version: v1.20.1
  • k8s-sidecar-injector Version: 0.5.0
@like-inspur like-inspur changed the title sidecar serviceaccount inject failed in pod serviceaccount of sidecar inject failed in pod with another serviceaccount Feb 2, 2021
@like-inspur like-inspur changed the title serviceaccount of sidecar inject failed in pod with another serviceaccount serviceaccount in sidecar not inject into pod with another serviceaccount Feb 2, 2021
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

1 participant