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

proxy-init container doesn't set runAsNonRoot: false #697

Closed
dhduvall opened this issue Jan 12, 2023 · 0 comments · Fixed by #698
Closed

proxy-init container doesn't set runAsNonRoot: false #697

dhduvall opened this issue Jan 12, 2023 · 0 comments · Fixed by #698
Labels
bug Something isn't working

Comments

@dhduvall
Copy link
Contributor

Describe the bug
When a pod has a securityContext, all its containers inherit that and have the option of overriding each setting in that map. If this podSecurityContext includes runAsNonRoot: true, then the proxy-initcontainer fails to run, because it requires running as root. The webhook does set runAsUser: 0, so I assume this is an oversight rather than a deliberate choice.

Steps To Reproduce
Create a pod configured to use workload identity and the annotation azure.workload.identity/inject-proxy-sidecar: "true", and include a spec.securityContext that includes runAsNonRoot: true. I ran into this installing the Hashicorp Vault Helm chart. Vault doesn't support MSAL yet, so it requires the proxy to use WI.

Expected behavior
The proxy-init initContainer starts and executes correctly.

Logs
Scrolled off-screen, I'm afraid; the events in the output of kubectl describe pod are where the complaint can easily be found.

Environment

  • Kubernetes version (use kubectl version): server=1.23.12
  • Cloud provider or hardware configuration: Azure AKS

Additional context
I have a fix which works for me. I'll submit it as a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant