Skip to content

How to Enable Pod Presets

Article Number: 000020125

Environment

RKE

Situation

Task

This how-to article outlines how to enable pod presets on your cluster. This is done by enabling the PodPreset admission plugin and the settings.k8s.io/v1alpha1 API for the kube-apiserver.

Pre-requisites

  • Kubernetes version 1.10 and above
  • Access to edit the cluster in yaml or the cluster.yaml file you used with RKE.

Resolution

Get to the cluster yaml in Rancher by editing the cluster and selecting "edit as yaml" or opening the RKE cluster.yml file. Modify the kube-api section to resemble the following and hit save or runup:

services:
  kube-api:
    extra_args:
      runtime-config: authorization.k8s.io/v1beta1=true,settings.k8s.io/v1alpha1=true
      enable-admission-plugins: PodPreset,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota,NodeRestriction,Priority,TaintNodesByCondition,PersistentVolumeClaimResize

Notice that settings.k8s.io/v1alpha1/podpreset and PodPreset are added to the runtime-config and admission plugins.

Further reading

More details can be found in the kubernetes docs on pod presets.