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

question: how to ignore init container in multi pod deployment #470

Open
nwsparks opened this issue May 23, 2022 · 4 comments
Open

question: how to ignore init container in multi pod deployment #470

nwsparks opened this issue May 23, 2022 · 4 comments

Comments

@nwsparks
Copy link

I'm not seeing a way to set annotations for a specific pod in a deployment.

I have a deployment that has to run an init container as root to deal with setting privileges in an EFS mount so that the app containers can run as non root. I'd like to be able to set ignore's for this pod only. Is that possible?

@kmarteaux
Copy link
Contributor

kmarteaux commented Jun 1, 2022

I do not think it is possible to do with an annotation. Init containers support all the fields and features of app containers, including resource limits, volumes, and security settings. It would be sensible to set the security context for the init container to ensure its elevated privilege is limited to accomplishing the EFS mount.

@nwsparks
Copy link
Author

nwsparks commented Jun 3, 2022

The problem is that in this scenario there is no alternative other than running it as root when it comes to EFS. There's a github issue open about it here kubernetes/examples#260

So there is no way I can see to stop kube-conform from alarming on it.

@kmarteaux
Copy link
Contributor

At present kube-score container checks apply to both init and standard containers. It would be possible to differentiate against the two and permit an annotation such as -- "kube-score/ignore: init-container", but I will defer to @zegl judgement on the matter. @zegl - if you think it is sensible to permit the disabling of container checks against init-containers, I will implement it.

@nwsparks
Copy link
Author

nwsparks commented Aug 8, 2022

I think that sounds like a reasonable implementation. an alternative that could provide more flexibility might be ignoring based on container name.

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

2 participants