Answers: <p>Answering my own question here. Eventually, I went with <a href="https://openkruise.io/" rel="nofollow noreferrer">OpenKruise</a>, which is a pretty simple but cool open-source framework for, amongst other things, creating a centralised way of managing sidecars and init-containers in a cluster, without needing to concern application developers.</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-01-14T11:11:23.800Z
Answers: 2022-01-14T11:11:23.800Z
Answers: Software Engineer
Answers: <p>Tumblr and Salesforce have open sourced their generic injectors:</p>
  <ul>
  <li><a href="https://github.com/tumblr/k8s-sidecar-injector" rel="nofollow noreferrer">https://github.com/tumblr/k8s-sidecar-injector</a></li>
  <li><a href="https://github.com/salesforce/generic-sidecar-injector" rel="nofollow noreferrer">https://github.com/salesforce/generic-sidecar-injector</a></li>
  </ul>
  <p>Both of these should fit your simple use case but offer a lot more.</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-12-09T11:48:53.100Z
Answers: Thanks, I'll check them out
Answers: Software Engineer
Answers: CC BY-SA 4.0
Answers: 2021-12-08T11:21:14.323Z
Answers: 2021-12-08T11:21:14.323Z
Answers: vaizki
Body: <p>I want to inject an init container into some pods. I know how to specify init containers in a pod's spec, but I don't want to do that directly because these sidecars are invisible to my engineers.</p>
  <p>I don't want to go through the complexity of developing my own mutating web hook or operator, so does anyone know of a good package/service that can help?</p>
  
Tags: <kubernetes>
Title: K8S Init Container CRD/Operator
UserDisplayName: Software Engineer
ThreadText: # K8S Init Container CRD/Operator
  
  (Asked by: username_0 on 2021-12-08)
  
  I want to inject an init container into some pods. I know how to specify init containers in a pod's spec, but I don't want to do that directly because these sidecars are invisible to my engineers.
  
  I don't want to go through the complexity of developing my own mutating web hook or operator, so does anyone know of a good package/service that can help?
  
  **Tags:** kubernetes
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2022-01-14. Score: 0 | Accepted answer
  
  Answering my own question here. Eventually, I went with [OpenKruise](https://openkruise.io/), which is a pretty simple but cool open-source framework for, amongst other things, creating a centralised way of managing sidecars and init-containers in a cluster, without needing to concern application developers.
  
  
  ---
  
  ### Answer by username_1 on 2021-12-08. Score: 2
  
  Tumblr and Salesforce have open sourced their generic injectors:
  
  * <https://github.com/tumblr/k8s-sidecar-injector>
  * <https://github.com/salesforce/generic-sidecar-injector>
  
  Both of these should fit your simple use case but offer a lot more.
  
  > **Comments:**
  > **username_0**: Thanks, I'll check them out  
  
  ---
  
  