You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2020/02/27 04:48:48 UTC

[skywalking-swck] 05/06: Add PodTemplate

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-swck.git

commit 5285b18fe03ed36c6ee4f4210c5643310200be3a
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Wed Feb 26 13:37:40 2020 +0800

    Add PodTemplate
    
    Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
 api/v1alpha1/oapserver_types.go       | 17 ++---------------
 api/v1alpha1/zz_generated.deepcopy.go | 30 +-----------------------------
 2 files changed, 3 insertions(+), 44 deletions(-)

diff --git a/api/v1alpha1/oapserver_types.go b/api/v1alpha1/oapserver_types.go
index 6773111..513ace2 100644
--- a/api/v1alpha1/oapserver_types.go
+++ b/api/v1alpha1/oapserver_types.go
@@ -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.
diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go
index 80f4197..fb755c9 100644
--- a/api/v1alpha1/zz_generated.deepcopy.go
+++ b/api/v1alpha1/zz_generated.deepcopy.go
@@ -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.