I have a config map that defines some variables like environment that are then passed into alot of deployment configurations like this
- name: ENV
valueFrom:
configMapKeyRef:
name: my-config-map
key: ENV
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.
You can use a PodPreset object to inject information like secrets, volume mounts, and environment variables etc into pods at creation time.
Before starting using PodPreset you need to take few steps:
settings.k8s.io/v1alpha1/podpreset
, which can be done by including settings.k8s.io/v1alpha1=true
in the --runtime-config
option for the API server--enable-admission-plugins
option value specified for the API serverkubectl apply -f preset.yaml
Please refer to official documentation to see how it works.