<p>Well, my question is really short and hopefully simple? Is it possible to add a <code>cacerts</code> file automatically in every pod in a specific Kubernetes cluster?</p>
<p>According to <a href="https://paraspatidar.medium.com/add-self-signed-or-ca-root-certificate-in-kubernetes-pod-ca-root-certificate-store-cb7863cb3f87" rel="nofollow noreferrer">this article</a> it's possible by creating a ConfigMap and add this to the path <code>/etc/ssl/certs/</code>. But is it possible to achieve this on a higher level so that all pods in a Kubernetes cluster have this <code>cacerts</code> file?</p>

Lucas Scheepers
<p>You can add a MutatingAdmissionWebhook for a pod, which adds the folder by default as a volume to each pod. Check out the docs about <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/#mutatingadmissionwebhook" rel="nofollow noreferrer">MutatingAdmissionWebhooks</a> and <a href="https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#write-an-admission-webhook-server" rel="nofollow noreferrer">writing an admission webhook</a>.</p>
<p>This way you add a &quot;service&quot;, which mutates the pod config before the scheduler handles it. Check out <a href="https://trstringer.com/kubernetes-mutating-webhook/" rel="nofollow noreferrer">this</a> for a quick example.</p>
