提交 5285b18f 编写于 作者: G Gao Hongtao

Add PodTemplate

Signed-off-by: NGao Hongtao <hanahmily@gmail.com>
上级 8d7d8f7a
......@@ -32,22 +32,9 @@ type OAPServerSpec struct {
Instances int `json:"instances,imitempty"`
// Config holds the OAP server configuration.
Config map[string]string `json:"config,omitempty"`
// NodeSelector is a selector which must be true for the pod to fit on a node.
// Selector which must match a node's labels for the pod to be scheduled on that node.
// More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
// +kubebuilder:validation:Optional
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// If specified, affinity will define the pod's scheduling constraints
// +kubebuilder:validation:Optional
Affinity *corev1.Affinity `json:"affinity,omitempty"`
// Tolerations allows specifying a list of tolerations for controlling which
// set of Nodes a Pod can be scheduled on
// +kubebuilder:validation:Optional
Tolerations *[]corev1.Toleration `json:"tolerations,omitempty"`
// Resources holds ResourceRequirements for the OAP server containers
// PodTemplate provides customisation options (labels, annotations, affinity rules, resource requests, and so on) for the Pods belonging to this OAP server.
// +kubebuilder:validation:Optional
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
PodTemplate corev1.PodTemplateSpec `json:"podTemplate,omitempty"`
}
// OAPServerPhase is the phase OAP server is in from the controller point of view.
......
......@@ -22,7 +22,6 @@
package v1alpha1
import (
"k8s.io/api/core/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
......@@ -95,34 +94,7 @@ func (in *OAPServerSpec) DeepCopyInto(out *OAPServerSpec) {
(*out)[key] = val
}
}
if in.NodeSelector != nil {
in, out := &in.NodeSelector, &out.NodeSelector
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.Affinity != nil {
in, out := &in.Affinity, &out.Affinity
*out = new(v1.Affinity)
(*in).DeepCopyInto(*out)
}
if in.Tolerations != nil {
in, out := &in.Tolerations, &out.Tolerations
*out = new([]v1.Toleration)
if **in != nil {
in, out := *in, *out
*out = make([]v1.Toleration, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
if in.Resources != nil {
in, out := &in.Resources, &out.Resources
*out = new(v1.ResourceRequirements)
(*in).DeepCopyInto(*out)
}
in.PodTemplate.DeepCopyInto(&out.PodTemplate)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OAPServerSpec.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册