2 Copyright 2017 The Kubernetes Authors.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
21 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
25 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
27 // PodPreset is a policy resource that defines additional runtime
28 // requirements for a Pod.
29 type PodPreset struct {
30 metav1.TypeMeta `json:",inline"`
32 metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
35 Spec PodPresetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
38 // PodPresetSpec is a description of a pod preset.
39 type PodPresetSpec struct {
40 // Selector is a label query over a set of resources, in this case pods.
42 Selector metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,1,opt,name=selector"`
44 // Env defines the collection of EnvVar to inject into containers.
46 Env []v1.EnvVar `json:"env,omitempty" protobuf:"bytes,2,rep,name=env"`
47 // EnvFrom defines the collection of EnvFromSource to inject into containers.
49 EnvFrom []v1.EnvFromSource `json:"envFrom,omitempty" protobuf:"bytes,3,rep,name=envFrom"`
50 // Volumes defines the collection of Volume to inject into the pod.
52 Volumes []v1.Volume `json:"volumes,omitempty" protobuf:"bytes,4,rep,name=volumes"`
53 // VolumeMounts defines the collection of VolumeMount to inject into containers.
55 VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty" protobuf:"bytes,5,rep,name=volumeMounts"`
58 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
60 // PodPresetList is a list of PodPreset objects.
61 type PodPresetList struct {
62 metav1.TypeMeta `json:",inline"`
63 // Standard list metadata.
64 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
66 metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
68 // Items is a list of schema objects.
69 Items []PodPreset `json:"items" protobuf:"bytes,2,rep,name=items"`