Repository navigation
Expand file tree
/
Copy pathpoddefault_types.go
More file actions
125 lines (95 loc) · 4.41 KB
/
Copy pathpoddefault_types.go
File metadata and controls
125 lines (95 loc) · 4.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// PodDefaultSpec defines the desired state of PodDefault
type PodDefaultSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
// Selector is a label query over a set of resources, in this case pods.
// Required.
Selector metav1.LabelSelector `json:"selector"`
// Human readable description of poddefault
// todo: not sure if Spec is the right place for this (move to meta..)
// Can be used by UI to show users avaialble options for poddefaults.
// +optional
Desc string `json:"desc,omitempty"`
// InitContainers defines the initContainers to attach to the pod.
// +optional
InitContainers []v1.Container `json:"initContainers,omitempty"`
// Sidecars defines the containers to attach to the pod.
// +optional
Sidecars []v1.Container `json:"sidecars,omitempty"`
// ServiceAccountName defines the service account to attach to the pod.
// +optional
ServiceAccountName string `json:"serviceAccountName,omitempty"`
// AutomountServiceAccountToken defines whether or not the service account access token should automatically be mounted to the pod.
// +optional
AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"`
// Env defines the collection of EnvVar to inject into containers.
// +optional
Env []v1.EnvVar `json:"env,omitempty"`
// EnvFrom defines the collection of EnvFromSource to inject into containers.
// +optional
EnvFrom []v1.EnvFromSource `json:"envFrom,omitempty"`
// Volumes defines the collection of Volume to inject into the pod.
// +optional
Volumes []v1.Volume `json:"volumes,omitempty"`
// VolumeMounts defines the collection of VolumeMount to inject into containers.
// +optional
VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
// Annotations defines the annotations to inject into the pod.
Annotations map[string]string `json:"annotations,omitempty"`
// Labels defines the labels to inject into the pod.
Labels map[string]string `json:"labels,omitempty"`
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
// Entrypoint array.
Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"`
// Arguments to the entrypoint.
Args []string `json:"args,omitempty" protobuf:"bytes,4,rep,name=args"`
// ImagePullSecrets defines the collection of ImagePullSecrets to inject into the Pod.
ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}
// PodDefaultStatus defines the observed state of PodDefault
type PodDefaultStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodDefault is the Schema for the poddefaults API
// +k8s:openapi-gen=true
// +kubebuilder:resource:path=poddefaults
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;watch;list;update
// +kubebuilder:rbac:groups=,resources=events,verbs=create;patch;update
// +kubebuilder:informers:group=apps,version=v1,kind=Deployment
type PodDefault struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PodDefaultSpec `json:"spec,omitempty"`
Status PodDefaultStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PodDefaultList contains a list of PodDefault
type PodDefaultList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []PodDefault `json:"items"`
}
func init() {
SchemeBuilder.Register(&PodDefault{}, &PodDefaultList{})
}