diff --git a/Makefile b/Makefile index a440726..0c69004 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,6 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust mv helm-charts/doris-operator/crds/doris.selectdb.com_dorisclusters.yaml helm-charts/doris-operator/crds/doris.apache.com_dorisclusters.yaml cat config/crd/bases/doris.selectdb.com_dorisclusters.yaml > config/crd/bases/crds.yaml cat config/crd/bases/disaggregated.cluster.doris.com_dorisdisaggregatedclusters.yaml >> config/crd/bases/crds.yaml - #cat config/crd/bases/disaggregated.metaservice.doris.com_dorisdisaggregatedmetaservices.yaml >> config/crd/bases/crds.yaml .PHONY: generate @@ -202,7 +201,6 @@ gen-tool: ## Download gen-crd-api-reference-docs locally if necessary. gen-api: gen-tool $(GEN_DOCS) -api-dir "./api/doris/v1" -config "./hack/gen-api/config.json" -template-dir "./hack/gen-api/template" -out-file "doc/api.md" $(GEN_DOCS) -api-dir "./api/disaggregated/v1" -config "./hack/gen-api/config.json" -template-dir "./hack/gen-api/template" -out-file "doc/disaggregated_api.md" - #$(GEN_DOCS) -api-dir "./api/disaggregated/metaservice/meta_v1" -config "./hack/gen-api/config.json" -template-dir "./hack/gen-api/template" -out-file "doc/disaggregated_metaservice_api.md" .PHONY: envtest envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. diff --git a/api/disaggregated/meta_v1/disaggregatedmetaservice_types.go b/api/disaggregated/meta_v1/disaggregatedmetaservice_types.go deleted file mode 100644 index 4f79403..0000000 --- a/api/disaggregated/meta_v1/disaggregatedmetaservice_types.go +++ /dev/null @@ -1,300 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 meta_v1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="FdbStatus",type=string,JSONPath=`.status.fdbStatus.availableStatus` -// +kubebuilder:printcolumn:name="MSStatus",type=string,JSONPath=`.status.msStatus.phase` -// +kubebuilder:printcolumn:name="RecyclerStatus",type=string,JSONPath=`.status.recyclerStatus.phase` -// +kubebuilder:storageversion -// +kubebuilder:resource:shortName=ddm -// DorisDisaggregatedMetaService is the Schema for the DorisDisaggregatedMetaServices API -type DorisDisaggregatedMetaService struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec DorisDisaggregatedMetaServiceSpec `json:"spec,omitempty"` - Status DorisDisaggregatedMetaServiceStatus `json:"status,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// DorisDisaggregatedMetaServiceList contains a list of DorisDisaggregatedMetaService -type DorisDisaggregatedMetaServiceList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DorisDisaggregatedMetaService `json:"items"` -} - -// describe the meta specification of disaggregated cluster -type DorisDisaggregatedMetaServiceSpec struct { - //describe the fdb spec, most configurations are already build-in. - FDB *FoundationDB `json:"fdb,omitempty"` - //the specification of metaservice, metaservice is the component of doris disaggregated cluster. - MS *MetaService `json:"ms,omitempty"` - //the specification of recycler, recycler is the component of doris disaggregated cluster. - Recycler *Recycler `json:"recycler,omitempty"` -} - -type FoundationDB struct { - //Image is the fdb docker image to deploy. please reference the apache doris repository to find. - //usually no need config, operator will use default image. - Image string `json:"image,omitempty"` - - //SidecarImage is the fdb sidecar image to deploy. pelease reference the apache doris repository to find. - SidecarImage string `json:"sidecarImage,omitempty"` - - // ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. - // If specified, these secrets will be passed to individual puller implementations for them to use. - // More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` - - //defines the specification of resource cpu and mem. ep: {"requests":{"cpu": 4, "memory": "8Gi"},"limits":{"cpu":4,"memory":"8Gi"}} - // usually not need config, operator will set default {"requests": {"cpu": 4, "memory": "8Gi"}, "limits": {"cpu": 4, "memory": "8Gi"}} - corev1.ResourceRequirements `json:",inline"` - - // VolumeClaimTemplate allows customizing the persistent volume claim for the pod. - VolumeClaimTemplate *corev1.PersistentVolumeClaim `json:"volumeClaimTemplate,omitempty"` - - //Labels for organize and categorize objects - Labels map[string]string `json:"labels,omitempty"` - - //Annotations is an unstructured key value map stored with a resource that may be - // set by external tools to store and retrieve arbitrary metadata. - Annotations map[string]string `json:"annotations,omitempty"` - - // (Optional) If specified, the pod's nodeSelector,displayName="Map of nodeSelectors to match when scheduling pods on nodes" - // +optional - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - - //+optional - // Affinity is a group of affinity scheduling rules. - Affinity *corev1.Affinity `json:"affinity,omitempty"` - - // (Optional) Tolerations for scheduling pods onto some dedicated nodes - //+optional - Tolerations []corev1.Toleration `json:"tolerations,omitempty"` -} - -type BaseSpec struct { - //Image is the metaservice docker image to deploy. the image can pull from dockerhub selectdb repository. - Image string `json:"image,omitempty"` - - ServiceAccount string `json:"serviceAccount,omitempty"` - - // ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. - // If specified, these secrets will be passed to individual puller implementations for them to use. - // More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod - // +optional - // +patchMergeKey=name - // +patchStrategy=merge - ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"` - - //defines the specification of resource cpu and mem. ep: {"requests":{"cpu": 4, "memory": "8Gi"},"limits":{"cpu":4,"memory":"8Gi"}} - corev1.ResourceRequirements `json:",inline"` - - //Annotations is an unstructured key value map stored with a resource that may be - // set by external tools to store and retrieve arbitrary metadata. - Annotations map[string]string `json:"annotations,omitempty"` - - //+optional - // export metaservice for accessing from outside k8s. - Service *ExportService `json:"service,omitempty"` - - //+optional - // Affinity is a group of affinity scheduling rules. - Affinity *corev1.Affinity `json:"affinity,omitempty"` - - // (Optional) Tolerations for scheduling pods onto some dedicated nodes - //+optional - Tolerations []corev1.Toleration `json:"tolerations,omitempty"` - - // ConfigMaps describe all configmaps that need to be mounted. - ConfigMaps []ConfigMap `json:"configMaps,omitempty"` - - // (Optional) If specified, the pod's nodeSelector,displayName="Map of nodeSelectors to match when scheduling pods on nodes" - // +optional - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - - //+optional - //EnvVars is a slice of environment variables that are added to the pods, the default is empty. - EnvVars []corev1.EnvVar `json:"envVars,omitempty"` - - //+optional - // Labels for user selector or classify pods - Labels map[string]string `json:"labels,omitempty"` - - // HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts - // file if specified. This is only valid for non-hostNetwork pods. - // +optional - HostAliases []corev1.HostAlias `json:"hostAliases,omitempty"` - - PersistentVolume *PersistentVolume `json:"persistentVolume,omitempty"` - - //Security context for pod. - //+optional - SecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"` - - //Security context for all containers running in the pod (unless they override it). - //+optional - ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"` -} - -type MetaService struct { - //the foundation spec for creating cn software services. - //BaseSpec `json:"baseSpec,omitempty"` - BaseSpec `json:",inline"` -} - -type Recycler struct { - //the foundation spec for creating cn software services. - //BaseSpec `json:"baseSpec,omitempty"` - BaseSpec `json:",inline"` -} - -// PersistentVolume defines volume information and container mount information. -type PersistentVolume struct { - // PersistentVolumeClaimSpec is a list of claim spec about storage that pods are required. - // +kubebuilder:validation:Optional - corev1.PersistentVolumeClaimSpec `json:"persistentVolumeClaimSpec,omitempty"` - - //Annotation for PVC pods. Users can adapt the storage authentication and pv binding of the cloud platform through configuration. - //It only takes effect in the first configuration and cannot be added or modified later. - Annotations map[string]string `json:"annotations,omitempty"` -} - -type ConfigMap struct { - //Name specify the configmap in deployed namespace that need to be mounted in pod. - Name string `json:"name,omitempty"` - - //MountPath specify the position of configmap be mounted. - MountPath string `json:"mountPath,omitempty"` -} - -type ExportService struct { - //type of service,the possible value for the service type are : ClusterIP, NodePort, LoadBalancer,ExternalName. - //More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types - // +optional - Type corev1.ServiceType `json:"type,omitempty"` - - //PortMaps specify node port for target port in pod, when the service type=NodePort. - PortMaps []PortMap `json:"portMaps,omitempty"` - - //Annotations for using function on different cloud platform. - Annotations map[string]string `json:"annotations,omitempty"` - - // Only applies to Service Type: LoadBalancer. - // This feature depends on whether the underlying cloud-provider supports specifying - // the loadBalancerIP when a load balancer is created. - // This field will be ignored if the cloud-provider does not support the feature. - // This field was under-specified and its meaning varies across implementations, - // and it cannot support dual-stack. - // As of Kubernetes v1.24, users are encouraged to use implementation-specific annotations when available. - // This field may be removed in a future API version. - // +optional - LoadBalancerIP string `json:"loadBalancerIP,omitempty"` -} - -// PortMap for ServiceType=NodePort situation. -type PortMap struct { - // The port on each node on which this service is exposed when type is - // NodePort or LoadBalancer. Usually assigned by the system. If a value is - // specified, in-range, and not in use it will be used, otherwise the - // operation will fail. If not specified, a port will be allocated if this - // Service requires one. If this field is specified when creating a - // Service which does not need it, creation will fail. This field will be - // wiped when updating a Service to no longer need it (e.g. changing type - // from NodePort to ClusterIP). - // More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport - // need in 30000-32767 - // +optional - NodePort int32 `json:"nodePort,omitempty"` - - // Number or name of the port to access on the pods targeted by the service. - // Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - // If this is a string, it will be looked up as a named port in the - // target Pod's container ports. If this is not specified, the value - // of the 'port' field is used (an identity map). - // This field is ignored for services with clusterIP=None, and should be - // omitted or set equal to the 'port' field. - // More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service - // +optional - TargetPort int32 `json:"targetPort,omitempty"` -} - -type DorisDisaggregatedMetaServiceStatus struct { - //describe the fdb status information: contains access address, fdb available or not, etc... - FDBStatus FDBStatus `json:"fdbStatus,omitempty"` - //describe the ms status. - MSStatus BaseStatus `json:"msStatus,omitempty"` - //descirbe the recycler status. - RecyclerStatus BaseStatus `json:"recyclerStatus,omitempty"` -} - -type FDBStatus struct { - //FDBAddress describe the address for fdbclient using. - FDBAddress string `json:"FDBAddress,omitempty"` - //FDBResourceName specify the name of the kind `FoundationDBCluster` resource. - FDBResourceName string `json:"fdbResourceName,omitempty"` - //AvailableStatus represents the fdb available or not. - AvailableStatus AvailableStatus `json:"availableStatus,omitempty"` -} - -type BaseStatus struct { - //Phase represent the stage of reconciling. - Phase MetaServicePhase `json:"phase,omitempty"` - - //AvailableStatus represents the metaservice available or not. - AvailableStatus AvailableStatus `json:"availableStatus,omitempty"` -} - -type AvailableStatus string - -const ( - //Available represents the service is available. - Available AvailableStatus = "Available" - - //UnAvailable represents the service not available for using. - UnAvailable AvailableStatus = "UnAvailable" -) - -type MetaServicePhase string - -const ( - //Ready represents the service is ready for accepting requests. - Ready MetaServicePhase = "Ready" - //Upgrading represents the spec of the service changed, service in smoothing upgrade. - Upgrading MetaServicePhase = "Upgrading" - //Failed represents service failed to start, can't be accessed. - Failed MetaServicePhase = "Failed" - //Creating represents service in creating stage. - Creating MetaServicePhase = "Creating" -) - -func init() { - SchemeBuilder.Register(&DorisDisaggregatedMetaService{}, &DorisDisaggregatedMetaServiceList{}) -} diff --git a/api/disaggregated/meta_v1/disaggregatedmetaservice_webhook.go b/api/disaggregated/meta_v1/disaggregatedmetaservice_webhook.go deleted file mode 100644 index 4513fb4..0000000 --- a/api/disaggregated/meta_v1/disaggregatedmetaservice_webhook.go +++ /dev/null @@ -1,69 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 meta_v1 - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/klog/v2" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -func (ddm *DorisDisaggregatedMetaService) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(ddm). - Complete() -} - -// +kubebuilder:unnamedwatches:path=/mutate-disaggregated-metaservice-doris-com-meta_v1-dorisdisaggregatedmetaservice,mutating=true,failurePolicy=ignore,sideEffects=None,groups=disaggregated.metaservice.doris.com,resources=dorisdisaggregatedmetaservices,verbs=create;update;delete,versions=meta_v1,name=mdorisdisaggregatedmetaservice.kb.io,admissionReviewVersions=meta_v1 -var _ webhook.Defaulter = &DorisDisaggregatedMetaService{} - -// Default implements webhook.Defaulter so a unnamedwatches will be registered for the type -func (ddm *DorisDisaggregatedMetaService) Default() { - klog.Infof("mutatingwebhook mutate metaservice name=%s.", ddm.Name) - // TODO(user): fill in your defaulting logic. -} - -// TODO(user): change verbs to "verbs=create;update;delete" if you want to enable deletion validation. -// +kubebuilder:unnamedwatches:path=/validate-disaggregated-metaservice-doris-com-meta_v1-dorisdisaggregatedmetaservice,mutating=false,failurePolicy=ignore,sideEffects=None,groups=disaggregated.metaservice.doris.com,resources=dorisdisaggregatedmetaservices,verbs=create;update,versions=meta_v1,name=vdorisdisaggregatedmetaservice.kb.io,admissionReviewVersions=meta_v1 -var _ webhook.Validator = &DorisDisaggregatedMetaService{} - -// ValidateCreate implements webhook.Validator so a unnamedwatches will be registered for the type -func (ddm *DorisDisaggregatedMetaService) ValidateCreate() error { - klog.Info("validate create", "name", ddm.Name) - - // TODO(user): fill in your validation logic upon object creation. - return nil -} - -// ValidateUpdate implements webhook.Validator so a unnamedwatches will be registered for the type -func (ddm *DorisDisaggregatedMetaService) ValidateUpdate(old runtime.Object) error { - klog.Info("validate update", "name", ddm.Name) - - // TODO(user): fill in your validation logic upon object update. - return nil -} - -// ValidateDelete implements webhook.Validator so a unnamedwatches will be registered for the type -func (ddm *DorisDisaggregatedMetaService) ValidateDelete() error { - klog.Info("validate delete", "name", ddm.Name) - - // TODO(user): fill in your validation logic upon object deletion. - return nil -} diff --git a/api/disaggregated/meta_v1/doc.go b/api/disaggregated/meta_v1/doc.go deleted file mode 100644 index 413ce04..0000000 --- a/api/disaggregated/meta_v1/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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. - -// +k8s:deepcopy-gen=package,register -// Package meta_v1 is the meta_v1 version of the API. -// +groupName=disaggregated.metaservice.doris.com -package meta_v1 diff --git a/api/disaggregated/meta_v1/groupversion_info.go b/api/disaggregated/meta_v1/groupversion_info.go deleted file mode 100644 index 0aca832..0000000 --- a/api/disaggregated/meta_v1/groupversion_info.go +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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. - -/* -Copyright 2023. - -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 meta_v1 contains API Schema definitions for the doris meta_v1 API group -// +kubebuilder:object:generate=true -// +groupName=disaggregated.metaservice.doris.com -package meta_v1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "disaggregated.metaservice.doris.com", Version: "meta_v1"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme -) diff --git a/api/disaggregated/meta_v1/type_util.go b/api/disaggregated/meta_v1/type_util.go deleted file mode 100644 index 1cc7f80..0000000 --- a/api/disaggregated/meta_v1/type_util.go +++ /dev/null @@ -1,147 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 meta_v1 - -import ( - "github.com/apache/doris-operator/pkg/common/utils/metadata" -) - -var ( - FDBNameSuffix = "-foundationdb" - NameLabelKey = "disaggregated.metaservice.doris.com/name" -) - -// the labels key -const ( - //ComponentsResourceHash the component hash - ComponentResourceHash string = "app.disaggregated.components/hash" - - // ComponentLabelKey is Kubernetes recommended label key, it represents the component within the architecture - ComponentLabelKey string = "app.kubernetes.io/component" - - DisaggregatedDorisMetaserviceLabelKey string = "doris.disaggregated.metaservice" - - //OwnerReference list ownerReferences this object - OwnerReference string = "app.disaggregated.ownerreference/name" - - ServiceRoleForCluster string = "app.disaggregated.service/role" -) - -type ServiceRole string - -const ( - Service_Role_Access ServiceRole = "access" -) - -type ComponentType string - -const ( - Component_FDB ComponentType = "fdb" - Component_MS ComponentType = "metaservice" - Component_RC ComponentType = "recycler" -) - -const ( - DefaultMetaserviceNumber int32 = 2 - DefaultRecyclerNumber int32 = 1 -) - -// build foundationdbCluster's label for classify pods. -func (dms *DorisDisaggregatedMetaService) GenerateFDBLabels() map[string]string { - if dms.Labels == nil { - return map[string]string{ - NameLabelKey: dms.Name, - } - } - - labels := make(map[string]string) - labels[NameLabelKey] = dms.Name - for k, v := range dms.Labels { - labels[k] = v - } - - return labels -} - -func (dms *DorisDisaggregatedMetaService) GenerateFDBClusterName() string { - return dms.Name + FDBNameSuffix -} - -func GenerateServiceLabels(dms *DorisDisaggregatedMetaService, componentType ComponentType) metadata.Labels { - labels := metadata.Labels{} - labels[OwnerReference] = dms.Name - labels[ComponentLabelKey] = string(componentType) - labels[ServiceRoleForCluster] = string(Service_Role_Access) - return labels -} - -func GenerateServiceSelector(dms *DorisDisaggregatedMetaService, componentType ComponentType) metadata.Labels { - return GenerateStatefulSetSelector(dms, componentType) -} - -func GenerateStatefulSetSelector(dms *DorisDisaggregatedMetaService, componentType ComponentType) metadata.Labels { - labels := metadata.Labels{} - labels[OwnerReference] = statefulSetName(dms, componentType) - labels[DisaggregatedDorisMetaserviceLabelKey] = dms.Name - labels[ComponentLabelKey] = string(componentType) - return labels -} - -func statefulSetName(dms *DorisDisaggregatedMetaService, componentType ComponentType) string { - return dms.Name + "-" + string(componentType) -} - -func GenerateStatefulSetLabels(dms *DorisDisaggregatedMetaService, componentType ComponentType) metadata.Labels { - labels := metadata.Labels{} - labels[OwnerReference] = dms.Name - labels[ComponentLabelKey] = string(componentType) - return labels -} - -func GenerateCommunicateServiceName(dms *DorisDisaggregatedMetaService, componentType ComponentType) string { - return dms.Name + "-" + string(componentType) + "-service" -} - -func GenerateComponentStatefulSetName(dms *DorisDisaggregatedMetaService, componentType ComponentType) string { - return statefulSetName(dms, componentType) -} - -func GetPodLabels(dms *DorisDisaggregatedMetaService, componentType ComponentType) metadata.Labels { - labels := GenerateStatefulSetSelector(dms, componentType) - labels.AddLabel(getDefaultLabels(dms)) - labels.AddLabel(dms.Spec.MS.Labels) - return labels -} - -func getDefaultLabels(dms *DorisDisaggregatedMetaService) metadata.Labels { - labels := metadata.Labels{} - labels[DisaggregatedDorisMetaserviceLabelKey] = dms.Name - return labels -} - -func GetFDBEndPoint(dms *DorisDisaggregatedMetaService) string { - return dms.Status.FDBStatus.FDBAddress -} - -func IsReconcilingStatusPhase(c MetaServicePhase) bool { - return c == Upgrading || c == Failed -} - -func (ddm *DorisDisaggregatedMetaService) GetMSServiceName() string { - return GenerateCommunicateServiceName(ddm, Component_MS) -} diff --git a/cmd/operator/main.go b/cmd/operator/main.go index cd93bb0..2893cb9 100644 --- a/cmd/operator/main.go +++ b/cmd/operator/main.go @@ -36,8 +36,6 @@ package main import ( "fmt" dv1 "github.com/apache/doris-operator/api/disaggregated/v1" - - //dmsv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" dorisv1 "github.com/apache/doris-operator/api/doris/v1" "github.com/apache/doris-operator/cmd/operator/conf" "github.com/apache/doris-operator/pkg/common/utils/certificate" diff --git a/config/crd/bases/crds.yaml b/config/crd/bases/crds.yaml index c5c9582..94772ae 100644 --- a/config/crd/bases/crds.yaml +++ b/config/crd/bases/crds.yaml @@ -1562,9 +1562,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. @@ -3363,9 +3363,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. @@ -5781,9 +5781,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. @@ -7582,9 +7582,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. @@ -9930,6 +9930,12 @@ spec: - uniqueId type: object type: array + enableDecommission: + description: |- + decommission be or not. default value is false. + if true, will decommission be node when scale down compute group. + if false, will drop be node when scale down compute group. + type: boolean feSpec: description: FeSpec describe the fe specification of doris disaggregated cluster. diff --git a/config/crd/bases/disaggregated.cluster.doris.com_dorisdisaggregatedclusters.yaml b/config/crd/bases/disaggregated.cluster.doris.com_dorisdisaggregatedclusters.yaml index 145f536..e60e930 100644 --- a/config/crd/bases/disaggregated.cluster.doris.com_dorisdisaggregatedclusters.yaml +++ b/config/crd/bases/disaggregated.cluster.doris.com_dorisdisaggregatedclusters.yaml @@ -1809,6 +1809,12 @@ spec: - uniqueId type: object type: array + enableDecommission: + description: |- + decommission be or not. default value is false. + if true, will decommission be node when scale down compute group. + if false, will drop be node when scale down compute group. + type: boolean feSpec: description: FeSpec describe the fe specification of doris disaggregated cluster. diff --git a/config/crd/bases/disaggregated.metaservice.doris.com_dorisdisaggregatedmetaservices.yaml b/config/crd/bases/disaggregated.metaservice.doris.com_dorisdisaggregatedmetaservices.yaml deleted file mode 100644 index 78bc700..0000000 --- a/config/crd/bases/disaggregated.metaservice.doris.com_dorisdisaggregatedmetaservices.yaml +++ /dev/null @@ -1,4749 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.16.4 - name: dorisdisaggregatedmetaservices.disaggregated.metaservice.doris.com -spec: - group: disaggregated.metaservice.doris.com - names: - kind: DorisDisaggregatedMetaService - listKind: DorisDisaggregatedMetaServiceList - plural: dorisdisaggregatedmetaservices - shortNames: - - ddm - singular: dorisdisaggregatedmetaservice - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .status.fdbStatus.availableStatus - name: FdbStatus - type: string - - jsonPath: .status.msStatus.phase - name: MSStatus - type: string - - jsonPath: .status.recyclerStatus.phase - name: RecyclerStatus - type: string - name: meta_v1 - schema: - openAPIV3Schema: - description: DorisDisaggregatedMetaService is the Schema for the DorisDisaggregatedMetaServices - API - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: describe the meta specification of disaggregated cluster - properties: - fdb: - description: describe the fdb spec, most configurations are already - build-in. - properties: - affinity: - description: Affinity is a group of affinity scheduling rules. - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for - the pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: |- - The scheduler will prefer to schedule pods to nodes that satisfy - the affinity expressions specified by this field, but it may choose - a node that violates one or more of the expressions. The node that is - most preferred is the one with the greatest sum of weights, i.e. - for each node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, etc.), - compute a sum by iterating through the elements of this field and adding - "weight" to the sum if the node matches the corresponding matchExpressions; the - node(s) with the highest sum are the most preferred. - items: - description: |- - An empty preferred scheduling term matches all objects with implicit weight 0 - (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - properties: - preference: - description: A node selector term, associated with - the corresponding weight. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - weight: - description: Weight associated with matching the - corresponding nodeSelectorTerm, in the range 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: |- - If the affinity requirements specified by this field are not met at - scheduling time, the pod will not be scheduled onto the node. - If the affinity requirements specified by this field cease to be met - at some point during pod execution (e.g. due to an update), the system - may or may not try to eventually evict the pod from its node. - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. - The terms are ORed. - items: - description: |- - A null or empty node selector term matches no objects. The requirements of - them are ANDed. - The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - type: array - required: - - nodeSelectorTerms - type: object - x-kubernetes-map-type: atomic - type: object - podAffinity: - description: Describes pod affinity scheduling rules (e.g. - co-locate this pod in the same node, zone, etc. as some - other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: |- - The scheduler will prefer to schedule pods to nodes that satisfy - the affinity expressions specified by this field, but it may choose - a node that violates one or more of the expressions. The node that is - most preferred is the one with the greatest sum of weights, i.e. - for each node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, etc.), - compute a sum by iterating through the elements of this field and adding - "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: |- - weight associated with matching the corresponding podAffinityTerm, - in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: |- - If the affinity requirements specified by this field are not met at - scheduling time, the pod will not be scheduled onto the node. - If the affinity requirements specified by this field cease to be met - at some point during pod execution (e.g. due to a pod label update), the - system may or may not try to eventually evict the pod from its node. - When there are multiple elements, the lists of nodes corresponding to each - podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: |- - Defines a set of pods (namely those matching the labelSelector - relative to the given namespace(s)) that this pod should be - co-located (affinity) or not co-located (anti-affinity) with, - where co-located is defined as running on a node whose value of - the label with key matches that of any node on which - a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules - (e.g. avoid putting this pod in the same node, zone, etc. - as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: |- - The scheduler will prefer to schedule pods to nodes that satisfy - the anti-affinity expressions specified by this field, but it may choose - a node that violates one or more of the expressions. The node that is - most preferred is the one with the greatest sum of weights, i.e. - for each node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling anti-affinity expressions, etc.), - compute a sum by iterating through the elements of this field and adding - "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: |- - weight associated with matching the corresponding podAffinityTerm, - in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: |- - If the anti-affinity requirements specified by this field are not met at - scheduling time, the pod will not be scheduled onto the node. - If the anti-affinity requirements specified by this field cease to be met - at some point during pod execution (e.g. due to a pod label update), the - system may or may not try to eventually evict the pod from its node. - When there are multiple elements, the lists of nodes corresponding to each - podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: |- - Defines a set of pods (namely those matching the labelSelector - relative to the given namespace(s)) that this pod should be - co-located (affinity) or not co-located (anti-affinity) with, - where co-located is defined as running on a node whose value of - the label with key matches that of any node on which - a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - annotations: - additionalProperties: - type: string - description: |- - Annotations is an unstructured key value map stored with a resource that may be - set by external tools to store and retrieve arbitrary metadata. - type: object - claims: - description: |- - Claims lists the names of resources, defined in spec.resourceClaims, - that are used by this container. - - This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. - - This field is immutable. It can only be set for containers. - items: - description: ResourceClaim references one entry in PodSpec.ResourceClaims. - properties: - name: - description: |- - Name must match the name of one entry in pod.spec.resourceClaims of - the Pod where this field is used. It makes that resource available - inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - image: - description: |- - Image is the fdb docker image to deploy. please reference the apache doris repository to find. - usually no need config, operator will use default image. - type: string - imagePullSecrets: - description: |- - ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. - If specified, these secrets will be passed to individual puller implementations for them to use. - More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod - items: - description: |- - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. - properties: - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - type: array - labels: - additionalProperties: - type: string - description: Labels for organize and categorize objects - type: object - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - nodeSelector: - additionalProperties: - type: string - description: (Optional) If specified, the pod's nodeSelector,displayName="Map - of nodeSelectors to match when scheduling pods on nodes" - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Requests describes the minimum amount of compute resources required. - If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - sidecarImage: - description: SidecarImage is the fdb sidecar image to deploy. - pelease reference the apache doris repository to find. - type: string - tolerations: - description: (Optional) Tolerations for scheduling pods onto some - dedicated nodes - items: - description: |- - The pod this Toleration is attached to tolerates any taint that matches - the triple using the matching operator . - properties: - effect: - description: |- - Effect indicates the taint effect to match. Empty means match all taint effects. - When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: |- - Key is the taint key that the toleration applies to. Empty means match all taint keys. - If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: |- - Operator represents a key's relationship to the value. - Valid operators are Exists and Equal. Defaults to Equal. - Exists is equivalent to wildcard for value, so that a pod can - tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: |- - TolerationSeconds represents the period of time the toleration (which must be - of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, - it is not set, which means tolerate the taint forever (do not evict). Zero and - negative values will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: |- - Value is the taint value the toleration matches to. - If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - type: object - type: array - volumeClaimTemplate: - description: VolumeClaimTemplate allows customizing the persistent - volume claim for the pod. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - description: |- - Standard object's metadata. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - properties: - annotations: - additionalProperties: - type: string - type: object - finalizers: - items: - type: string - type: array - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: |- - spec defines the desired characteristics of a volume requested by a pod author. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - properties: - accessModes: - description: |- - accessModes contains the desired access modes the volume should have. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 - items: - type: string - type: array - dataSource: - description: |- - dataSource field can be used to specify either: - * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) - If the provisioner or an external controller can support the specified data source, - it will create a new volume based on the contents of the specified data source. - When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. - If the namespace is specified, then dataSourceRef will not be copied to dataSource. - properties: - apiGroup: - description: |- - APIGroup is the group for the resource being referenced. - If APIGroup is not specified, the specified Kind must be in the core API group. - For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - dataSourceRef: - description: |- - dataSourceRef specifies the object from which to populate the volume with data, if a non-empty - volume is desired. This may be any object from a non-empty API group (non - core object) or a PersistentVolumeClaim object. - When this field is specified, volume binding will only succeed if the type of - the specified object matches some installed volume populator or dynamic - provisioner. - This field will replace the functionality of the dataSource field and as such - if both fields are non-empty, they must have the same value. For backwards - compatibility, when namespace isn't specified in dataSourceRef, - both fields (dataSource and dataSourceRef) will be set to the same - value automatically if one of them is empty and the other is non-empty. - When namespace is specified in dataSourceRef, - dataSource isn't set to the same value and must be empty. - There are three important differences between dataSource and dataSourceRef: - * While dataSource only allows two specific types of objects, dataSourceRef - allows any non-core object, as well as PersistentVolumeClaim objects. - * While dataSource ignores disallowed values (dropping them), dataSourceRef - preserves all values, and generates an error if a disallowed value is - specified. - * While dataSource only allows local objects, dataSourceRef allows objects - in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. - (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. - properties: - apiGroup: - description: |- - APIGroup is the group for the resource being referenced. - If APIGroup is not specified, the specified Kind must be in the core API group. - For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - namespace: - description: |- - Namespace is the namespace of resource being referenced - Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. - (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. - type: string - required: - - kind - - name - type: object - resources: - description: |- - resources represents the minimum resources the volume should have. - If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements - that are lower than previous value but must still be higher than capacity recorded in the - status field of the claim. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources - properties: - claims: - description: |- - Claims lists the names of resources, defined in spec.resourceClaims, - that are used by this container. - - This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. - - This field is immutable. It can only be set for containers. - items: - description: ResourceClaim references one entry - in PodSpec.ResourceClaims. - properties: - name: - description: |- - Name must match the name of one entry in pod.spec.resourceClaims of - the Pod where this field is used. It makes that resource available - inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Requests describes the minimum amount of compute resources required. - If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - type: object - selector: - description: selector is a label query over volumes to - consider for binding. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - storageClassName: - description: |- - storageClassName is the name of the StorageClass required by the claim. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 - type: string - volumeMode: - description: |- - volumeMode defines what type of volume is required by the claim. - Value of Filesystem is implied when not included in claim spec. - type: string - volumeName: - description: volumeName is the binding reference to the - PersistentVolume backing this claim. - type: string - type: object - status: - description: |- - status represents the current information/status of a persistent volume claim. - Read-only. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims - properties: - accessModes: - description: |- - accessModes contains the actual access modes the volume backing the PVC has. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 - items: - type: string - type: array - allocatedResources: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - allocatedResources is the storage resource within AllocatedResources tracks the capacity allocated to a PVC. It may - be larger than the actual capacity when a volume expansion operation is requested. - For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. - If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. - If a volume expansion capacity request is lowered, allocatedResources is only - lowered if there are no expansion operations in progress and if the actual volume capacity - is equal or lower than the requested capacity. - This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature. - type: object - capacity: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: capacity represents the actual resources - of the underlying volume. - type: object - conditions: - description: |- - conditions is the current Condition of persistent volume claim. If underlying persistent volume is being - resized then the Condition will be set to 'ResizeStarted'. - items: - description: PersistentVolumeClaimCondition contails - details about state of pvc - properties: - lastProbeTime: - description: lastProbeTime is the time we probed - the condition. - format: date-time - type: string - lastTransitionTime: - description: lastTransitionTime is the time the - condition transitioned from one status to another. - format: date-time - type: string - message: - description: message is the human-readable message - indicating details about last transition. - type: string - reason: - description: |- - reason is a unique, this should be a short, machine understandable string that gives the reason - for condition's last transition. If it reports "ResizeStarted" that means the underlying - persistent volume is being resized. - type: string - status: - type: string - type: - description: PersistentVolumeClaimConditionType - is a valid value of PersistentVolumeClaimCondition.Type - type: string - required: - - status - - type - type: object - type: array - phase: - description: phase represents the current phase of PersistentVolumeClaim. - type: string - resizeStatus: - description: |- - resizeStatus stores status of resize operation. - ResizeStatus is not set by default but when expansion is complete resizeStatus is set to empty - string by resize controller or kubelet. - This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature. - type: string - type: object - type: object - type: object - ms: - description: the specification of metaservice, metaservice is the - component of doris disaggregated cluster. - properties: - affinity: - description: Affinity is a group of affinity scheduling rules. - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for - the pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: |- - The scheduler will prefer to schedule pods to nodes that satisfy - the affinity expressions specified by this field, but it may choose - a node that violates one or more of the expressions. The node that is - most preferred is the one with the greatest sum of weights, i.e. - for each node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, etc.), - compute a sum by iterating through the elements of this field and adding - "weight" to the sum if the node matches the corresponding matchExpressions; the - node(s) with the highest sum are the most preferred. - items: - description: |- - An empty preferred scheduling term matches all objects with implicit weight 0 - (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - properties: - preference: - description: A node selector term, associated with - the corresponding weight. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - weight: - description: Weight associated with matching the - corresponding nodeSelectorTerm, in the range 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: |- - If the affinity requirements specified by this field are not met at - scheduling time, the pod will not be scheduled onto the node. - If the affinity requirements specified by this field cease to be met - at some point during pod execution (e.g. due to an update), the system - may or may not try to eventually evict the pod from its node. - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. - The terms are ORed. - items: - description: |- - A null or empty node selector term matches no objects. The requirements of - them are ANDed. - The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - type: array - required: - - nodeSelectorTerms - type: object - x-kubernetes-map-type: atomic - type: object - podAffinity: - description: Describes pod affinity scheduling rules (e.g. - co-locate this pod in the same node, zone, etc. as some - other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: |- - The scheduler will prefer to schedule pods to nodes that satisfy - the affinity expressions specified by this field, but it may choose - a node that violates one or more of the expressions. The node that is - most preferred is the one with the greatest sum of weights, i.e. - for each node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, etc.), - compute a sum by iterating through the elements of this field and adding - "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: |- - weight associated with matching the corresponding podAffinityTerm, - in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: |- - If the affinity requirements specified by this field are not met at - scheduling time, the pod will not be scheduled onto the node. - If the affinity requirements specified by this field cease to be met - at some point during pod execution (e.g. due to a pod label update), the - system may or may not try to eventually evict the pod from its node. - When there are multiple elements, the lists of nodes corresponding to each - podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: |- - Defines a set of pods (namely those matching the labelSelector - relative to the given namespace(s)) that this pod should be - co-located (affinity) or not co-located (anti-affinity) with, - where co-located is defined as running on a node whose value of - the label with key matches that of any node on which - a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules - (e.g. avoid putting this pod in the same node, zone, etc. - as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: |- - The scheduler will prefer to schedule pods to nodes that satisfy - the anti-affinity expressions specified by this field, but it may choose - a node that violates one or more of the expressions. The node that is - most preferred is the one with the greatest sum of weights, i.e. - for each node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling anti-affinity expressions, etc.), - compute a sum by iterating through the elements of this field and adding - "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: |- - weight associated with matching the corresponding podAffinityTerm, - in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: |- - If the anti-affinity requirements specified by this field are not met at - scheduling time, the pod will not be scheduled onto the node. - If the anti-affinity requirements specified by this field cease to be met - at some point during pod execution (e.g. due to a pod label update), the - system may or may not try to eventually evict the pod from its node. - When there are multiple elements, the lists of nodes corresponding to each - podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: |- - Defines a set of pods (namely those matching the labelSelector - relative to the given namespace(s)) that this pod should be - co-located (affinity) or not co-located (anti-affinity) with, - where co-located is defined as running on a node whose value of - the label with key matches that of any node on which - a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - annotations: - additionalProperties: - type: string - description: |- - Annotations is an unstructured key value map stored with a resource that may be - set by external tools to store and retrieve arbitrary metadata. - type: object - claims: - description: |- - Claims lists the names of resources, defined in spec.resourceClaims, - that are used by this container. - - This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. - - This field is immutable. It can only be set for containers. - items: - description: ResourceClaim references one entry in PodSpec.ResourceClaims. - properties: - name: - description: |- - Name must match the name of one entry in pod.spec.resourceClaims of - the Pod where this field is used. It makes that resource available - inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - configMaps: - description: ConfigMaps describe all configmaps that need to be - mounted. - items: - properties: - mountPath: - description: MountPath specify the position of configmap - be mounted. - type: string - name: - description: Name specify the configmap in deployed namespace - that need to be mounted in pod. - type: string - type: object - type: array - containerSecurityContext: - description: Security context for all containers running in the - pod (unless they override it). - properties: - allowPrivilegeEscalation: - description: |- - AllowPrivilegeEscalation controls whether a process can gain more - privileges than its parent process. This bool directly controls if - the no_new_privs flag will be set on the container process. - AllowPrivilegeEscalation is true always when the container is: - 1) run as Privileged - 2) has CAP_SYS_ADMIN - Note that this field cannot be set when spec.os.name is windows. - type: boolean - capabilities: - description: |- - The capabilities to add/drop when running containers. - Defaults to the default set of capabilities granted by the container runtime. - Note that this field cannot be set when spec.os.name is windows. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities - type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities - type - type: string - type: array - type: object - privileged: - description: |- - Run container in privileged mode. - Processes in privileged containers are essentially equivalent to root on the host. - Defaults to false. - Note that this field cannot be set when spec.os.name is windows. - type: boolean - procMount: - description: |- - procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for - readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. - Note that this field cannot be set when spec.os.name is windows. - type: string - readOnlyRootFilesystem: - description: |- - Whether this container has a read-only root filesystem. - Default is false. - Note that this field cannot be set when spec.os.name is windows. - type: boolean - runAsGroup: - description: |- - The GID to run the entrypoint of the container process. - Uses runtime default if unset. - May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - runAsNonRoot: - description: |- - Indicates that the container must run as a non-root user. - If true, the Kubelet will validate the image at runtime to ensure that it - does not run as UID 0 (root) and fail to start the container if it does. - If unset or false, no such validation will be performed. - May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: |- - The UID to run the entrypoint of the container process. - Defaults to user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - seLinuxOptions: - description: |- - The SELinux context to be applied to the container. - If unspecified, the container runtime will allocate a random SELinux context for each - container. May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name is windows. - properties: - level: - description: Level is SELinux level label that applies - to the container. - type: string - role: - description: Role is a SELinux role label that applies - to the container. - type: string - type: - description: Type is a SELinux type label that applies - to the container. - type: string - user: - description: User is a SELinux user label that applies - to the container. - type: string - type: object - seccompProfile: - description: |- - The seccomp options to use by this container. If seccomp options are - provided at both the pod & container level, the container options - override the pod options. - Note that this field cannot be set when spec.os.name is windows. - properties: - localhostProfile: - description: |- - localhostProfile indicates a profile defined in a file on the node should be used. - The profile must be preconfigured on the node to work. - Must be a descending path, relative to the kubelet's configured seccomp profile location. - Must only be set if type is "Localhost". - type: string - type: - description: |- - type indicates which kind of seccomp profile will be applied. - Valid options are: - - Localhost - a profile defined in a file on the node should be used. - RuntimeDefault - the container runtime default profile should be used. - Unconfined - no profile should be applied. - type: string - required: - - type - type: object - windowsOptions: - description: |- - The Windows specific settings applied to all containers. - If unspecified, the options from the PodSecurityContext will be used. - If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name is linux. - properties: - gmsaCredentialSpec: - description: |- - GMSACredentialSpec is where the GMSA admission webhook - (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the - GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the - GMSA credential spec to use. - type: string - hostProcess: - description: |- - HostProcess determines if a container should be run as a 'Host Process' container. - This field is alpha-level and will only be honored by components that enable the - WindowsHostProcessContainers feature flag. Setting this field without the feature - flag will result in errors when validating the Pod. All of a Pod's containers must - have the same effective HostProcess value (it is not allowed to have a mix of HostProcess - containers and non-HostProcess containers). In addition, if HostProcess is true - then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: |- - The UserName in Windows to run the entrypoint of the container process. - Defaults to the user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - envVars: - description: EnvVars is a slice of environment variables that - are added to the pods, the default is empty. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must be a - C_IDENTIFIER. - type: string - value: - description: |- - Variable references $(VAR_NAME) are expanded - using the previously defined environment variables in the container and - any service environment variables. If a variable cannot be resolved, - the reference in the input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. - "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless of whether the variable - exists or not. - Defaults to "". - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - optional: - description: Specify whether the ConfigMap or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: |- - Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, - spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the - specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: |- - Selects a resource of the container: only resources limits and requests - (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the - exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select from. Must - be a valid secret key. - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - optional: - description: Specify whether the Secret or its key - must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - hostAliases: - description: |- - HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts - file if specified. This is only valid for non-hostNetwork pods. - items: - description: |- - HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the - pod's hosts file. - properties: - hostnames: - description: Hostnames for the above IP address. - items: - type: string - type: array - ip: - description: IP address of the host file entry. - type: string - type: object - type: array - image: - description: Image is the metaservice docker image to deploy. - the image can pull from dockerhub selectdb repository. - type: string - imagePullSecrets: - description: |- - ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. - If specified, these secrets will be passed to individual puller implementations for them to use. - More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod - items: - description: |- - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. - properties: - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - type: array - labels: - additionalProperties: - type: string - description: Labels for user selector or classify pods - type: object - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - nodeSelector: - additionalProperties: - type: string - description: (Optional) If specified, the pod's nodeSelector,displayName="Map - of nodeSelectors to match when scheduling pods on nodes" - type: object - persistentVolume: - description: PersistentVolume defines volume information and container - mount information. - properties: - annotations: - additionalProperties: - type: string - description: |- - Annotation for PVC pods. Users can adapt the storage authentication and pv binding of the cloud platform through configuration. - It only takes effect in the first configuration and cannot be added or modified later. - type: object - persistentVolumeClaimSpec: - description: PersistentVolumeClaimSpec is a list of claim - spec about storage that pods are required. - properties: - accessModes: - description: |- - accessModes contains the desired access modes the volume should have. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 - items: - type: string - type: array - dataSource: - description: |- - dataSource field can be used to specify either: - * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) - If the provisioner or an external controller can support the specified data source, - it will create a new volume based on the contents of the specified data source. - When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. - If the namespace is specified, then dataSourceRef will not be copied to dataSource. - properties: - apiGroup: - description: |- - APIGroup is the group for the resource being referenced. - If APIGroup is not specified, the specified Kind must be in the core API group. - For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - dataSourceRef: - description: |- - dataSourceRef specifies the object from which to populate the volume with data, if a non-empty - volume is desired. This may be any object from a non-empty API group (non - core object) or a PersistentVolumeClaim object. - When this field is specified, volume binding will only succeed if the type of - the specified object matches some installed volume populator or dynamic - provisioner. - This field will replace the functionality of the dataSource field and as such - if both fields are non-empty, they must have the same value. For backwards - compatibility, when namespace isn't specified in dataSourceRef, - both fields (dataSource and dataSourceRef) will be set to the same - value automatically if one of them is empty and the other is non-empty. - When namespace is specified in dataSourceRef, - dataSource isn't set to the same value and must be empty. - There are three important differences between dataSource and dataSourceRef: - * While dataSource only allows two specific types of objects, dataSourceRef - allows any non-core object, as well as PersistentVolumeClaim objects. - * While dataSource ignores disallowed values (dropping them), dataSourceRef - preserves all values, and generates an error if a disallowed value is - specified. - * While dataSource only allows local objects, dataSourceRef allows objects - in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. - (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. - properties: - apiGroup: - description: |- - APIGroup is the group for the resource being referenced. - If APIGroup is not specified, the specified Kind must be in the core API group. - For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - namespace: - description: |- - Namespace is the namespace of resource being referenced - Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. - (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. - type: string - required: - - kind - - name - type: object - resources: - description: |- - resources represents the minimum resources the volume should have. - If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements - that are lower than previous value but must still be higher than capacity recorded in the - status field of the claim. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources - properties: - claims: - description: |- - Claims lists the names of resources, defined in spec.resourceClaims, - that are used by this container. - - This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. - - This field is immutable. It can only be set for containers. - items: - description: ResourceClaim references one entry - in PodSpec.ResourceClaims. - properties: - name: - description: |- - Name must match the name of one entry in pod.spec.resourceClaims of - the Pod where this field is used. It makes that resource available - inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Requests describes the minimum amount of compute resources required. - If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - type: object - selector: - description: selector is a label query over volumes to - consider for binding. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - storageClassName: - description: |- - storageClassName is the name of the StorageClass required by the claim. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 - type: string - volumeMode: - description: |- - volumeMode defines what type of volume is required by the claim. - Value of Filesystem is implied when not included in claim spec. - type: string - volumeName: - description: volumeName is the binding reference to the - PersistentVolume backing this claim. - type: string - type: object - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Requests describes the minimum amount of compute resources required. - If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - securityContext: - description: Security context for pod. - properties: - fsGroup: - description: |- - A special supplemental group that applies to all containers in a pod. - Some volume types allow the Kubelet to change the ownership of that volume - to be owned by the pod: - - 1. The owning GID will be the FSGroup - 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) - 3. The permission bits are OR'd with rw-rw---- - - If unset, the Kubelet will not modify the ownership and permissions of any volume. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - fsGroupChangePolicy: - description: |- - fsGroupChangePolicy defines behavior of changing ownership and permission of the volume - before being exposed inside Pod. This field will only apply to - volume types which support fsGroup based ownership(and permissions). - It will have no effect on ephemeral volume types such as: secret, configmaps - and emptydir. - Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used. - Note that this field cannot be set when spec.os.name is windows. - type: string - runAsGroup: - description: |- - The GID to run the entrypoint of the container process. - Uses runtime default if unset. - May also be set in SecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence - for that container. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - runAsNonRoot: - description: |- - Indicates that the container must run as a non-root user. - If true, the Kubelet will validate the image at runtime to ensure that it - does not run as UID 0 (root) and fail to start the container if it does. - If unset or false, no such validation will be performed. - May also be set in SecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: |- - The UID to run the entrypoint of the container process. - Defaults to user specified in image metadata if unspecified. - May also be set in SecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence - for that container. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - seLinuxOptions: - description: |- - The SELinux context to be applied to all containers. - If unspecified, the container runtime will allocate a random SELinux context for each - container. May also be set in SecurityContext. If set in - both SecurityContext and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. - Note that this field cannot be set when spec.os.name is windows. - properties: - level: - description: Level is SELinux level label that applies - to the container. - type: string - role: - description: Role is a SELinux role label that applies - to the container. - type: string - type: - description: Type is a SELinux type label that applies - to the container. - type: string - user: - description: User is a SELinux user label that applies - to the container. - type: string - type: object - seccompProfile: - description: |- - The seccomp options to use by the containers in this pod. - Note that this field cannot be set when spec.os.name is windows. - properties: - localhostProfile: - description: |- - localhostProfile indicates a profile defined in a file on the node should be used. - The profile must be preconfigured on the node to work. - Must be a descending path, relative to the kubelet's configured seccomp profile location. - Must only be set if type is "Localhost". - type: string - type: - description: |- - type indicates which kind of seccomp profile will be applied. - Valid options are: - - Localhost - a profile defined in a file on the node should be used. - RuntimeDefault - the container runtime default profile should be used. - Unconfined - no profile should be applied. - type: string - required: - - type - type: object - supplementalGroups: - description: |- - A list of groups applied to the first process run in each container, in addition - to the container's primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container process. If unspecified, - no additional groups are added to any container. Note that group memberships - defined in the container image for the uid of the container process are still effective, - even if they are not included in this list. - Note that this field cannot be set when spec.os.name is windows. - items: - format: int64 - type: integer - type: array - sysctls: - description: |- - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail to launch. - Note that this field cannot be set when spec.os.name is windows. - items: - description: Sysctl defines a kernel parameter to be set - properties: - name: - description: Name of a property to set - type: string - value: - description: Value of a property to set - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - description: |- - The Windows specific settings applied to all containers. - If unspecified, the options within a container's SecurityContext will be used. - If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name is linux. - properties: - gmsaCredentialSpec: - description: |- - GMSACredentialSpec is where the GMSA admission webhook - (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the - GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the - GMSA credential spec to use. - type: string - hostProcess: - description: |- - HostProcess determines if a container should be run as a 'Host Process' container. - This field is alpha-level and will only be honored by components that enable the - WindowsHostProcessContainers feature flag. Setting this field without the feature - flag will result in errors when validating the Pod. All of a Pod's containers must - have the same effective HostProcess value (it is not allowed to have a mix of HostProcess - containers and non-HostProcess containers). In addition, if HostProcess is true - then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: |- - The UserName in Windows to run the entrypoint of the container process. - Defaults to the user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - service: - description: export metaservice for accessing from outside k8s. - properties: - annotations: - additionalProperties: - type: string - description: Annotations for using function on different cloud - platform. - type: object - loadBalancerIP: - description: |- - Only applies to Service Type: LoadBalancer. - This feature depends on whether the underlying cloud-provider supports specifying - the loadBalancerIP when a load balancer is created. - This field will be ignored if the cloud-provider does not support the feature. - This field was under-specified and its meaning varies across implementations, - and it cannot support dual-stack. - As of Kubernetes v1.24, users are encouraged to use implementation-specific annotations when available. - This field may be removed in a future API version. - type: string - portMaps: - description: PortMaps specify node port for target port in - pod, when the service type=NodePort. - items: - description: PortMap for ServiceType=NodePort situation. - properties: - nodePort: - description: |- - The port on each node on which this service is exposed when type is - NodePort or LoadBalancer. Usually assigned by the system. If a value is - specified, in-range, and not in use it will be used, otherwise the - operation will fail. If not specified, a port will be allocated if this - Service requires one. If this field is specified when creating a - Service which does not need it, creation will fail. This field will be - wiped when updating a Service to no longer need it (e.g. changing type - from NodePort to ClusterIP). - More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport - need in 30000-32767 - format: int32 - type: integer - targetPort: - description: |- - Number or name of the port to access on the pods targeted by the service. - Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - If this is a string, it will be looked up as a named port in the - target Pod's container ports. If this is not specified, the value - of the 'port' field is used (an identity map). - This field is ignored for services with clusterIP=None, and should be - omitted or set equal to the 'port' field. - More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service - format: int32 - type: integer - type: object - type: array - type: - description: |- - type of service,the possible value for the service type are : ClusterIP, NodePort, LoadBalancer,ExternalName. - More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types - type: string - type: object - serviceAccount: - type: string - tolerations: - description: (Optional) Tolerations for scheduling pods onto some - dedicated nodes - items: - description: |- - The pod this Toleration is attached to tolerates any taint that matches - the triple using the matching operator . - properties: - effect: - description: |- - Effect indicates the taint effect to match. Empty means match all taint effects. - When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: |- - Key is the taint key that the toleration applies to. Empty means match all taint keys. - If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: |- - Operator represents a key's relationship to the value. - Valid operators are Exists and Equal. Defaults to Equal. - Exists is equivalent to wildcard for value, so that a pod can - tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: |- - TolerationSeconds represents the period of time the toleration (which must be - of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, - it is not set, which means tolerate the taint forever (do not evict). Zero and - negative values will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: |- - Value is the taint value the toleration matches to. - If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - type: object - type: array - type: object - recycler: - description: the specification of recycler, recycler is the component - of doris disaggregated cluster. - properties: - affinity: - description: Affinity is a group of affinity scheduling rules. - properties: - nodeAffinity: - description: Describes node affinity scheduling rules for - the pod. - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: |- - The scheduler will prefer to schedule pods to nodes that satisfy - the affinity expressions specified by this field, but it may choose - a node that violates one or more of the expressions. The node that is - most preferred is the one with the greatest sum of weights, i.e. - for each node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, etc.), - compute a sum by iterating through the elements of this field and adding - "weight" to the sum if the node matches the corresponding matchExpressions; the - node(s) with the highest sum are the most preferred. - items: - description: |- - An empty preferred scheduling term matches all objects with implicit weight 0 - (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op). - properties: - preference: - description: A node selector term, associated with - the corresponding weight. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - weight: - description: Weight associated with matching the - corresponding nodeSelectorTerm, in the range 1-100. - format: int32 - type: integer - required: - - preference - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: |- - If the affinity requirements specified by this field are not met at - scheduling time, the pod will not be scheduled onto the node. - If the affinity requirements specified by this field cease to be met - at some point during pod execution (e.g. due to an update), the system - may or may not try to eventually evict the pod from its node. - properties: - nodeSelectorTerms: - description: Required. A list of node selector terms. - The terms are ORed. - items: - description: |- - A null or empty node selector term matches no objects. The requirements of - them are ANDed. - The TopologySelectorTerm type implements a subset of the NodeSelectorTerm. - properties: - matchExpressions: - description: A list of node selector requirements - by node's labels. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchFields: - description: A list of node selector requirements - by node's fields. - items: - description: |- - A node selector requirement is a selector that contains values, a key, and an operator - that relates the key and values. - properties: - key: - description: The label key that the selector - applies to. - type: string - operator: - description: |- - Represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. - type: string - values: - description: |- - An array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. If the operator is Gt or Lt, the values - array must have a single element, which will be interpreted as an integer. - This array is replaced during a strategic merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - type: object - x-kubernetes-map-type: atomic - type: array - required: - - nodeSelectorTerms - type: object - x-kubernetes-map-type: atomic - type: object - podAffinity: - description: Describes pod affinity scheduling rules (e.g. - co-locate this pod in the same node, zone, etc. as some - other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: |- - The scheduler will prefer to schedule pods to nodes that satisfy - the affinity expressions specified by this field, but it may choose - a node that violates one or more of the expressions. The node that is - most preferred is the one with the greatest sum of weights, i.e. - for each node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling affinity expressions, etc.), - compute a sum by iterating through the elements of this field and adding - "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: |- - weight associated with matching the corresponding podAffinityTerm, - in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: |- - If the affinity requirements specified by this field are not met at - scheduling time, the pod will not be scheduled onto the node. - If the affinity requirements specified by this field cease to be met - at some point during pod execution (e.g. due to a pod label update), the - system may or may not try to eventually evict the pod from its node. - When there are multiple elements, the lists of nodes corresponding to each - podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: |- - Defines a set of pods (namely those matching the labelSelector - relative to the given namespace(s)) that this pod should be - co-located (affinity) or not co-located (anti-affinity) with, - where co-located is defined as running on a node whose value of - the label with key matches that of any node on which - a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - podAntiAffinity: - description: Describes pod anti-affinity scheduling rules - (e.g. avoid putting this pod in the same node, zone, etc. - as some other pod(s)). - properties: - preferredDuringSchedulingIgnoredDuringExecution: - description: |- - The scheduler will prefer to schedule pods to nodes that satisfy - the anti-affinity expressions specified by this field, but it may choose - a node that violates one or more of the expressions. The node that is - most preferred is the one with the greatest sum of weights, i.e. - for each node that meets all of the scheduling requirements (resource - request, requiredDuringScheduling anti-affinity expressions, etc.), - compute a sum by iterating through the elements of this field and adding - "weight" to the sum if the node has pods which matches the corresponding podAffinityTerm; the - node(s) with the highest sum are the most preferred. - items: - description: The weights of all of the matched WeightedPodAffinityTerm - fields are added per-node to find the most preferred - node(s) - properties: - podAffinityTerm: - description: Required. A pod affinity term, associated - with the corresponding weight. - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list - of label selector requirements. The requirements - are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key - that the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - weight: - description: |- - weight associated with matching the corresponding podAffinityTerm, - in the range 1-100. - format: int32 - type: integer - required: - - podAffinityTerm - - weight - type: object - type: array - requiredDuringSchedulingIgnoredDuringExecution: - description: |- - If the anti-affinity requirements specified by this field are not met at - scheduling time, the pod will not be scheduled onto the node. - If the anti-affinity requirements specified by this field cease to be met - at some point during pod execution (e.g. due to a pod label update), the - system may or may not try to eventually evict the pod from its node. - When there are multiple elements, the lists of nodes corresponding to each - podAffinityTerm are intersected, i.e. all terms must be satisfied. - items: - description: |- - Defines a set of pods (namely those matching the labelSelector - relative to the given namespace(s)) that this pod should be - co-located (affinity) or not co-located (anti-affinity) with, - where co-located is defined as running on a node whose value of - the label with key matches that of any node on which - a pod of the set of pods is running - properties: - labelSelector: - description: A label query over a set of resources, - in this case pods. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaceSelector: - description: |- - A label query over the set of namespaces that the term applies to. - The term is applied to the union of the namespaces selected by this field - and the ones listed in the namespaces field. - null selector and null or empty namespaces list means "this pod's namespace". - An empty selector ({}) matches all namespaces. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - namespaces: - description: |- - namespaces specifies a static list of namespace names that the term applies to. - The term is applied to the union of the namespaces listed in this field - and the ones selected by namespaceSelector. - null or empty namespaces list and null namespaceSelector means "this pod's namespace". - items: - type: string - type: array - topologyKey: - description: |- - This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching - the labelSelector in the specified namespaces, where co-located is defined as running on a node - whose value of the label with key topologyKey matches that of any node on which any of the - selected pods is running. - Empty topologyKey is not allowed. - type: string - required: - - topologyKey - type: object - type: array - type: object - type: object - annotations: - additionalProperties: - type: string - description: |- - Annotations is an unstructured key value map stored with a resource that may be - set by external tools to store and retrieve arbitrary metadata. - type: object - claims: - description: |- - Claims lists the names of resources, defined in spec.resourceClaims, - that are used by this container. - - This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. - - This field is immutable. It can only be set for containers. - items: - description: ResourceClaim references one entry in PodSpec.ResourceClaims. - properties: - name: - description: |- - Name must match the name of one entry in pod.spec.resourceClaims of - the Pod where this field is used. It makes that resource available - inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - configMaps: - description: ConfigMaps describe all configmaps that need to be - mounted. - items: - properties: - mountPath: - description: MountPath specify the position of configmap - be mounted. - type: string - name: - description: Name specify the configmap in deployed namespace - that need to be mounted in pod. - type: string - type: object - type: array - containerSecurityContext: - description: Security context for all containers running in the - pod (unless they override it). - properties: - allowPrivilegeEscalation: - description: |- - AllowPrivilegeEscalation controls whether a process can gain more - privileges than its parent process. This bool directly controls if - the no_new_privs flag will be set on the container process. - AllowPrivilegeEscalation is true always when the container is: - 1) run as Privileged - 2) has CAP_SYS_ADMIN - Note that this field cannot be set when spec.os.name is windows. - type: boolean - capabilities: - description: |- - The capabilities to add/drop when running containers. - Defaults to the default set of capabilities granted by the container runtime. - Note that this field cannot be set when spec.os.name is windows. - properties: - add: - description: Added capabilities - items: - description: Capability represent POSIX capabilities - type - type: string - type: array - drop: - description: Removed capabilities - items: - description: Capability represent POSIX capabilities - type - type: string - type: array - type: object - privileged: - description: |- - Run container in privileged mode. - Processes in privileged containers are essentially equivalent to root on the host. - Defaults to false. - Note that this field cannot be set when spec.os.name is windows. - type: boolean - procMount: - description: |- - procMount denotes the type of proc mount to use for the containers. - The default is DefaultProcMount which uses the container runtime defaults for - readonly paths and masked paths. - This requires the ProcMountType feature flag to be enabled. - Note that this field cannot be set when spec.os.name is windows. - type: string - readOnlyRootFilesystem: - description: |- - Whether this container has a read-only root filesystem. - Default is false. - Note that this field cannot be set when spec.os.name is windows. - type: boolean - runAsGroup: - description: |- - The GID to run the entrypoint of the container process. - Uses runtime default if unset. - May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - runAsNonRoot: - description: |- - Indicates that the container must run as a non-root user. - If true, the Kubelet will validate the image at runtime to ensure that it - does not run as UID 0 (root) and fail to start the container if it does. - If unset or false, no such validation will be performed. - May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: |- - The UID to run the entrypoint of the container process. - Defaults to user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - seLinuxOptions: - description: |- - The SELinux context to be applied to the container. - If unspecified, the container runtime will allocate a random SELinux context for each - container. May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name is windows. - properties: - level: - description: Level is SELinux level label that applies - to the container. - type: string - role: - description: Role is a SELinux role label that applies - to the container. - type: string - type: - description: Type is a SELinux type label that applies - to the container. - type: string - user: - description: User is a SELinux user label that applies - to the container. - type: string - type: object - seccompProfile: - description: |- - The seccomp options to use by this container. If seccomp options are - provided at both the pod & container level, the container options - override the pod options. - Note that this field cannot be set when spec.os.name is windows. - properties: - localhostProfile: - description: |- - localhostProfile indicates a profile defined in a file on the node should be used. - The profile must be preconfigured on the node to work. - Must be a descending path, relative to the kubelet's configured seccomp profile location. - Must only be set if type is "Localhost". - type: string - type: - description: |- - type indicates which kind of seccomp profile will be applied. - Valid options are: - - Localhost - a profile defined in a file on the node should be used. - RuntimeDefault - the container runtime default profile should be used. - Unconfined - no profile should be applied. - type: string - required: - - type - type: object - windowsOptions: - description: |- - The Windows specific settings applied to all containers. - If unspecified, the options from the PodSecurityContext will be used. - If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name is linux. - properties: - gmsaCredentialSpec: - description: |- - GMSACredentialSpec is where the GMSA admission webhook - (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the - GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the - GMSA credential spec to use. - type: string - hostProcess: - description: |- - HostProcess determines if a container should be run as a 'Host Process' container. - This field is alpha-level and will only be honored by components that enable the - WindowsHostProcessContainers feature flag. Setting this field without the feature - flag will result in errors when validating the Pod. All of a Pod's containers must - have the same effective HostProcess value (it is not allowed to have a mix of HostProcess - containers and non-HostProcess containers). In addition, if HostProcess is true - then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: |- - The UserName in Windows to run the entrypoint of the container process. - Defaults to the user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - envVars: - description: EnvVars is a slice of environment variables that - are added to the pods, the default is empty. - items: - description: EnvVar represents an environment variable present - in a Container. - properties: - name: - description: Name of the environment variable. Must be a - C_IDENTIFIER. - type: string - value: - description: |- - Variable references $(VAR_NAME) are expanded - using the previously defined environment variables in the container and - any service environment variables. If a variable cannot be resolved, - the reference in the input string will be unchanged. Double $$ are reduced - to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. - "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". - Escaped references will never be expanded, regardless of whether the variable - exists or not. - Defaults to "". - type: string - valueFrom: - description: Source for the environment variable's value. - Cannot be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - optional: - description: Specify whether the ConfigMap or its - key must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - fieldRef: - description: |- - Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, - spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. - properties: - apiVersion: - description: Version of the schema the FieldPath - is written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the - specified API version. - type: string - required: - - fieldPath - type: object - x-kubernetes-map-type: atomic - resourceFieldRef: - description: |- - Selects a resource of the container: only resources limits and requests - (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the - exposed resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - x-kubernetes-map-type: atomic - secretKeyRef: - description: Selects a key of a secret in the pod's - namespace - properties: - key: - description: The key of the secret to select from. Must - be a valid secret key. - type: string - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - optional: - description: Specify whether the Secret or its key - must be defined - type: boolean - required: - - key - type: object - x-kubernetes-map-type: atomic - type: object - required: - - name - type: object - type: array - hostAliases: - description: |- - HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts - file if specified. This is only valid for non-hostNetwork pods. - items: - description: |- - HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the - pod's hosts file. - properties: - hostnames: - description: Hostnames for the above IP address. - items: - type: string - type: array - ip: - description: IP address of the host file entry. - type: string - type: object - type: array - image: - description: Image is the metaservice docker image to deploy. - the image can pull from dockerhub selectdb repository. - type: string - imagePullSecrets: - description: |- - ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. - If specified, these secrets will be passed to individual puller implementations for them to use. - More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod - items: - description: |- - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. - properties: - name: - description: |- - Name of the referent. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - type: array - labels: - additionalProperties: - type: string - description: Labels for user selector or classify pods - type: object - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - nodeSelector: - additionalProperties: - type: string - description: (Optional) If specified, the pod's nodeSelector,displayName="Map - of nodeSelectors to match when scheduling pods on nodes" - type: object - persistentVolume: - description: PersistentVolume defines volume information and container - mount information. - properties: - annotations: - additionalProperties: - type: string - description: |- - Annotation for PVC pods. Users can adapt the storage authentication and pv binding of the cloud platform through configuration. - It only takes effect in the first configuration and cannot be added or modified later. - type: object - persistentVolumeClaimSpec: - description: PersistentVolumeClaimSpec is a list of claim - spec about storage that pods are required. - properties: - accessModes: - description: |- - accessModes contains the desired access modes the volume should have. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1 - items: - type: string - type: array - dataSource: - description: |- - dataSource field can be used to specify either: - * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) - * An existing PVC (PersistentVolumeClaim) - If the provisioner or an external controller can support the specified data source, - it will create a new volume based on the contents of the specified data source. - When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, - and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. - If the namespace is specified, then dataSourceRef will not be copied to dataSource. - properties: - apiGroup: - description: |- - APIGroup is the group for the resource being referenced. - If APIGroup is not specified, the specified Kind must be in the core API group. - For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - dataSourceRef: - description: |- - dataSourceRef specifies the object from which to populate the volume with data, if a non-empty - volume is desired. This may be any object from a non-empty API group (non - core object) or a PersistentVolumeClaim object. - When this field is specified, volume binding will only succeed if the type of - the specified object matches some installed volume populator or dynamic - provisioner. - This field will replace the functionality of the dataSource field and as such - if both fields are non-empty, they must have the same value. For backwards - compatibility, when namespace isn't specified in dataSourceRef, - both fields (dataSource and dataSourceRef) will be set to the same - value automatically if one of them is empty and the other is non-empty. - When namespace is specified in dataSourceRef, - dataSource isn't set to the same value and must be empty. - There are three important differences between dataSource and dataSourceRef: - * While dataSource only allows two specific types of objects, dataSourceRef - allows any non-core object, as well as PersistentVolumeClaim objects. - * While dataSource ignores disallowed values (dropping them), dataSourceRef - preserves all values, and generates an error if a disallowed value is - specified. - * While dataSource only allows local objects, dataSourceRef allows objects - in any namespaces. - (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. - (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled. - properties: - apiGroup: - description: |- - APIGroup is the group for the resource being referenced. - If APIGroup is not specified, the specified Kind must be in the core API group. - For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - namespace: - description: |- - Namespace is the namespace of resource being referenced - Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. - (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled. - type: string - required: - - kind - - name - type: object - resources: - description: |- - resources represents the minimum resources the volume should have. - If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements - that are lower than previous value but must still be higher than capacity recorded in the - status field of the claim. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources - properties: - claims: - description: |- - Claims lists the names of resources, defined in spec.resourceClaims, - that are used by this container. - - This is an alpha field and requires enabling the - DynamicResourceAllocation feature gate. - - This field is immutable. It can only be set for containers. - items: - description: ResourceClaim references one entry - in PodSpec.ResourceClaims. - properties: - name: - description: |- - Name must match the name of one entry in pod.spec.resourceClaims of - the Pod where this field is used. It makes that resource available - inside a container. - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Limits describes the maximum amount of compute resources allowed. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Requests describes the minimum amount of compute resources required. - If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - type: object - selector: - description: selector is a label query over volumes to - consider for binding. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - storageClassName: - description: |- - storageClassName is the name of the StorageClass required by the claim. - More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1 - type: string - volumeMode: - description: |- - volumeMode defines what type of volume is required by the claim. - Value of Filesystem is implied when not included in claim spec. - type: string - volumeName: - description: volumeName is the binding reference to the - PersistentVolume backing this claim. - type: string - type: object - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - description: |- - Requests describes the minimum amount of compute resources required. - If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, - otherwise to an implementation-defined value. - More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ - type: object - securityContext: - description: Security context for pod. - properties: - fsGroup: - description: |- - A special supplemental group that applies to all containers in a pod. - Some volume types allow the Kubelet to change the ownership of that volume - to be owned by the pod: - - 1. The owning GID will be the FSGroup - 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) - 3. The permission bits are OR'd with rw-rw---- - - If unset, the Kubelet will not modify the ownership and permissions of any volume. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - fsGroupChangePolicy: - description: |- - fsGroupChangePolicy defines behavior of changing ownership and permission of the volume - before being exposed inside Pod. This field will only apply to - volume types which support fsGroup based ownership(and permissions). - It will have no effect on ephemeral volume types such as: secret, configmaps - and emptydir. - Valid values are "OnRootMismatch" and "Always". If not specified, "Always" is used. - Note that this field cannot be set when spec.os.name is windows. - type: string - runAsGroup: - description: |- - The GID to run the entrypoint of the container process. - Uses runtime default if unset. - May also be set in SecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence - for that container. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - runAsNonRoot: - description: |- - Indicates that the container must run as a non-root user. - If true, the Kubelet will validate the image at runtime to ensure that it - does not run as UID 0 (root) and fail to start the container if it does. - If unset or false, no such validation will be performed. - May also be set in SecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - type: boolean - runAsUser: - description: |- - The UID to run the entrypoint of the container process. - Defaults to user specified in image metadata if unspecified. - May also be set in SecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence - for that container. - Note that this field cannot be set when spec.os.name is windows. - format: int64 - type: integer - seLinuxOptions: - description: |- - The SELinux context to be applied to all containers. - If unspecified, the container runtime will allocate a random SELinux context for each - container. May also be set in SecurityContext. If set in - both SecurityContext and PodSecurityContext, the value specified in SecurityContext - takes precedence for that container. - Note that this field cannot be set when spec.os.name is windows. - properties: - level: - description: Level is SELinux level label that applies - to the container. - type: string - role: - description: Role is a SELinux role label that applies - to the container. - type: string - type: - description: Type is a SELinux type label that applies - to the container. - type: string - user: - description: User is a SELinux user label that applies - to the container. - type: string - type: object - seccompProfile: - description: |- - The seccomp options to use by the containers in this pod. - Note that this field cannot be set when spec.os.name is windows. - properties: - localhostProfile: - description: |- - localhostProfile indicates a profile defined in a file on the node should be used. - The profile must be preconfigured on the node to work. - Must be a descending path, relative to the kubelet's configured seccomp profile location. - Must only be set if type is "Localhost". - type: string - type: - description: |- - type indicates which kind of seccomp profile will be applied. - Valid options are: - - Localhost - a profile defined in a file on the node should be used. - RuntimeDefault - the container runtime default profile should be used. - Unconfined - no profile should be applied. - type: string - required: - - type - type: object - supplementalGroups: - description: |- - A list of groups applied to the first process run in each container, in addition - to the container's primary GID, the fsGroup (if specified), and group memberships - defined in the container image for the uid of the container process. If unspecified, - no additional groups are added to any container. Note that group memberships - defined in the container image for the uid of the container process are still effective, - even if they are not included in this list. - Note that this field cannot be set when spec.os.name is windows. - items: - format: int64 - type: integer - type: array - sysctls: - description: |- - Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported - sysctls (by the container runtime) might fail to launch. - Note that this field cannot be set when spec.os.name is windows. - items: - description: Sysctl defines a kernel parameter to be set - properties: - name: - description: Name of a property to set - type: string - value: - description: Value of a property to set - type: string - required: - - name - - value - type: object - type: array - windowsOptions: - description: |- - The Windows specific settings applied to all containers. - If unspecified, the options within a container's SecurityContext will be used. - If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. - Note that this field cannot be set when spec.os.name is linux. - properties: - gmsaCredentialSpec: - description: |- - GMSACredentialSpec is where the GMSA admission webhook - (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the - GMSA credential spec named by the GMSACredentialSpecName field. - type: string - gmsaCredentialSpecName: - description: GMSACredentialSpecName is the name of the - GMSA credential spec to use. - type: string - hostProcess: - description: |- - HostProcess determines if a container should be run as a 'Host Process' container. - This field is alpha-level and will only be honored by components that enable the - WindowsHostProcessContainers feature flag. Setting this field without the feature - flag will result in errors when validating the Pod. All of a Pod's containers must - have the same effective HostProcess value (it is not allowed to have a mix of HostProcess - containers and non-HostProcess containers). In addition, if HostProcess is true - then HostNetwork must also be set to true. - type: boolean - runAsUserName: - description: |- - The UserName in Windows to run the entrypoint of the container process. - Defaults to the user specified in image metadata if unspecified. - May also be set in PodSecurityContext. If set in both SecurityContext and - PodSecurityContext, the value specified in SecurityContext takes precedence. - type: string - type: object - type: object - service: - description: export metaservice for accessing from outside k8s. - properties: - annotations: - additionalProperties: - type: string - description: Annotations for using function on different cloud - platform. - type: object - loadBalancerIP: - description: |- - Only applies to Service Type: LoadBalancer. - This feature depends on whether the underlying cloud-provider supports specifying - the loadBalancerIP when a load balancer is created. - This field will be ignored if the cloud-provider does not support the feature. - This field was under-specified and its meaning varies across implementations, - and it cannot support dual-stack. - As of Kubernetes v1.24, users are encouraged to use implementation-specific annotations when available. - This field may be removed in a future API version. - type: string - portMaps: - description: PortMaps specify node port for target port in - pod, when the service type=NodePort. - items: - description: PortMap for ServiceType=NodePort situation. - properties: - nodePort: - description: |- - The port on each node on which this service is exposed when type is - NodePort or LoadBalancer. Usually assigned by the system. If a value is - specified, in-range, and not in use it will be used, otherwise the - operation will fail. If not specified, a port will be allocated if this - Service requires one. If this field is specified when creating a - Service which does not need it, creation will fail. This field will be - wiped when updating a Service to no longer need it (e.g. changing type - from NodePort to ClusterIP). - More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport - need in 30000-32767 - format: int32 - type: integer - targetPort: - description: |- - Number or name of the port to access on the pods targeted by the service. - Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. - If this is a string, it will be looked up as a named port in the - target Pod's container ports. If this is not specified, the value - of the 'port' field is used (an identity map). - This field is ignored for services with clusterIP=None, and should be - omitted or set equal to the 'port' field. - More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service - format: int32 - type: integer - type: object - type: array - type: - description: |- - type of service,the possible value for the service type are : ClusterIP, NodePort, LoadBalancer,ExternalName. - More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types - type: string - type: object - serviceAccount: - type: string - tolerations: - description: (Optional) Tolerations for scheduling pods onto some - dedicated nodes - items: - description: |- - The pod this Toleration is attached to tolerates any taint that matches - the triple using the matching operator . - properties: - effect: - description: |- - Effect indicates the taint effect to match. Empty means match all taint effects. - When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: |- - Key is the taint key that the toleration applies to. Empty means match all taint keys. - If the key is empty, operator must be Exists; this combination means to match all values and all keys. - type: string - operator: - description: |- - Operator represents a key's relationship to the value. - Valid operators are Exists and Equal. Defaults to Equal. - Exists is equivalent to wildcard for value, so that a pod can - tolerate all taints of a particular category. - type: string - tolerationSeconds: - description: |- - TolerationSeconds represents the period of time the toleration (which must be - of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, - it is not set, which means tolerate the taint forever (do not evict). Zero and - negative values will be treated as 0 (evict immediately) by the system. - format: int64 - type: integer - value: - description: |- - Value is the taint value the toleration matches to. - If the operator is Exists, the value should be empty, otherwise just a regular string. - type: string - type: object - type: array - type: object - type: object - status: - properties: - fdbStatus: - description: 'describe the fdb status information: contains access - address, fdb available or not, etc...' - properties: - FDBAddress: - description: FDBAddress describe the address for fdbclient using. - type: string - availableStatus: - description: AvailableStatus represents the fdb available or not. - type: string - fdbResourceName: - description: FDBResourceName specify the name of the kind `FoundationDBCluster` - resource. - type: string - type: object - msStatus: - description: describe the ms status. - properties: - availableStatus: - description: AvailableStatus represents the metaservice available - or not. - type: string - phase: - description: Phase represent the stage of reconciling. - type: string - type: object - recyclerStatus: - description: descirbe the recycler status. - properties: - availableStatus: - description: AvailableStatus represents the metaservice available - or not. - type: string - phase: - description: Phase represent the stage of reconciling. - type: string - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/config/crd/bases/doris.apache.com_dorisclusters.yaml b/config/crd/bases/doris.apache.com_dorisclusters.yaml index 915eb7e..11fc463 100644 --- a/config/crd/bases/doris.apache.com_dorisclusters.yaml +++ b/config/crd/bases/doris.apache.com_dorisclusters.yaml @@ -1562,9 +1562,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. @@ -3363,9 +3363,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. @@ -5781,9 +5781,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. @@ -7582,9 +7582,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. diff --git a/config/crd/bases/doris.selectdb.com_dorisclusters.yaml b/config/crd/bases/doris.selectdb.com_dorisclusters.yaml index 915eb7e..11fc463 100644 --- a/config/crd/bases/doris.selectdb.com_dorisclusters.yaml +++ b/config/crd/bases/doris.selectdb.com_dorisclusters.yaml @@ -1562,9 +1562,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. @@ -3363,9 +3363,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. @@ -5781,9 +5781,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. @@ -7582,9 +7582,9 @@ spec: items: properties: mountPath: - description: Current Secret Mount Path, default is "/etc/doris" - If Secret belongs to the same Secrets, their MountPath - can't be repeated. + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. type: string secretName: description: name of secret that needs to mount. diff --git a/helm-charts/doris-operator/crds/doris.apache.com_dorisclusters.yaml b/helm-charts/doris-operator/crds/doris.apache.com_dorisclusters.yaml index d7a1740..11fc463 100644 --- a/helm-charts/doris-operator/crds/doris.apache.com_dorisclusters.yaml +++ b/helm-charts/doris-operator/crds/doris.apache.com_dorisclusters.yaml @@ -1557,6 +1557,20 @@ spec: otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object + secrets: + description: Multi Secret for pod. + items: + properties: + mountPath: + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. + type: string + secretName: + description: name of secret that needs to mount. + type: string + type: object + type: array securityContext: description: Security context for pod. properties: @@ -3344,6 +3358,20 @@ spec: otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object + secrets: + description: Multi Secret for pod. + items: + properties: + mountPath: + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. + type: string + secretName: + description: name of secret that needs to mount. + type: string + type: object + type: array securityContext: description: Security context for pod. properties: @@ -5748,6 +5776,20 @@ spec: otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object + secrets: + description: Multi Secret for pod. + items: + properties: + mountPath: + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. + type: string + secretName: + description: name of secret that needs to mount. + type: string + type: object + type: array securityContext: description: Security context for pod. properties: @@ -7535,6 +7577,20 @@ spec: otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ type: object + secrets: + description: Multi Secret for pod. + items: + properties: + mountPath: + description: |- + Current Secret Mount Path, default is "/etc/doris" + If Secret belongs to the same Secrets, their mountPath can't be repeated. + type: string + secretName: + description: name of secret that needs to mount. + type: string + type: object + type: array securityContext: description: Security context for pod. properties: diff --git a/pkg/common/utils/k8s/client.go b/pkg/common/utils/k8s/client.go index 6976037..226c7b3 100644 --- a/pkg/common/utils/k8s/client.go +++ b/pkg/common/utils/k8s/client.go @@ -22,7 +22,6 @@ import ( "errors" "fmt" "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2" - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" dorisv1 "github.com/apache/doris-operator/api/doris/v1" "github.com/apache/doris-operator/pkg/common/utils" "github.com/apache/doris-operator/pkg/common/utils/resource" @@ -297,22 +296,6 @@ func GetConfig(ctx context.Context, k8sclient client.Client, configMapInfo *dori return res, utils.MergeError(err, resolveErr) } -func GetDisaggregatedMetaServiceConfigMaps(ctx context.Context, k8scient client.Client, namespace string, cms []mv1.ConfigMap) ([]*corev1.ConfigMap, error) { - var configMaps []*corev1.ConfigMap - errMessage := "" - for _, cm := range cms { - var configMap corev1.ConfigMap - if getErr := k8scient.Get(ctx, types.NamespacedName{Namespace: namespace, Name: cm.Name}, &configMap); getErr != nil { - errMessage = errMessage + fmt.Sprintf("(name: %s, namespace: %s, err: %s), ", cm.Name, namespace, getErr.Error()) - } - configMaps = append(configMaps, &configMap) - } - if errMessage != "" { - return configMaps, errors.New("Failed to get configmap: " + errMessage) - } - return configMaps, nil -} - // ApplyFoundationDBCluster apply FoundationDBCluster to apiserver. func ApplyFoundationDBCluster(ctx context.Context, k8sclient client.Client, fdb *v1beta2.FoundationDBCluster) error { var efdb v1beta2.FoundationDBCluster diff --git a/pkg/common/utils/resource/configmap.go b/pkg/common/utils/resource/configmap.go index 35e16cf..60e215c 100644 --- a/pkg/common/utils/resource/configmap.go +++ b/pkg/common/utils/resource/configmap.go @@ -50,12 +50,12 @@ const ( CN_RESOLVEKEY = "be.conf" BROKER_RESOLVEKEY = "apache_hdfs_broker.conf" MS_RESOLVEKEY = "doris_cloud.conf" - RC_RESOLVEKEY = "doris_cloud.conf" DefaultMsToken = "greedisgood9999" DefaultMsTokenKey = "http_token" ) const ARROW_FLIGHT_SQL_PORT = "arrow_flight_sql_port" +const BRPC_LISTEN_PORT = "brpc_listen_port" const BROKER_IPC_PORT = "broker_ipc_port" const GRACE_SHUTDOWN_WAIT_SECONDS = "grace_shutdown_wait_seconds" diff --git a/pkg/common/utils/resource/configmap_disaggregated_ms.go b/pkg/common/utils/resource/configmap_disaggregated_ms.go deleted file mode 100644 index ff99077..0000000 --- a/pkg/common/utils/resource/configmap_disaggregated_ms.go +++ /dev/null @@ -1,59 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 resource - -import ( - "bytes" - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/spf13/viper" - corev1 "k8s.io/api/core/v1" - "k8s.io/klog/v2" -) - -// the ports key - -const ( - BRPC_LISTEN_PORT = "brpc_listen_port" -) - -func getDefaultDMSResolveKey(componentType mv1.ComponentType) string { - switch componentType { - case mv1.Component_MS: - return MS_RESOLVEKEY - case mv1.Component_RC: - return RC_RESOLVEKEY - default: - klog.Infof("the componentType: %s have not default ResolveKey", componentType) - } - return "" -} - -func ResolveDMSConfigMaps(configMaps []*corev1.ConfigMap, componentType mv1.ComponentType) (map[string]interface{}, error) { - key := getDefaultDMSResolveKey(componentType) - for _, configMap := range configMaps { - if configMap == nil { - continue - } - if value, ok := configMap.Data[key]; ok { - viper.SetConfigType("properties") - viper.ReadConfig(bytes.NewBuffer([]byte(value))) - return viper.AllSettings(), nil - } - } - return make(map[string]interface{}), nil -} diff --git a/pkg/common/utils/resource/pod_disaggregated_ms.go b/pkg/common/utils/resource/pod_disaggregated_ms.go deleted file mode 100644 index 7a457b7..0000000 --- a/pkg/common/utils/resource/pod_disaggregated_ms.go +++ /dev/null @@ -1,342 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 resource - -import ( - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/common/utils/metadata" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog/v2" - "path/filepath" -) - -const ( - START_MS_COMMAND = "/opt/apache-doris/ms_disaggregated_entrypoint.sh" - START_RC_COMMAND = "/opt/apache-doris/ms_disaggregated_entrypoint.sh" - START_MS_PARAMETER = "meta-service" - START_RC_PARAMETER = "recycler" - HEALTH_MS_PROBE_COMMAND = "/opt/apache-doris/ms_disaggregated_probe.sh" - PRESTOP_MS_COMMAND = "/opt/apache-doris/ms_disaggregated_prestop.sh" - MS_Log_Key = "log_dir" - Default_MS_Log_Path = "/opt/apache-doris/ms/log/" -) - -func NewDMSPodTemplateSpec(dms *mv1.DorisDisaggregatedMetaService, componentType mv1.ComponentType) corev1.PodTemplateSpec { - spec, _ := GetDMSBaseSpecFromCluster(dms, componentType) - volumes := newVolumesFromDMSBaseSpec(*spec) - dmsAffinity := spec.Affinity - SecurityContext := spec.SecurityContext - - //map pod labels and annotations into pod - volumes, _ = appendPodInfoVolumesVolumeMounts(volumes, nil) - - if len(spec.ConfigMaps) != 0 { - configVolumes, _ := getConfigmapVolumeAndVolumeMount(spec.ConfigMaps) - volumes = append(volumes, configVolumes...) - } - - pts := corev1.PodTemplateSpec{ - ObjectMeta: metav1.ObjectMeta{ - Name: generateDMSPodTemplateName(dms, componentType), - Annotations: spec.Annotations, - Labels: mv1.GetPodLabels(dms, componentType), - }, - - Spec: corev1.PodSpec{ - ImagePullSecrets: spec.ImagePullSecrets, - NodeSelector: spec.NodeSelector, - Volumes: volumes, - ServiceAccountName: spec.ServiceAccount, - Affinity: spec.Affinity, - Tolerations: spec.Tolerations, - HostAliases: spec.HostAliases, - SecurityContext: SecurityContext, - }, - } - - pts.Spec.Affinity = constructDMSAffinity(dmsAffinity, componentType) - return pts -} - -// newVolumesFromBaseSpec return corev1.Volume build from baseSpec. -func newVolumesFromDMSBaseSpec(spec mv1.BaseSpec) []corev1.Volume { - var volumes []corev1.Volume - if spec.PersistentVolume == nil { - return volumes - } - - //construct log volume - v := corev1.Volume{} - v.Name = defaultLogPrefixName - v.VolumeSource = corev1.VolumeSource{ - PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ - ClaimName: defaultLogPrefixName, - }, - } - - volumes = append(volumes, v) - - return volumes -} - -// buildVolumeMounts construct all volumeMounts contains default volumeMounts if persistentVolumes not definition. -func buildDMSVolumeMounts(spec mv1.BaseSpec, config map[string]interface{}) []corev1.VolumeMount { - var volumeMounts []corev1.VolumeMount - _, volumeMounts = appendPodInfoVolumesVolumeMounts(nil, volumeMounts) - - if spec.PersistentVolume == nil { - return volumeMounts - } - - logPath := Default_MS_Log_Path - if p, ok := config[MS_Log_Key]; ok { - cp := p.(string) - //exclude the rel path interfere - if filepath.IsAbs(cp) { - logPath = cp - } else { - logPath = filepath.Join(Default_MS_Log_Path, cp) - } - } - vm := corev1.VolumeMount{} - vm.MountPath = logPath - vm.Name = defaultLogPrefixName - volumeMounts = append(volumeMounts, vm) - return volumeMounts -} - -func NewDMSBaseMainContainer(dms *mv1.DorisDisaggregatedMetaService, brpcPort int32, config map[string]interface{}, componentType mv1.ComponentType) corev1.Container { - var envs []corev1.EnvVar - spec, _ := GetDMSBaseSpecFromCluster(dms, componentType) - - command, args := buildDMSEntrypointCommand(componentType) - - fdbEndPoint := mv1.GetFDBEndPoint(dms) - envs = append(envs, buildDMSBaseEnvs()...) - envs = append(envs, - corev1.EnvVar{ - Name: FDB_ENDPOINT, - Value: fdbEndPoint, - }, corev1.EnvVar{ - Name: NAMESPACE, - ValueFrom: &corev1.EnvVarSource{ - FieldRef: &corev1.ObjectFieldSelector{ - APIVersion: "v1", - FieldPath: "metadata.namespace", - }, - }, - }, - ) - envs = mergeEnvs(envs, spec.EnvVars) - - volumeMounts := buildDMSVolumeMounts(*spec, config) - if len(spec.ConfigMaps) != 0 { - _, configVolumeMounts := getConfigmapVolumeAndVolumeMount(spec.ConfigMaps) - volumeMounts = append(volumeMounts, configVolumeMounts...) - } - - return corev1.Container{ - Image: spec.Image, - Command: command, - Args: args, - Ports: []corev1.ContainerPort{}, - Env: envs, - VolumeMounts: volumeMounts, - Resources: spec.ResourceRequirements, - LivenessProbe: dmsLivenessProbe(brpcPort), - StartupProbe: dmsStartupProbe(brpcPort), - ReadinessProbe: dmsReadinessProbe(brpcPort), - Lifecycle: &corev1.Lifecycle{ - PreStop: &corev1.LifecycleHandler{ - Exec: &corev1.ExecAction{ - Command: []string{PRESTOP_MS_COMMAND}, - }, - }, - }, - } -} - -func buildDMSBaseEnvs() []corev1.EnvVar { - defaultEnvs := []corev1.EnvVar{ - { - Name: POD_NAME, - ValueFrom: &corev1.EnvVarSource{ - FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.name"}, - }, - }, - { - Name: POD_IP, - ValueFrom: &corev1.EnvVarSource{ - FieldRef: &corev1.ObjectFieldSelector{FieldPath: "status.podIP"}, - }, - }, - { - Name: HOST_IP, - ValueFrom: &corev1.EnvVarSource{ - FieldRef: &corev1.ObjectFieldSelector{FieldPath: "status.hostIP"}, - }, - }, - { - Name: POD_NAMESPACE, - ValueFrom: &corev1.EnvVarSource{ - FieldRef: &corev1.ObjectFieldSelector{FieldPath: "metadata.namespace"}, - }, - }, - { - Name: config_env_name, - Value: config_env_path, - }, - { - Name: DORIS_ROOT, - Value: DEFAULT_ROOT_PATH, - }, - } - - return defaultEnvs -} - -func buildDMSEntrypointCommand(componentType mv1.ComponentType) (commands []string, args []string) { - switch componentType { - case mv1.Component_MS: - return []string{START_MS_COMMAND}, []string{START_MS_PARAMETER} - case mv1.Component_RC: - return []string{START_RC_COMMAND}, []string{START_RC_PARAMETER} - default: - klog.Infof("buildDMSEntrypointCommand the componentType %s is not supported.", componentType) - return []string{}, []string{} - } -} - -func generateDMSPodTemplateName(dms *mv1.DorisDisaggregatedMetaService, componentType mv1.ComponentType) string { - return dms.Name + "-" + string(componentType) -} - -func GetDMSBaseSpecFromCluster(dms *mv1.DorisDisaggregatedMetaService, componentType mv1.ComponentType) (*mv1.BaseSpec, *int32) { - var bSpec *mv1.BaseSpec - var replicas *int32 - switch componentType { - case mv1.Component_MS: - bSpec = &dms.Spec.MS.BaseSpec - replicas = metadata.GetInt32Pointer(mv1.DefaultMetaserviceNumber) - case mv1.Component_RC: - bSpec = &dms.Spec.Recycler.BaseSpec - replicas = metadata.GetInt32Pointer(mv1.DefaultRecyclerNumber) - default: - klog.Infof("the componentType %s is not supported!", componentType) - } - - return bSpec, replicas -} - -// getConfigmapVolumeAndVolumeMount get Volume And VolumeMount base on configmaps -func getConfigmapVolumeAndVolumeMount(cms []mv1.ConfigMap) ([]corev1.Volume, []corev1.VolumeMount) { - var volumes []corev1.Volume - var volumeMounts []corev1.VolumeMount - - for _, cm := range cms { - path := cm.MountPath - if cm.MountPath == "" { - path = config_env_path - } - volumes = append( - volumes, - corev1.Volume{ - Name: cm.Name, - VolumeSource: corev1.VolumeSource{ - ConfigMap: &corev1.ConfigMapVolumeSource{ - LocalObjectReference: corev1.LocalObjectReference{ - Name: cm.Name, - }, - }, - }, - }, - ) - - volumeMounts = append( - volumeMounts, - corev1.VolumeMount{ - Name: cm.Name, - MountPath: path, - }, - ) - } - - return volumes, volumeMounts -} - -// StartupProbe returns a startup probe. -func dmsStartupProbe(port int32) *corev1.Probe { - commands := []string{HEALTH_MS_PROBE_COMMAND, "alive"} - return startupProbe(port, 180, "", commands, Exec) -} - -// dmsLivenessProbe returns a liveness. -func dmsLivenessProbe(port int32) *corev1.Probe { - commands := []string{HEALTH_MS_PROBE_COMMAND, "alive"} - return livenessProbe(port, 180, "", commands, Exec) -} - -// ReadinessProbe returns a readiness probe. -func dmsReadinessProbe(port int32) *corev1.Probe { - commands := []string{HEALTH_MS_PROBE_COMMAND, "ready"} - return readinessProbe(port, "", commands, Exec) -} - -// getDMSDefaultAffinity build MS affinity rules based on default policy configuration -// MS default Affinity rule is : -// Pods of the same component should deploy on different hosts with Preferred scheduling. -// weight is 20, weight range is 1-100 -func getDMSDefaultAffinity(componentType mv1.ComponentType) *corev1.Affinity { - podAffinityTerm := corev1.WeightedPodAffinityTerm{ - Weight: 20, - PodAffinityTerm: corev1.PodAffinityTerm{ - LabelSelector: &metav1.LabelSelector{ - MatchExpressions: []metav1.LabelSelectorRequirement{ - {Key: mv1.ComponentLabelKey, Operator: metav1.LabelSelectorOpIn, Values: []string{string(componentType)}}, - }, - }, - TopologyKey: NODE_TOPOLOGYKEY, - }, - } - return &corev1.Affinity{ - PodAntiAffinity: &corev1.PodAntiAffinity{ - PreferredDuringSchedulingIgnoredDuringExecution: []corev1.WeightedPodAffinityTerm{podAffinityTerm}, - }, - } -} - -// constructDMSAffinity build MS affinity rules based on default policies and custom configurations -func constructDMSAffinity(dmsAffinity *corev1.Affinity, componentType mv1.ComponentType) *corev1.Affinity { - affinity := getDMSDefaultAffinity(componentType) - - if dmsAffinity == nil { - return affinity - } - - dmsPodAntiAffinity := dmsAffinity.PodAntiAffinity - if dmsPodAntiAffinity != nil { - affinity.PodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution = dmsPodAntiAffinity.RequiredDuringSchedulingIgnoredDuringExecution - affinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution = append(affinity.PodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution, dmsPodAntiAffinity.PreferredDuringSchedulingIgnoredDuringExecution...) - } - - affinity.NodeAffinity = dmsAffinity.NodeAffinity - affinity.PodAffinity = dmsAffinity.PodAffinity - - return affinity -} diff --git a/pkg/common/utils/resource/service_disaggregated_ms.go b/pkg/common/utils/resource/service_disaggregated_ms.go deleted file mode 100644 index c92663b..0000000 --- a/pkg/common/utils/resource/service_disaggregated_ms.go +++ /dev/null @@ -1,184 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 resource - -import ( - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/common/utils/hash" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/klog/v2" -) - -func BuildDMSService(ddm *mv1.DorisDisaggregatedMetaService, componentType mv1.ComponentType, brpcPort int32) corev1.Service { - labels := mv1.GenerateServiceLabels(ddm, componentType) - selector := mv1.GenerateServiceSelector(ddm, componentType) - spec, _ := GetDMSBaseSpecFromCluster(ddm, componentType) - exportService := spec.Service - - svc := corev1.Service{ - ObjectMeta: metav1.ObjectMeta{ - Name: mv1.GenerateCommunicateServiceName(ddm, componentType), - Namespace: ddm.Namespace, - Labels: labels, - OwnerReferences: []metav1.OwnerReference{ - metav1.OwnerReference{ - APIVersion: ddm.APIVersion, - Kind: ddm.Kind, - Name: ddm.Name, - UID: ddm.UID, - }, - }, - }} - - ports := []corev1.ServicePort{ - getDMSServicePort(brpcPort, componentType), - } - - constructDMSServiceSpec(exportService, &svc, selector, ports) - if exportService != nil { - svc.Annotations = exportService.Annotations - } - - return svc -} - -func getDMSServicePort(brpcPort int32, componentType mv1.ComponentType) corev1.ServicePort { - switch componentType { - case mv1.Component_MS: - return corev1.ServicePort{ - Name: GetPortKey(BRPC_LISTEN_PORT), - Port: brpcPort, - TargetPort: intstr.FromInt32(brpcPort), - } - case mv1.Component_RC: - return corev1.ServicePort{ - Name: GetPortKey(BRPC_LISTEN_PORT), - Port: brpcPort, - TargetPort: intstr.FromInt32(brpcPort), - } - default: - klog.Infof("getDMSInternalServicePort not supported the type %s", componentType) - return corev1.ServicePort{} - } -} - -func GetDMSContainerPorts(brpcPort int32, componentType mv1.ComponentType) []corev1.ContainerPort { - switch componentType { - case mv1.Component_MS: - return getMSContainerPorts(brpcPort) - case mv1.Component_RC: - return getMSContainerPorts(brpcPort) - default: - klog.Infof("GetDMSContainerPorts the componentType %s not supported.", componentType) - return []corev1.ContainerPort{} - } -} - -func getMSContainerPorts(brpcPort int32) []corev1.ContainerPort { - return []corev1.ContainerPort{{ - Name: GetPortKey(BRPC_LISTEN_PORT), - ContainerPort: brpcPort, - Protocol: corev1.ProtocolTCP, - }} -} - -func DMSServiceDeepEqual(newSvc, oldSvc *corev1.Service) bool { - var newHashValue, oldHashValue string - if _, ok := newSvc.Annotations[mv1.ComponentResourceHash]; ok { - newHashValue = newSvc.Annotations[mv1.ComponentResourceHash] - } else { - newHashService := dmsServiceHashObject(newSvc) - newHashValue = hash.HashObject(newHashService) - } - - if _, ok := oldSvc.Annotations[mv1.ComponentResourceHash]; ok { - oldHashValue = oldSvc.Annotations[mv1.ComponentResourceHash] - } else { - oldHashService := dmsServiceHashObject(oldSvc) - oldHashValue = hash.HashObject(oldHashService) - } - - // set hash value in annotation for avoiding deep equal. - newSvc.Annotations = mergeMaps(newSvc.Annotations, map[string]string{mv1.ComponentResourceHash: newHashValue}) - return newHashValue == oldHashValue && - newSvc.Namespace == oldSvc.Namespace -} - -// hash service for diff new generate service and old service in kubernetes. -func dmsServiceHashObject(svc *corev1.Service) hashService { - annos := make(map[string]string, len(svc.Annotations)) - //for support service annotations, avoid hash value in annotations interfere equal comparison. - for key, value := range svc.Annotations { - if key == mv1.ComponentResourceHash { - continue - } - - annos[key] = value - } - - return hashService{ - name: svc.Name, - namespace: svc.Namespace, - ports: svc.Spec.Ports, - selector: svc.Spec.Selector, - serviceType: svc.Spec.Type, - labels: svc.Labels, - annotations: annos, - } -} - -func constructDMSServiceSpec(exportService *mv1.ExportService, svc *corev1.Service, selector map[string]string, ports []corev1.ServicePort) { - var portMaps []mv1.PortMap - if exportService != nil { - portMaps = exportService.PortMaps - } - - for _, portMap := range portMaps { - for i, _ := range ports { - if int(portMap.TargetPort) == ports[i].TargetPort.IntValue() { - ports[i].NodePort = portMap.NodePort - } - } - } - - svc.Spec = corev1.ServiceSpec{ - Selector: selector, - Ports: ports, - SessionAffinity: corev1.ServiceAffinityClientIP, - } - - // The external load balancer provided by the cloud provider may cause the client IP received by the service to change. - if exportService != nil && exportService.Type == corev1.ServiceTypeLoadBalancer { - svc.Spec.SessionAffinity = corev1.ServiceAffinityNone - } - - setDMSServiceType(exportService, svc) -} - -func setDMSServiceType(svc *mv1.ExportService, service *corev1.Service) { - service.Spec.Type = corev1.ServiceTypeClusterIP - if svc != nil && svc.Type != "" { - service.Spec.Type = svc.Type - } - - if service.Spec.Type == corev1.ServiceTypeLoadBalancer && svc.LoadBalancerIP != "" { - service.Spec.LoadBalancerIP = svc.LoadBalancerIP - } -} diff --git a/pkg/common/utils/resource/statefulset_disaggregated_ms.go b/pkg/common/utils/resource/statefulset_disaggregated_ms.go deleted file mode 100644 index ff1aea8..0000000 --- a/pkg/common/utils/resource/statefulset_disaggregated_ms.go +++ /dev/null @@ -1,120 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 resource - -import ( - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/common/utils/hash" - "github.com/apache/doris-operator/pkg/common/utils/metadata" - appv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog/v2" -) - -const ( - defaultRollingUpdateStartDMSPod int32 = 0 - defaultLogPrefixName = "log" - - defaultDMSImagePullPolicy corev1.PullPolicy = corev1.PullIfNotPresent -) - -// NewDMSStatefulSet construct statefulset for metaservice and recycler. -func NewDMSStatefulSet(dms *mv1.DorisDisaggregatedMetaService, componentType mv1.ComponentType) appv1.StatefulSet { - bSpec, replicas := GetDMSBaseSpecFromCluster(dms, componentType) - - orf := metav1.OwnerReference{ - APIVersion: dms.APIVersion, - Kind: dms.Kind, - Name: dms.Name, - UID: dms.UID, - } - - selector := metav1.LabelSelector{ - MatchLabels: mv1.GenerateStatefulSetSelector(dms, componentType), - } - - var volumeClaimTemplates []corev1.PersistentVolumeClaim - cpv := bSpec.PersistentVolume - if cpv != nil { - pvc := corev1.PersistentVolumeClaim{ - ObjectMeta: metav1.ObjectMeta{ - Name: defaultLogPrefixName, - Annotations: NewAnnotations(), - }, - Spec: cpv.PersistentVolumeClaimSpec, - } - volumeClaimTemplates = append(volumeClaimTemplates, pvc) - } - - st := appv1.StatefulSet{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: dms.Namespace, - Name: mv1.GenerateComponentStatefulSetName(dms, componentType), - Labels: mv1.GenerateStatefulSetLabels(dms, componentType), - OwnerReferences: []metav1.OwnerReference{orf}, - }, - - Spec: appv1.StatefulSetSpec{ - Replicas: replicas, - Selector: &selector, - Template: NewDMSPodTemplateSpec(dms, componentType), - VolumeClaimTemplates: volumeClaimTemplates, - ServiceName: mv1.GenerateCommunicateServiceName(dms, componentType), - RevisionHistoryLimit: metadata.GetInt32Pointer(5), - UpdateStrategy: appv1.StatefulSetUpdateStrategy{ - Type: appv1.RollingUpdateStatefulSetStrategyType, - RollingUpdate: &appv1.RollingUpdateStatefulSetStrategy{ - Partition: metadata.GetInt32Pointer(defaultRollingUpdateStartDMSPod), - }, - }, - // ParallelPodManagement will create and delete pods as soon as the stateful set replica count is changed, and will not wait for pods to be ready or complete - PodManagementPolicy: appv1.ParallelPodManagement, - }, - } - - return st -} - -// StatefulSetDeepEqual judge two statefulset equal or not. -func DMSStatefulSetDeepEqual(new *appv1.StatefulSet, old *appv1.StatefulSet, excludeReplicas bool) bool { - var newHashv, oldHashv string - - if _, ok := new.Annotations[mv1.ComponentResourceHash]; ok { - newHashv = new.Annotations[mv1.ComponentResourceHash] - } else { - newHso := statefulSetHashObject(new, excludeReplicas) - newHashv = hash.HashObject(newHso) - } - - if _, ok := old.Annotations[mv1.ComponentResourceHash]; ok { - oldHashv = old.Annotations[mv1.ComponentResourceHash] - } else { - oldHso := statefulSetHashObject(old, excludeReplicas) - oldHashv = hash.HashObject(oldHso) - } - - anno := Annotations{} - anno.AddAnnotation(new.Annotations) - anno.Add(mv1.ComponentResourceHash, newHashv) - new.Annotations = anno - - klog.Info("the statefulset name "+new.Name+" new hash value ", newHashv, " old have value ", oldHashv) - return newHashv == oldHashv && - new.Namespace == old.Namespace -} diff --git a/pkg/controller/disaggregated_metaservice_controller.go b/pkg/controller/disaggregated_metaservice_controller.go deleted file mode 100644 index a8ce87a..0000000 --- a/pkg/controller/disaggregated_metaservice_controller.go +++ /dev/null @@ -1,178 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 controller - -import ( - "context" - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/controller/sub_controller" - "github.com/apache/doris-operator/pkg/controller/sub_controller/disaggregated_metaservice/fdb" - "github.com/apache/doris-operator/pkg/controller/sub_controller/disaggregated_metaservice/ms" - "github.com/apache/doris-operator/pkg/controller/sub_controller/disaggregated_metaservice/recycler" - "github.com/google/go-cmp/cmp" - appv1 "k8s.io/api/apps/v1" - corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/tools/record" - "k8s.io/client-go/util/retry" - "k8s.io/klog/v2" - "os" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - "time" -) - -var ( - _ reconcile.Reconciler = &DisaggregatedMetaServiceReconciler{} - - _ Controller = &DisaggregatedMetaServiceReconciler{} -) - -var ( - disaggregatedMetaServiceControllerName = "disaggregatedMetaServiceControllerName" -) - -type DisaggregatedMetaServiceReconciler struct { - client.Client - Recorder record.EventRecorder - Scheme *runtime.Scheme - Scs map[string]sub_controller.DisaggregatedSubController -} - -func (dmsr *DisaggregatedMetaServiceReconciler) Init(mgr ctrl.Manager, options *Options) { - scs := make(map[string]sub_controller.DisaggregatedSubController) - dfdbc := fdb.New(mgr) - scs[dfdbc.GetControllerName()] = dfdbc - dmsc := ms.New(mgr) - scs[dmsc.GetControllerName()] = dmsc - dryc := recycler.New(mgr) - scs[dryc.GetControllerName()] = dryc - - if err := (&DisaggregatedMetaServiceReconciler{ - Client: mgr.GetClient(), - Recorder: mgr.GetEventRecorderFor(disaggregatedMetaServiceControllerName), - Scs: scs, - }).SetupWithManager(mgr); err != nil { - klog.Error(err, "unable to create controller ", "disaggregatedMetaServiceReconciler") - os.Exit(1) - } - - if options.EnableWebHook { - if err := (&mv1.DorisDisaggregatedMetaService{}).SetupWebhookWithManager(mgr); err != nil { - klog.Error(err, " unable to create unamedwatches ", " controller ", " DorisDisaggregatedMetaService ") - os.Exit(1) - } - } -} - -func (dmsr *DisaggregatedMetaServiceReconciler) SetupWithManager(mgr ctrl.Manager) error { - return dmsr.resourceBuilder(ctrl.NewControllerManagedBy(mgr)).Complete(dmsr) -} - -func (dmsr *DisaggregatedMetaServiceReconciler) resourceBuilder(builder *ctrl.Builder) *ctrl.Builder { - return builder.For(&mv1.DorisDisaggregatedMetaService{}).Owns(&appv1.StatefulSet{}).Owns(&corev1.Service{}) -} - -func (dmsr *DisaggregatedMetaServiceReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error) { - var dms mv1.DorisDisaggregatedMetaService - err := dmsr.Get(ctx, req.NamespacedName, &dms) - if apierrors.IsNotFound(err) { - klog.Warningf("disaggregatedMetaServiceReconciler not found resource DisaggregatedMetaService namespaceName %s", req.NamespacedName) - return ctrl.Result{}, nil - } else if err != nil { - klog.Errorf("disaggregatedMetaServiceReconciler DisaggregatedMetaService namespaceName %s not found.", req.NamespacedName) - return ctrl.Result{}, nil - } - - // clear Resources if statefulset delete - if dms.DeletionTimestamp != nil { - dmsr.resourceClean(ctx, &dms) - return ctrl.Result{}, nil - } - - for _, rc := range dmsr.Scs { - if err := rc.Sync(ctx, &dms); err != nil { - klog.Errorf("disaggregatedMetaServiceReconciler sub reconciler %s reconcile err=%s.", rc.GetControllerName(), err.Error()) - return requeueIfError(err) - } - } - - // clear pvc Resources if pod scale down - dmsr.resourceClean(ctx, &dms) - for _, rc := range dmsr.Scs { - if err := rc.UpdateComponentStatus(&dms); err != nil { - klog.Errorf("disaggregatedMetaServiceReconciler sub reconciler %s update status err=%s.", rc.GetControllerName(), err.Error()) - return requeueIfError(err) - } - } - - return dmsr.updateDisaggregatedMetaServiceStatus(ctx, &dms) -} - -// updateDisaggregatedMetaServiceStatus confirm and correct CR status and control reconcile according to the status. -func (dmsr *DisaggregatedMetaServiceReconciler) updateDisaggregatedMetaServiceStatus(ctx context.Context, dms *mv1.DorisDisaggregatedMetaService) (ctrl.Result, error) { - var edms mv1.DorisDisaggregatedMetaService - if err := dmsr.Get(ctx, types.NamespacedName{Namespace: dms.Namespace, Name: dms.Name}, &edms); err != nil { - return requeueIfError(err) - } - - // if the status is not equal before and now the status is not available should requeue. - if cmp.Equal(dms.Status, edms.Status) { - if needReconcile(edms) { - return ctrl.Result{RequeueAfter: 5 * time.Second}, nil - } - return ctrl.Result{}, nil - } - - dms.Status.DeepCopyInto(&edms.Status) - return ctrl.Result{}, retry.RetryOnConflict(retry.DefaultBackoff, func() error { - return dmsr.Client.Status().Update(ctx, &edms) - }) -} - -// resourceClean provides unified resource cleanup capabilities, including clearing CR marks and clearing some resources. -func (dmsr *DisaggregatedMetaServiceReconciler) resourceClean(ctx context.Context, dms *mv1.DorisDisaggregatedMetaService) { - for _, rc := range dmsr.Scs { - rc.ClearResources(ctx, dms) - } -} - -func needReconcile(dms mv1.DorisDisaggregatedMetaService) bool { - if dms.Spec.FDB != nil { - if dms.Status.FDBStatus.AvailableStatus == mv1.UnAvailable { - return true - } - } - - if dms.Spec.MS != nil { - if dms.Status.MSStatus.AvailableStatus == mv1.UnAvailable || dms.Status.MSStatus.Phase != mv1.Ready { - return true - } - } - - if dms.Spec.Recycler != nil { - if dms.Status.RecyclerStatus.AvailableStatus == mv1.UnAvailable || dms.Status.RecyclerStatus.Phase != mv1.Ready { - return true - } - } - - return false -} diff --git a/pkg/controller/sub_controller/disaggregated_cluster/computegroups/controller.go b/pkg/controller/sub_controller/disaggregated_cluster/computegroups/controller.go index 5c17bc2..1846517 100644 --- a/pkg/controller/sub_controller/disaggregated_cluster/computegroups/controller.go +++ b/pkg/controller/sub_controller/disaggregated_cluster/computegroups/controller.go @@ -258,6 +258,11 @@ func (dcgs *DisaggregatedComputeGroupsController) validateRegex(cgs []dv1.Comput // clear not configed cg resources, delete not configed cg status from ddc.status . func (dcgs *DisaggregatedComputeGroupsController) ClearResources(ctx context.Context, obj client.Object) (bool, error) { ddc := obj.(*dv1.DorisDisaggregatedCluster) + + if !dcgs.feAvailable(ddc) { + return false, nil + } + var clearCGs []dv1.ComputeGroupStatus var eCGs []dv1.ComputeGroupStatus @@ -278,6 +283,7 @@ func (dcgs *DisaggregatedComputeGroupsController) ClearResources(ctx context.Con if err != nil { klog.Errorf("computeGroupSync ClearResources dropCGBySQLClient getMasterSqlClient failed: %s", err.Error()) dcgs.K8srecorder.Event(ddc, string(sc.EventWarning), string(sc.CGSqlExecFailed), "computeGroupSync dropCGBySQLClient failed: "+err.Error()) + return false, err } defer sqlClient.Close() diff --git a/pkg/controller/sub_controller/disaggregated_metaservice/fdb/controller.go b/pkg/controller/sub_controller/disaggregated_metaservice/fdb/controller.go deleted file mode 100644 index a291fad..0000000 --- a/pkg/controller/sub_controller/disaggregated_metaservice/fdb/controller.go +++ /dev/null @@ -1,245 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 fdb - -import ( - "context" - "errors" - "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2" - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/common/utils/k8s" - sc "github.com/apache/doris-operator/pkg/controller/sub_controller" - corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/tools/record" - "k8s.io/klog/v2" - "k8s.io/utils/pointer" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -var _ sc.DisaggregatedSubController = &DisaggregatedFDBController{} - -var ( - disaggregatedFDBController = "disaggregatedFDBController" -) - -type DisaggregatedFDBController struct { - k8sClient client.Client - k8sRecorder record.EventRecorder - controllerName string -} - -func New(mgr ctrl.Manager) *DisaggregatedFDBController { - return &DisaggregatedFDBController{ - k8sClient: mgr.GetClient(), - k8sRecorder: mgr.GetEventRecorderFor(disaggregatedFDBController), - controllerName: disaggregatedFDBController, - } -} - -// sync FoundationDBCluster -func (fdbc *DisaggregatedFDBController) Sync(ctx context.Context, obj client.Object) error { - ddm := obj.(*mv1.DorisDisaggregatedMetaService) - if ddm.Spec.FDB == nil { - klog.Errorf("disaggregatedFDBController disaggregatedMetaService namespace=%s name=%s have not fdb spec.!", ddm.Namespace, ddm.Name) - fdbc.k8sRecorder.Event(ddm, "Failed", string(sc.FDBSpecEmpty), "disaggregatedMetaService fdb spec not empty!") - return errors.New("disaggregatedMetaService namespace=" + ddm.Namespace + " name=" + ddm.Name + "fdb spec empty!") - } - - fdb := fdbc.buildFDBClusterResource(ddm) - return k8s.ApplyFoundationDBCluster(ctx, fdbc.k8sClient, fdb) -} - -// convert DorisDisaggregatedMetaSerivce's fdb to FoundationDBCluster resource. -func (fdbc *DisaggregatedFDBController) buildFDBClusterResource(ddm *mv1.DorisDisaggregatedMetaService) *v1beta2.FoundationDBCluster { - fdb := &v1beta2.FoundationDBCluster{ - ObjectMeta: metav1.ObjectMeta{ - Namespace: ddm.Namespace, - Name: ddm.GenerateFDBClusterName(), - Labels: ddm.GenerateFDBLabels(), - Finalizers: []string{ddm.Name}, - //delete ownerReference to prevent mistake delete ddm. - //OwnerReferences: []metav1.OwnerReference{ - // { - // APIVersion: ddms.APIVersion, - // Kind: ddms.Kind, - // Name: ddms.Name, - // UID: ddms.UID, - // }, - //}, - }, - - Spec: v1beta2.FoundationDBClusterSpec{ - Version: FoundationVersion, - AutomationOptions: v1beta2.FoundationDBClusterAutomationOptions{ - DeletionMode: v1beta2.PodUpdateModeZone, - PodUpdateStrategy: v1beta2.PodUpdateStrategyTransactionReplacement, - RemovalMode: v1beta2.PodUpdateModeZone, - Replacements: v1beta2.AutomaticReplacementOptions{ - Enabled: pointer.Bool(true), - MaxConcurrentReplacements: pointer.Int(1), - }, - }, - LabelConfig: v1beta2.LabelConfig{ - MatchLabels: ddm.GenerateFDBLabels(), - ProcessClassLabels: []string{ProcessClassLabel}, - ProcessGroupIDLabels: []string{ProcessGroupIDLabel}, - FilterOnOwnerReferences: pointer.Bool(false), - }, - MinimumUptimeSecondsForBounce: 60, - ProcessCounts: v1beta2.ProcessCounts{ - ClusterController: 1, - Stateless: -1, - Log: 2, - Storage: 2, - }, - - Processes: map[v1beta2.ProcessClass]v1beta2.ProcessSettings{ - v1beta2.ProcessClassGeneral: v1beta2.ProcessSettings{ - PodTemplate: fdbc.buildGeneralPodTemplate(ddm.Spec.FDB), - VolumeClaimTemplate: ddm.Spec.FDB.VolumeClaimTemplate, - }, - }, - - Routing: v1beta2.RoutingConfig{ - UseDNSInClusterFile: pointer.Bool(true), - }, - SidecarContainer: v1beta2.ContainerOverrides{ - EnableLivenessProbe: pointer.Bool(true), - EnableReadinessProbe: pointer.Bool(false)}, - - Skip: false, - UseExplicitListenAddress: pointer.Bool(true), - ReplaceInstancesWhenResourcesChange: pointer.Bool(true), - }, - } - - mainContainer, err := fdbImageOverride(ddm.Spec.FDB.Image) - if err != nil { - klog.Infof("disaggregatedFDBController split config Image error, err=%s", err.Error()) - fdbc.k8sRecorder.Event(ddm, "Warning", string(sc.ImageFormatError), ddm.Spec.FDB.Image+" format not provided, please reference docker definition.") - return fdb - } - fdb.Spec.MainContainer = mainContainer - - sidecarContainer, err := fdbSidecarImageOverride(ddm.Spec.FDB.SidecarImage) - if err != nil { - klog.Infof("disaggregatedFDBController split config SidecarImage error, err=%s", err.Error()) - fdbc.k8sRecorder.Event(ddm, "Warning", string(sc.ImageFormatError), ddm.Spec.FDB.SidecarImage+" format not provided, please reference docker definition.") - return fdb - } - fdb.Spec.SidecarContainer = sidecarContainer - return fdb -} - -func (fdbc *DisaggregatedFDBController) buildGeneralPodTemplate(fdb *mv1.FoundationDB) *corev1.PodTemplateSpec { - return &corev1.PodTemplateSpec{ - Spec: corev1.PodSpec{ - Containers: []corev1.Container{fdbc.buildFDBContainer(fdb), fdbc.buildDefaultFDBSidecarContainer()}, - InitContainers: []corev1.Container{fdbc.buildDefaultFDBInitContainer()}, - NodeSelector: fdb.NodeSelector, - Affinity: fdb.Affinity, - Tolerations: fdb.Tolerations, - }, - } -} - -// construct the fdb container for running fdb server. -func (fdbc *DisaggregatedFDBController) buildFDBContainer(fdb *mv1.FoundationDB) corev1.Container { - return corev1.Container{ - Name: v1beta2.MainContainerName, - Resources: fdb.ResourceRequirements, - SecurityContext: &corev1.SecurityContext{ - RunAsUser: pointer.Int64(0), - }, - } -} - -// construct the init container for initialing environment of fdb. -func (fdbc *DisaggregatedFDBController) buildDefaultFDBInitContainer() corev1.Container { - return corev1.Container{ - Name: v1beta2.InitContainerName, - Resources: getDefaultResources(), - SecurityContext: &corev1.SecurityContext{ - RunAsUser: pointer.Int64(0), - }, - } -} - -// construct the sidecar container for -func (fdbc *DisaggregatedFDBController) buildDefaultFDBSidecarContainer() corev1.Container { - return corev1.Container{ - Name: v1beta2.SidecarContainerName, - Resources: getDefaultResources(), - SecurityContext: &corev1.SecurityContext{ - RunAsUser: pointer.Int64(0), - }, - } -} - -func (fdbc *DisaggregatedFDBController) ClearResources(ctx context.Context, obj client.Object) (bool, error) { - ddm := obj.(*mv1.DorisDisaggregatedMetaService) - - if ddm.DeletionTimestamp.IsZero() { - return true, nil - } - - fdbClusterName := ddm.GenerateFDBClusterName() - if err := k8s.DeleteFoundationDBCluster(ctx, fdbc.k8sClient, ddm.Namespace, ddm.Name); err != nil { - klog.Errorf("disaggregatedFDBController delete foundationDBCluster name %s failed,err=%s.", fdbClusterName, err.Error()) - return false, err - } - return true, nil -} - -func (fdbc *DisaggregatedFDBController) GetControllerName() string { - return fdbc.controllerName -} - -func (fdbc *DisaggregatedFDBController) UpdateComponentStatus(obj client.Object) error { - ddm := obj.(*mv1.DorisDisaggregatedMetaService) - fdbClusterName := ddm.GenerateFDBClusterName() - var fdb v1beta2.FoundationDBCluster - if err := fdbc.k8sClient.Get(context.Background(), types.NamespacedName{Name: fdbClusterName, Namespace: ddm.Namespace}, &fdb); err != nil { - if apierrors.IsNotFound(err) { - klog.Infof("disaggregatedFDBController foundationDBCluster name =%s not found.", fdbClusterName) - return nil - } - - klog.Errorf("disaggregatedFDBController foundationDBCluster name=%s get failed, err=%s", fdbClusterName, err.Error()) - return err - } - - ddm.Status.FDBStatus.FDBResourceName = fdbClusterName - ddm.Status.FDBStatus.FDBAddress = fdb.Status.ConnectionString - ddm.Status.FDBStatus.AvailableStatus = mv1.UnAvailable - //use fdbcluster's Healthy and available for checking fdb normal or not normal. - //Healthy reports whether the database is in a fully healthy state. - //Available reports whether the database is accepting reads and writes. - if fdb.Status.Health.Available { - if fdb.Status.Health.Healthy == false { - fdbc.k8sRecorder.Event(ddm, string(sc.EventNormal), string(sc.FDBAvailableButUnhealth), "disaggregatedMetaService fdb status is not Healthy, but Available!") - } - ddm.Status.FDBStatus.AvailableStatus = mv1.Available - } - - return nil -} diff --git a/pkg/controller/sub_controller/disaggregated_metaservice/fdb/default.go b/pkg/controller/sub_controller/disaggregated_metaservice/fdb/default.go deleted file mode 100644 index 7d7fca6..0000000 --- a/pkg/controller/sub_controller/disaggregated_metaservice/fdb/default.go +++ /dev/null @@ -1,43 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 fdb - -import ( - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" -) - -var ( - FDBSpecHashValueKey = "disaggregated.cluster.doris.com/fdbspec.hash" - ProcessClassLabel = "disaggregated.cluster.doris.com/fdb-cluster-name" - ProcessGroupIDLabel = "disaggregated.cluster.doris.com/fdb-process-group-id" - FoundationVersion = "7.1.38" -) - -func getDefaultResources() corev1.ResourceRequirements { - return corev1.ResourceRequirements{ - Requests: map[corev1.ResourceName]resource.Quantity{ - corev1.ResourceCPU: resource.MustParse("100m"), - corev1.ResourceMemory: resource.MustParse("128Mi"), - }, - Limits: map[corev1.ResourceName]resource.Quantity{ - corev1.ResourceCPU: resource.MustParse("200m"), - corev1.ResourceMemory: resource.MustParse("128Mi"), - }, - } -} diff --git a/pkg/controller/sub_controller/disaggregated_metaservice/fdb/util.go b/pkg/controller/sub_controller/disaggregated_metaservice/fdb/util.go deleted file mode 100644 index b6d22b4..0000000 --- a/pkg/controller/sub_controller/disaggregated_metaservice/fdb/util.go +++ /dev/null @@ -1,82 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 fdb - -import ( - "errors" - "fmt" - "github.com/FoundationDB/fdb-kubernetes-operator/api/v1beta2" - "k8s.io/klog/v2" - "strings" -) - -const ( - DefaultFDBImage = "selectdb/foundationdb:7.1.38" - DefaultFDBSidecarImage = "selectdb/foundationdb-kubernetes-sidecar:7.1.36-1" -) - -// use ":" as IPS to split image as baseimage and version. -func imageSplit(image string) (baseImage, tag string, err error) { - isa := strings.Split(image, ":") - if len(isa) == 0 { - err = errors.New(fmt.Sprintf("the image = %s format is not provided. please reference docker format.", image)) - return - } - - baseImage = isa[0] - tag = isa[1] - return -} - -func fdbImageOverride(image string) (v1beta2.ContainerOverrides, error) { - if image == "" { - image = DefaultFDBImage - } - - return newContainerOverride(image) -} - -func newContainerOverride(image string) (v1beta2.ContainerOverrides, error) { - if image == "" { - return v1beta2.ContainerOverrides{}, errors.New("image is empty") - } - - bi, tag, err := imageSplit(image) - if err != nil { - klog.Infof("disaggregatedFDBController split config image error, err=%s", err.Error()) - return v1beta2.ContainerOverrides{}, err - - } - - return v1beta2.ContainerOverrides{ - ImageConfigs: []v1beta2.ImageConfig{ - v1beta2.ImageConfig{ - BaseImage: bi, - Tag: tag, - }, - }, - }, nil -} - -func fdbSidecarImageOverride(image string) (v1beta2.ContainerOverrides, error) { - if image == "" { - image = DefaultFDBSidecarImage - } - - return newContainerOverride(image) -} diff --git a/pkg/controller/sub_controller/disaggregated_metaservice/ms/controller.go b/pkg/controller/sub_controller/disaggregated_metaservice/ms/controller.go deleted file mode 100644 index 4029959..0000000 --- a/pkg/controller/sub_controller/disaggregated_metaservice/ms/controller.go +++ /dev/null @@ -1,131 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 ms - -import ( - "context" - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/common/utils/k8s" - "github.com/apache/doris-operator/pkg/common/utils/resource" - "github.com/apache/doris-operator/pkg/controller/sub_controller" - appv1 "k8s.io/api/apps/v1" - "k8s.io/klog/v2" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -type Controller struct { - sub_controller.DisaggregatedSubDefaultController -} - -var ( - disaggregatedMSController = "disaggregatedMSController" -) - -func New(mgr ctrl.Manager) *Controller { - return &Controller{ - sub_controller.DisaggregatedSubDefaultController{ - K8sclient: mgr.GetClient(), - K8srecorder: mgr.GetEventRecorderFor(disaggregatedMSController), - ControllerName: disaggregatedMSController, - }} -} - -func (msc *Controller) Sync(ctx context.Context, obj client.Object) error { - dms := obj.(*mv1.DorisDisaggregatedMetaService) - - if dms.Status.FDBStatus.AvailableStatus != mv1.Available { - klog.Info("MS Controller Sync: the FDB is UnAvailable namespace ", dms.Namespace, " disaggregated doris cluster name ", dms.Name) - return nil - } - - msc.initMSStatus(dms) - msSpec := dms.Spec.MS - - config, err := msc.GetMSConfig(ctx, msSpec.ConfigMaps, dms.Namespace, mv1.Component_MS) - if err != nil { - klog.Error("MS Controller Sync ", "resolve ms configmap failed, namespace ", dms.Namespace, " error :", err) - return err - } - - msc.CheckMSConfigMountPath(dms, mv1.Component_MS) - - // MS only Build Internal Service - service := resource.BuildDMSService(dms, mv1.Component_MS, resource.GetPort(config, resource.BRPC_LISTEN_PORT)) - if err = k8s.ApplyService(ctx, msc.K8sclient, &service, resource.DMSServiceDeepEqual); err != nil { - klog.Errorf("MS controller sync apply service name=%s, namespace=%s, clusterName=%s failed.message=%s.", - service.Name, service.Namespace, dms.Name, err.Error()) - return err - } - - // TODO prepareStatefulsetApply for scaling - st := msc.buildMSStatefulSet(dms) - - if err = k8s.ApplyStatefulSet(ctx, msc.K8sclient, &st, func(new *appv1.StatefulSet, old *appv1.StatefulSet) bool { - msc.RestrictConditionsEqual(new, old) - return resource.DMSStatefulSetDeepEqual(new, old, false) - }); err != nil { - klog.Errorf("MS controller sync statefulset name=%s, namespace=%s, disaggregated-metaservice-name=%s failed. message=%s.", - st.Name, st.Namespace, dms.Name, err.Error()) - return err - } - - return nil -} - -// ClearResources clear resources for MS -// clear deleted statefulset Resources When CR is marked as cleared -func (msc *Controller) ClearResources(ctx context.Context, obj client.Object) (bool, error) { - dms := obj.(*mv1.DorisDisaggregatedMetaService) - // DeletionTimestamp is IsZero means dms not delete - // clear deleted statefulset Resources - if dms.DeletionTimestamp.IsZero() { - return true, nil - } - - if dms.Spec.MS == nil { - return msc.ClearMSCommonResources(ctx, dms, mv1.Component_MS) - } - return true, nil -} - -func (msc *Controller) GetControllerName() string { - return msc.ControllerName -} - -func (msc *Controller) UpdateComponentStatus(obj client.Object) error { - dms := obj.(*mv1.DorisDisaggregatedMetaService) - - if dms.Spec.MS == nil { - return nil - } - return msc.ClassifyPodsByStatus(dms.Namespace, &dms.Status.MSStatus, mv1.GenerateStatefulSetSelector(dms, mv1.Component_MS), mv1.DefaultMetaserviceNumber) -} - -func (d *Controller) initMSStatus(dms *mv1.DorisDisaggregatedMetaService) { - initPhase := mv1.Creating - - if mv1.IsReconcilingStatusPhase(dms.Status.MSStatus.Phase) { - initPhase = dms.Status.MSStatus.Phase - } - status := mv1.BaseStatus{ - Phase: initPhase, - AvailableStatus: mv1.UnAvailable, - } - dms.Status.MSStatus = status -} diff --git a/pkg/controller/sub_controller/disaggregated_metaservice/ms/pod.go b/pkg/controller/sub_controller/disaggregated_metaservice/ms/pod.go deleted file mode 100644 index 9caa641..0000000 --- a/pkg/controller/sub_controller/disaggregated_metaservice/ms/pod.go +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 ms - -import ( - "context" - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/common/utils/resource" - corev1 "k8s.io/api/core/v1" -) - -func (dmc *Controller) buildMSPodTemplateSpec(dms *mv1.DorisDisaggregatedMetaService) corev1.PodTemplateSpec { - podTemplateSpec := resource.NewDMSPodTemplateSpec(dms, mv1.Component_MS) - var containers []corev1.Container - config, _ := dmc.GetMSConfig(context.Background(), dms.Spec.MS.ConfigMaps, dms.Namespace, mv1.Component_MS) - msContainer := dmc.msContainer(dms, config) - containers = append(containers, msContainer) - containers = resource.ApplySecurityContext(containers, dms.Spec.MS.ContainerSecurityContext) - podTemplateSpec.Spec.Containers = containers - return podTemplateSpec -} - -func (dmc *Controller) msContainer(dms *mv1.DorisDisaggregatedMetaService, config map[string]interface{}) corev1.Container { - brpcPort := resource.GetPort(config, resource.BRPC_LISTEN_PORT) - c := resource.NewDMSBaseMainContainer(dms, brpcPort, config, mv1.Component_MS) - - ports := resource.GetDMSContainerPorts(brpcPort, mv1.Component_MS) - c.Name = "metaservice" - c.Ports = append(c.Ports, ports...) - - return c -} diff --git a/pkg/controller/sub_controller/disaggregated_metaservice/ms/statefulset.go b/pkg/controller/sub_controller/disaggregated_metaservice/ms/statefulset.go deleted file mode 100644 index 1b0bf06..0000000 --- a/pkg/controller/sub_controller/disaggregated_metaservice/ms/statefulset.go +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 ms - -import ( - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/common/utils/resource" - appv1 "k8s.io/api/apps/v1" -) - -func (msc *Controller) buildMSStatefulSet(dms *mv1.DorisDisaggregatedMetaService) appv1.StatefulSet { - st := resource.NewDMSStatefulSet(dms, mv1.Component_MS) - st.Spec.Template = msc.buildMSPodTemplateSpec(dms) - return st -} diff --git a/pkg/controller/sub_controller/disaggregated_metaservice/recycler/pod.go b/pkg/controller/sub_controller/disaggregated_metaservice/recycler/pod.go deleted file mode 100644 index 8542051..0000000 --- a/pkg/controller/sub_controller/disaggregated_metaservice/recycler/pod.go +++ /dev/null @@ -1,47 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 recycler - -import ( - "context" - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/common/utils/resource" - corev1 "k8s.io/api/core/v1" -) - -func (rc *RecyclerController) buildMSPodTemplateSpec(dms *mv1.DorisDisaggregatedMetaService) corev1.PodTemplateSpec { - podTemplateSpec := resource.NewDMSPodTemplateSpec(dms, mv1.Component_RC) - var containers []corev1.Container - config, _ := rc.GetMSConfig(context.Background(), dms.Spec.Recycler.ConfigMaps, dms.Namespace, mv1.Component_RC) - msContainer := rc.rcContainer(dms, config) - containers = append(containers, msContainer) - containers = resource.ApplySecurityContext(containers, dms.Spec.Recycler.ContainerSecurityContext) - podTemplateSpec.Spec.Containers = containers - return podTemplateSpec -} - -func (rc *RecyclerController) rcContainer(dms *mv1.DorisDisaggregatedMetaService, config map[string]interface{}) corev1.Container { - brpcPort := resource.GetPort(config, resource.BRPC_LISTEN_PORT) - c := resource.NewDMSBaseMainContainer(dms, brpcPort, config, mv1.Component_RC) - - ports := resource.GetDMSContainerPorts(brpcPort, mv1.Component_RC) - c.Name = "disaggregated-recycler" - c.Ports = append(c.Ports, ports...) - - return c -} diff --git a/pkg/controller/sub_controller/disaggregated_metaservice/recycler/recycler_controller.go b/pkg/controller/sub_controller/disaggregated_metaservice/recycler/recycler_controller.go deleted file mode 100644 index 70b30af..0000000 --- a/pkg/controller/sub_controller/disaggregated_metaservice/recycler/recycler_controller.go +++ /dev/null @@ -1,140 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 recycler - -import ( - "context" - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/common/utils/k8s" - "github.com/apache/doris-operator/pkg/common/utils/resource" - "github.com/apache/doris-operator/pkg/controller/sub_controller" - appv1 "k8s.io/api/apps/v1" - "k8s.io/klog/v2" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -type RecyclerController struct { - sub_controller.DisaggregatedSubDefaultController -} - -var ( - disaggregatedRecyclerController = "disaggregatedRecyclerController" -) - -func New(mgr ctrl.Manager) *RecyclerController { - return &RecyclerController{ - sub_controller.DisaggregatedSubDefaultController{ - K8sclient: mgr.GetClient(), - K8srecorder: mgr.GetEventRecorderFor(disaggregatedRecyclerController), - ControllerName: disaggregatedRecyclerController, - }} -} - -func (rc *RecyclerController) Sync(ctx context.Context, obj client.Object) error { - ddm := obj.(*mv1.DorisDisaggregatedMetaService) - if ddm.Spec.Recycler == nil { - return nil - } - - if ddm.Status.FDBStatus.AvailableStatus != mv1.Available { - klog.Infof("recycle controller waiting fdb ready namespace %s name %s.", ddm.Namespace, ddm.Name) - return nil - } - - rc.initRCStatus(ddm) - rc.CheckMSConfigMountPath(ddm, mv1.Component_RC) - - // recycler is a special start mode of ms. - config, err := rc.GetMSConfig(ctx, ddm.Spec.Recycler.ConfigMaps, ddm.Namespace, mv1.Component_RC) - if err != nil { - return err - } - - service := resource.BuildDMSService(ddm, mv1.Component_RC, resource.GetPort(config, resource.BRPC_LISTEN_PORT)) - if err = k8s.ApplyService(ctx, rc.K8sclient, &service, resource.DMSServiceDeepEqual); err != nil { - klog.Errorf("rc controller sync apply service name=%s, namespace=%s, clusterName=%s failed.message=%s.", - service.Name, service.Namespace, ddm.Name, err.Error()) - return err - } - - st := rc.buildRCStatefulSet(ddm) - if err = k8s.ApplyStatefulSet(ctx, rc.K8sclient, &st, func(new *appv1.StatefulSet, old *appv1.StatefulSet) bool { - rc.RestrictConditionsEqual(new, old) - return resource.DMSStatefulSetDeepEqual(new, old, false) - }); err != nil { - klog.Errorf("rc controller sync statefulset name=%s, namespace=%s, disaggregated-metaservice-name=%s failed. message=%s.", - st.Name, st.Namespace, ddm.Name, err.Error()) - return err - } - - return nil -} - -func (rc *RecyclerController) initRCStatus(ddm *mv1.DorisDisaggregatedMetaService) { - initPhase := mv1.Creating - - if mv1.IsReconcilingStatusPhase(ddm.Status.RecyclerStatus.Phase) { - initPhase = ddm.Status.RecyclerStatus.Phase - } - status := mv1.BaseStatus{ - Phase: initPhase, - AvailableStatus: mv1.UnAvailable, - } - ddm.Status.RecyclerStatus = status -} - -func (rc *RecyclerController) initRecyclerStatus(ddm *mv1.DorisDisaggregatedMetaService) { - initPhase := mv1.Creating - - if mv1.IsReconcilingStatusPhase(ddm.Status.RecyclerStatus.Phase) { - initPhase = ddm.Status.MSStatus.Phase - } - status := mv1.BaseStatus{ - Phase: initPhase, - AvailableStatus: mv1.UnAvailable, - } - ddm.Status.RecyclerStatus = status -} - -func (rc *RecyclerController) ClearResources(ctx context.Context, obj client.Object) (bool, error) { - dms := obj.(*mv1.DorisDisaggregatedMetaService) - // DeletionTimestamp is IsZero means dms not delete - // clear deleted statefulset Resources - if dms.DeletionTimestamp.IsZero() { - return true, nil - } - - if dms.Spec.Recycler == nil { - return rc.ClearMSCommonResources(ctx, dms, mv1.Component_RC) - } - return true, nil -} - -func (rc *RecyclerController) GetControllerName() string { - return disaggregatedRecyclerController -} - -func (rc *RecyclerController) UpdateComponentStatus(obj client.Object) error { - ddm := obj.(*mv1.DorisDisaggregatedMetaService) - - if ddm.Spec.Recycler == nil { - return nil - } - return rc.ClassifyPodsByStatus(ddm.Namespace, &ddm.Status.RecyclerStatus, mv1.GenerateStatefulSetSelector(ddm, mv1.Component_RC), mv1.DefaultRecyclerNumber) -} diff --git a/pkg/controller/sub_controller/disaggregated_metaservice/recycler/statefulset.go b/pkg/controller/sub_controller/disaggregated_metaservice/recycler/statefulset.go deleted file mode 100644 index b197a91..0000000 --- a/pkg/controller/sub_controller/disaggregated_metaservice/recycler/statefulset.go +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 recycler - -import ( - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" - "github.com/apache/doris-operator/pkg/common/utils/resource" - appv1 "k8s.io/api/apps/v1" -) - -func (rc *RecyclerController) buildRCStatefulSet(dms *mv1.DorisDisaggregatedMetaService) appv1.StatefulSet { - st := resource.NewDMSStatefulSet(dms, mv1.Component_RC) - st.Spec.Template = rc.buildMSPodTemplateSpec(dms) - return st -} diff --git a/pkg/controller/sub_controller/disaggregated_subcontroller.go b/pkg/controller/sub_controller/disaggregated_subcontroller.go index f0c9938..361e092 100644 --- a/pkg/controller/sub_controller/disaggregated_subcontroller.go +++ b/pkg/controller/sub_controller/disaggregated_subcontroller.go @@ -20,17 +20,13 @@ package sub_controller import ( "bytes" "context" - "fmt" - mv1 "github.com/apache/doris-operator/api/disaggregated/meta_v1" "github.com/apache/doris-operator/api/disaggregated/v1" - "github.com/apache/doris-operator/pkg/common/utils" "github.com/apache/doris-operator/pkg/common/utils/k8s" "github.com/apache/doris-operator/pkg/common/utils/metadata" "github.com/apache/doris-operator/pkg/common/utils/resource" "github.com/spf13/viper" appv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/klog/v2" @@ -56,19 +52,6 @@ type DisaggregatedSubDefaultController struct { ControllerName string } -// Deprecated: -func (d *DisaggregatedSubDefaultController) GetMSConfig(ctx context.Context, cms []mv1.ConfigMap, namespace string, componentType mv1.ComponentType) (map[string]interface{}, error) { - if len(cms) == 0 { - return make(map[string]interface{}), nil - } - configMaps, err := k8s.GetDisaggregatedMetaServiceConfigMaps(ctx, d.K8sclient, namespace, cms) - if err != nil { - klog.Errorf("DisaggregatedSubDefaultController GetConfig get configmap failed, namespace: %s,err: %s \n", namespace, err.Error()) - } - res, resolveErr := resource.ResolveDMSConfigMaps(configMaps, componentType) - return res, utils.MergeError(err, resolveErr) -} - func (d *DisaggregatedSubDefaultController) GetConfigValuesFromConfigMaps(namespace string, resolveKey string, cms []v1.ConfigMap) map[string]interface{} { if len(cms) == 0 { return nil @@ -215,23 +198,6 @@ func (d *DisaggregatedSubDefaultController) DefaultReconcileService(ctx context. return nil, nil } -// generate map for mountpath:configmap -// Deprecated: -func (d *DisaggregatedSubDefaultController) CheckMSConfigMountPath(dms *mv1.DorisDisaggregatedMetaService, componentType mv1.ComponentType) { - bspec, _ := resource.GetDMSBaseSpecFromCluster(dms, componentType) - cms := bspec.ConfigMaps - - var mountsMap = make(map[string]mv1.ConfigMap) - for _, cm := range cms { - path := cm.MountPath - if m, exist := mountsMap[path]; exist { - klog.Errorf("CheckMSConfigMountPath error: the mountPath %s is repeated between configmap: %s and configmap: %s.", path, cm.Name, m.Name) - d.K8srecorder.Event(dms, string(EventWarning), string(ConfigMapPathRepeated), fmt.Sprintf("the mountPath %s is repeated between configmap: %s and configmap: %s.", path, cm.Name, m.Name)) - } - mountsMap[path] = cm - } -} - // RestrictConditionsEqual adds two StatefulSet, // It is used to control the conditions for comparing. // nst StatefulSet - a new StatefulSet @@ -242,59 +208,3 @@ func (d *DisaggregatedSubDefaultController) RestrictConditionsEqual(nst *appv1.S // TODO: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden nst.Spec.VolumeClaimTemplates = est.Spec.VolumeClaimTemplates } - -// Deprecated: -// ClearMSCommonResources clear common resources all component have, as statefulset, service. -// response `bool` represents all resource have deleted, if not and delete resource failed return false for next reconcile retry. -func (d *DisaggregatedSubDefaultController) ClearMSCommonResources(ctx context.Context, dms *mv1.DorisDisaggregatedMetaService, componentType mv1.ComponentType) (bool, error) { - //if the doris is not have cn. - stName := mv1.GenerateComponentStatefulSetName(dms, componentType) - //externalServiceName := mv1.GenerateExternalServiceName(dms, componentType) - internalServiceName := mv1.GenerateCommunicateServiceName(dms, componentType) - if err := k8s.DeleteStatefulset(ctx, d.K8sclient, dms.Namespace, stName); err != nil && !apierrors.IsNotFound(err) { - klog.Errorf("DisaggregatedSubDefaultController ClearCommonResources delete statefulset failed, namespace=%s,name=%s, error=%s.", dms.Namespace, stName, err.Error()) - return false, err - } - - if err := k8s.DeleteService(ctx, d.K8sclient, dms.Namespace, internalServiceName); err != nil && !apierrors.IsNotFound(err) { - klog.Errorf("DisaggregatedSubDefaultController ClearCommonResources delete search service, namespace=%s,name=%s,error=%s.", dms.Namespace, internalServiceName, err.Error()) - return false, err - } - - return true, nil -} - -func (d *DisaggregatedSubDefaultController) ClassifyPodsByStatus(namespace string, status *mv1.BaseStatus, labels map[string]string, replicas int32) error { - var podList corev1.PodList - if err := d.K8sclient.List(context.Background(), &podList, client.InNamespace(namespace), client.MatchingLabels(labels)); err != nil { - return err - } - - var creatings, readys, faileds []string - podmap := make(map[string]corev1.Pod) - //get all pod status that controlled by st. - for _, pod := range podList.Items { - podmap[pod.Name] = pod - if ready := k8s.PodIsReady(&pod.Status); ready { - readys = append(readys, pod.Name) - } else if pod.Status.Phase == corev1.PodRunning || pod.Status.Phase == corev1.PodPending { - creatings = append(creatings, pod.Name) - } else { - faileds = append(faileds, pod.Name) - } - } - - if len(readys) == int(replicas) { - status.Phase = mv1.Ready - } else if len(faileds) != 0 { - status.Phase = mv1.Failed - } else if len(creatings) != 0 { - status.Phase = mv1.Creating - } - - status.AvailableStatus = mv1.UnAvailable - if status.Phase == mv1.Ready { - status.AvailableStatus = mv1.Available - } - return nil -}