<p>I have a config map that defines some variables like environment that are then passed into alot of deployment configurations like this</p>

<pre><code>- name: ENV
      valueFrom:
        configMapKeyRef:
          name: my-config-map
          key: ENV
</code></pre>

<p>secrets and some volumes like ssl certs are common across the configs also.  Is there some kubernetes type that I could create a base service deployment that extends a normal deployment? Or some other way to deal with this? Also using kustomize, there might be an option there.</p>

<p>You can use a PodPreset object to inject information like secrets, volume mounts, and environment variables etc into pods at creation time.</p>

<p>Before starting using PodPreset you need to take few steps:</p>

<ul>
<li>Firstly need to enable API type <code>settings.k8s.io/v1alpha1/podpreset</code>, which can be done by including <code>settings.k8s.io/v1alpha1=true</code> in the <code>--runtime-config</code> option for the API server</li>
<li>Enable the admission controller PodPreset. You can do it by including PodPreset in the <code>--enable-admission-plugins</code> option value specified for the API server</li>
<li>After that you need to creatie PodPreset objects in the namespace you will work in and create it by typing <code>kubectl apply -f preset.yaml</code></li>
</ul>

<p>Please refer to <a href="https://kubernetes.io/docs/concepts/workloads/pods/podpreset/" rel="nofollow noreferrer">official documentation</a> to see how it works.</p>
