PodPreset

为特定namespace的所有pod预设环境(环境变量,挂载目录...)

例如:

kind: PodPreset
apiVersion: settings.k8s.io/v1alpha1
metadata:
 name: default-zoneinfo
 namespace: default
spec:
 selector:
   matchLabels:
     role: frontend
 env:
   - name: TZ
     value: Asia/Shanghai
 volumeMounts:
   - mountPath: /etc/localtime
     name: zoneinfo
 volumes:
   - name: zoneinfo
     hostPath:
       path: /usr/share/zoneinfo/Asia/Shanghai

配置/etc/kubectl/manifests/kube-apiserver.yaml,支持podpreset

---enable-admission-plugins=NodeRestriction,PodPreset
---service-node-port-range=1-65535
---runtime-config=http://settings.k8s.io/v1alpha1=true
参考文档

你可能感兴趣的:(PodPreset)