The life of a Kubernetes pod can get a lot easier with PodPreset – a stellar utility that enables the injection of additional information such as environment variables and storage volumes into Pods with specified labels. This means that you no longer need to set up repetitive information for each Pod in your templates!
Even better – you can prevent them from being tampered with the PodPreset by adding the annotation podpreset.admission.kubernetes.io/exclude: "true" to your Pods.
Aligning API Versions
Kubernetes Version
API Version
Default Status
v1.6+
settings.k8s.io/v1alpha1
No
Activating PodPreset
Activate API with kube-apiserver --runtime-config=settings.k8s.io/v1alpha1=true
Enable admission control with --enable-admission-plugins=..,PodPreset
Diving into PodPreset Examples
Suppose you're using a PodPreset to add environment variables and storage volumes: