diff --git a/README.md b/README.md index ae534692..7c5d0cb9 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ - [Prepare Volume Persistence](#prepare-volume-persistence) - [Prepare HostPath](#prepare-hostpath) - [Prepare Storage Class of NFS](#prepare-storage-class-of-nfs) + - [Define Your RocketMQ Exporter](#define-your-rocketmq-exporter) - [Define Your RocketMQ Cluster](#define-your-rocketmq-cluster) - [Create RocketMQ Cluster](#create-rocketmq-cluster) - [Verify the Data Storage](#verify-the-data-storage) @@ -153,6 +154,205 @@ nfs-client-provisioner-7cf858f754-7vxmm 1/1 Running 0 136m rocketmq-operator-564b5d75d-jllzk 1/1 Running 0 108s ``` +### Define Your RocketMQ Exporter +You can use the rocketmq exporter to get metrics information of the RocketMQ cluster. These metrics can be captured by prometheus, and can use grafana to graphically display metrics information . At the same time, when an abnormality happens, an alarm email can be triggered. + +1. Check the file `rocketmq_v1alpha1_rocketmq_exporter_cluster.yaml` in the example directory, for example: +``` +apiVersion: v1 +kind: ConfigMap +metadata: + name: broker-config +data: + # BROKER_MEM sets the broker JVM, if set to "" then Xms = Xmx = max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB)) + BROKER_MEM: " -Xms2g -Xmx2g -Xmn1g " + broker-common.conf: | + # brokerClusterName, brokerName, brokerId are automatically generated by the operator and do not set it manually!!! + deleteWhen=04 + fileReservedTime=48 + flushDiskType=ASYNC_FLUSH + # set brokerRole to ASYNC_MASTER or SYNC_MASTER. DO NOT set to SLAVE because the replica instance will automatically be set!!! + brokerRole=ASYNC_MASTER + +--- +apiVersion: rocketmq.apache.org/v1alpha1 +kind: Broker +metadata: + # name of broker cluster + name: broker +spec: + # size is the number of the broker cluster, each broker cluster contains a master broker and [replicaPerGroup] replica brokers. + size: 1 + # nameServers is the [ip:port] list of name service + nameServers: "" + # replicaPerGroup is the number of each broker cluster + replicaPerGroup: 0 + # brokerImage is the customized docker image repo of the RocketMQ broker + brokerImage: apacherocketmq/rocketmq-broker:4.5.0-alpine-operator-0.3.0 + # imagePullPolicy is the image pull policy + imagePullPolicy: Always + # resources describes the compute resource requirements and limits + resources: + requests: + memory: "2048Mi" + cpu: "250m" + limits: + memory: "12288Mi" + cpu: "500m" + # allowRestart defines whether allow pod restart + allowRestart: true + # storageMode can be EmptyDir, HostPath, StorageClass + storageMode: EmptyDir + # hostPath is the local path to store data + hostPath: /tmp/data/rocketmq/broker + # scalePodName is [Broker name]-[broker group number]-master-0 + scalePodName: broker-0-master-0 + # env defines custom env, e.g. BROKER_MEM + env: + - name: BROKER_MEM + valueFrom: + configMapKeyRef: + name: broker-config + key: BROKER_MEM + # volumes defines the broker.conf + volumes: + - name: broker-config + configMap: + name: broker-config + items: + - key: broker-common.conf + path: broker-common.conf + # volumeClaimTemplates defines the storageClass + volumeClaimTemplates: + - metadata: + name: broker-storage + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 8Gi + selector: + matchLabels: + app: broker-storage-pv +--- +apiVersion: rocketmq.apache.org/v1alpha1 +kind: NameService +metadata: + name: name-service +spec: + # size is the the name service instance number of the name service cluster + size: 1 + # nameServiceImage is the customized docker image repo of the RocketMQ name service + nameServiceImage: apacherocketmq/rocketmq-nameserver:4.5.0-alpine-operator-0.3.0 + # imagePullPolicy is the image pull policy + imagePullPolicy: Always + # hostNetwork can be true or false + hostNetwork: true + # Set DNS policy for the pod. + # Defaults to "ClusterFirst". + # Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. + # DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. + # To have DNS options set along with hostNetwork, you have to specify DNS policy + # explicitly to 'ClusterFirstWithHostNet'. + dnsPolicy: ClusterFirstWithHostNet + # resources describes the compute resource requirements and limits + resources: + requests: + memory: "512Mi" + cpu: "250m" + limits: + memory: "1024Mi" + cpu: "500m" + # storageMode can be EmptyDir, HostPath, StorageClass + storageMode: EmptyDir + # hostPath is the local path to store data + hostPath: /data/rocketmq/nameserver + exporter: + enabled: true + env: + - name: WEB_TELEMETRY_PATH + value: /metrics + - name: NAMESRV_ADDR + value: 127.0.0.1:9876 + image: apacherocketmq/rocketmq-exporter:latest + imagePullPolicy: Always + resources: + requests: + memory: "512Mi" + cpu: "250m" + limits: + memory: "1024Mi" + cpu: "500m" + # volumeClaimTemplates defines the storageClass + volumeClaimTemplates: + - metadata: + name: namesrv-storage + spec: + accessModes: + - ReadWriteOnce + storageClassName: rocketmq-storage + resources: + requests: + storage: 1Gi +``` +which defines the RocketMQ name server cluster and the broker cluster. We have added an optional exporter field to the NameService. Through this field, we can inject a rocketmq-exporter as a sidecar into each nameserver in the cluster. + +* exporter.env contains metrics path and nameserver address + +The configuration of prometheus can refer to: +``` +- job_name: general-logic-pods + honor_timestamps: true + scrape_interval: 30s + scrape_timeout: 10s + metrics_path: /metrics + scheme: http + kubernetes_sd_configs: + - role: pod + relabel_configs: + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] + separator: ; + regex: "true" + replacement: $1 + action: keep + - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path] + separator: ; + regex: (.+) + target_label: __metrics_path__ + replacement: $1 + action: replace + - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] + separator: ; + regex: ([^:]+)(?::\d+)?;(\d+) + target_label: __address__ + replacement: $1:$2 + action: replace + - source_labels: [__meta_kubernetes_pod_host_ip] + separator: ; + regex: (.*) + target_label: instance + replacement: $1:9100 + action: replace + - separator: ; + regex: __meta_kubernetes_pod_label_(.+) + replacement: $1 + action: labelmap + - source_labels: [__meta_kubernetes_namespace] + separator: ; + regex: (.*) + target_label: kubernetes_namespace + replacement: $1 + action: replace + - source_labels: [__meta_kubernetes_pod_name] + separator: ; + regex: (.*) + target_label: kubernetes_pod_name + replacement: $1 + action: replace +``` + + ### Define Your RocketMQ Cluster RocketMQ Operator provides several CRDs to allow users define their RocketMQ service component cluster, which includes the Name Server cluster and the Broker cluster. diff --git a/deploy/crds/rocketmq_v1alpha1_nameservice_crd.yaml b/deploy/crds/rocketmq_v1alpha1_nameservice_crd.yaml index 437ce049..d01740f7 100644 --- a/deploy/crds/rocketmq_v1alpha1_nameservice_crd.yaml +++ b/deploy/crds/rocketmq_v1alpha1_nameservice_crd.yaml @@ -63,6 +63,9 @@ spec: items: type: object type: array + exporter: + description: Exporter defines rocketmq metrics + type: object required: - size - nameServiceImage diff --git a/example/rocketmq_v1alpha1_rocketmq_exporter_cluster.yaml b/example/rocketmq_v1alpha1_rocketmq_exporter_cluster.yaml new file mode 100644 index 00000000..ab1bf963 --- /dev/null +++ b/example/rocketmq_v1alpha1_rocketmq_exporter_cluster.yaml @@ -0,0 +1,157 @@ +# 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. + +apiVersion: v1 +kind: ConfigMap +metadata: + name: broker-config +data: + # BROKER_MEM sets the broker JVM, if set to "" then Xms = Xmx = max(min(1/2 ram, 1024MB), min(1/4 ram, 8GB)) + BROKER_MEM: " -Xms2g -Xmx2g -Xmn1g " + broker-common.conf: | + # brokerClusterName, brokerName, brokerId are automatically generated by the operator and do not set it manually!!! + deleteWhen=04 + fileReservedTime=48 + flushDiskType=ASYNC_FLUSH + # set brokerRole to ASYNC_MASTER or SYNC_MASTER. DO NOT set to SLAVE because the replica instance will automatically be set!!! + brokerRole=ASYNC_MASTER + +--- +apiVersion: rocketmq.apache.org/v1alpha1 +kind: Broker +metadata: + # name of broker cluster + name: broker +spec: + # size is the number of the broker cluster, each broker cluster contains a master broker and [replicaPerGroup] replica brokers. + size: 1 + # nameServers is the [ip:port] list of name service + nameServers: "" + # replicaPerGroup is the number of each broker cluster + replicaPerGroup: 0 + # brokerImage is the customized docker image repo of the RocketMQ broker + brokerImage: apacherocketmq/rocketmq-broker:4.5.0-alpine-operator-0.3.0 + # imagePullPolicy is the image pull policy + imagePullPolicy: Always + # resources describes the compute resource requirements and limits + resources: + requests: + memory: "2048Mi" + cpu: "250m" + limits: + memory: "12288Mi" + cpu: "500m" + # allowRestart defines whether allow pod restart + allowRestart: true + # storageMode can be EmptyDir, HostPath, StorageClass + storageMode: EmptyDir + # hostPath is the local path to store data + hostPath: /tmp/data/rocketmq/broker + # scalePodName is [Broker name]-[broker group number]-master-0 + scalePodName: broker-0-master-0 + # env defines custom env, e.g. BROKER_MEM + env: + - name: BROKER_MEM + valueFrom: + configMapKeyRef: + name: broker-config + key: BROKER_MEM + # volumes defines the broker.conf + volumes: + - name: broker-config + configMap: + name: broker-config + items: + - key: broker-common.conf + path: broker-common.conf + # volumeClaimTemplates defines the storageClass + volumeClaimTemplates: + - metadata: + name: broker-storage + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 8Gi + selector: + matchLabels: + app: broker-storage-pv +--- +apiVersion: rocketmq.apache.org/v1alpha1 +kind: NameService +metadata: + name: name-service +spec: + # size is the the name service instance number of the name service cluster + size: 1 + # nameServiceImage is the customized docker image repo of the RocketMQ name service + nameServiceImage: apacherocketmq/rocketmq-nameserver:4.5.0-alpine-operator-0.3.0 + # imagePullPolicy is the image pull policy + imagePullPolicy: Always + # hostNetwork can be true or false + hostNetwork: true + # Set DNS policy for the pod. + # Defaults to "ClusterFirst". + # Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. + # DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. + # To have DNS options set along with hostNetwork, you have to specify DNS policy + # explicitly to 'ClusterFirstWithHostNet'. + dnsPolicy: ClusterFirstWithHostNet + # resources describes the compute resource requirements and limits + resources: + requests: + memory: "512Mi" + cpu: "250m" + limits: + memory: "1024Mi" + cpu: "500m" + # storageMode can be EmptyDir, HostPath, StorageClass + storageMode: EmptyDir + # hostPath is the local path to store data + hostPath: /data/rocketmq/nameserver + exporter: + enabled: true + annotations: + prometheus.io/path: /metrics + prometheus.io/port: "5557" + prometheus.io/scrape: "true" + env: + - name: WEB_TELEMETRY_PATH + value: /metrics + - name: ROCKETMQ_VERSION + value: V4_3_2 + - name: NAMESRV_ADDR + value: 127.0.0.1:9876 + image: miaolinjie/rocketmq-exporter:latest + imagePullPolicy: Always + resources: + requests: + memory: "512Mi" + cpu: "250m" + limits: + memory: "1024Mi" + cpu: "500m" + # volumeClaimTemplates defines the storageClass + volumeClaimTemplates: + - metadata: + name: namesrv-storage + spec: + accessModes: + - ReadWriteOnce + storageClassName: rocketmq-storage + resources: + requests: + storage: 1Gi diff --git a/images/rocketmq-exporter/alpine/Dockerfile b/images/rocketmq-exporter/alpine/Dockerfile new file mode 100644 index 00000000..3ed8219c --- /dev/null +++ b/images/rocketmq-exporter/alpine/Dockerfile @@ -0,0 +1,51 @@ +# +# 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. +# +FROM openjdk:8-alpine + +RUN apk add --no-cache bash gettext nmap-ncat curl git openssl busybox-extras + +ARG MAVEN_VERSION=3.6.3 +ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries +ARG SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0 + +RUN mkdir -p /usr/share/maven /usr/share/maven/ref \ + && echo "Downlaoding maven" \ + && curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ + \ + && echo "Checking download hash" \ + && echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \ + \ + && echo "Unziping maven" \ + && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ + \ + && echo "Cleaning and setting links" \ + && rm -f /tmp/apache-maven.tar.gz \ + && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn + +RUN mkdir /exporter \ + && git clone https://github.com/apache/rocketmq-exporter.git \ + && cd /rocketmq-exporter \ + && mvn clean package -Dmaven.test.skip=true \ + && mv /rocketmq-exporter/target/rocketmq-exporter-*.jar /rocketmq-exporter/rocketmq-exporter.jar \ + && mv /rocketmq-exporter/rocketmq-exporter.jar /exporter \ + && rm -rf /rocketmq-exporter \ + && mv /exporter /rocketmq-exporter + +ADD application.yml /rocketmq-exporter/ +ADD exporterStart.sh /rocketmq-exporter/ + +CMD ["/bin/bash", "/rocketmq-exporter/exporterStart.sh"] diff --git a/images/rocketmq-exporter/alpine/application.yml b/images/rocketmq-exporter/alpine/application.yml new file mode 100644 index 00000000..98b8c8fc --- /dev/null +++ b/images/rocketmq-exporter/alpine/application.yml @@ -0,0 +1,38 @@ +server: + port: 5557 +spring: + application: + name: rocketmq-exporter + http: + encoding: + charset: UTF-8 + enabled: true + force: true +logging: + config: classpath:logback.xml + +rocketmq: + config: + webTelemetryPath: ${WEB_TELEMETRY_PATH} + rocketmqVersion: V4_3_2 + namesrvAddr: ${NAMESRV_ADDR} + enableCollect: true + +threadpool: + collect-client-metric-executor: + core-pool-size: 10 + maximum-pool-size: 10 + keep-alive-time: 3000 + queueSize: 5000 +task: + count: 5 # num of scheduled-tasks + collectTopicOffset: + cron: 15 0/1 * * * ? + collectConsumerOffset: + cron: 15 0/1 * * * ? + collectBrokerStatsTopic: + cron: 15 0/1 * * * ? + collectBrokerStats: + cron: 15 0/1 * * * ? + collectBrokerRuntimeStats: + cron: 15 0/1 * * * ? diff --git a/images/rocketmq-exporter/alpine/build-rocketmq-exporter-image.sh b/images/rocketmq-exporter/alpine/build-rocketmq-exporter-image.sh new file mode 100755 index 00000000..cd4c6dc8 --- /dev/null +++ b/images/rocketmq-exporter/alpine/build-rocketmq-exporter-image.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# 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. + +checkVersion() +{ + echo "Version = $1" + echo $1 |grep -E "^[0-9]+\.[0-9]+\.[0-9]+" > /dev/null + if [ $? = 0 ]; then + return 1 + fi + + echo "Version $1 illegal, it should be X.X.X format(e.g. 4.5.0), please check released versions in 'https://dist.apache.org/repos/dist/release/rocketmq/'" + exit 2 +} + +if [ $# -lt 1 ]; then + echo -e "Usage: sh $0 Version" + exit 2 +fi + +ROCKETMQ_EXPORTER_VERSION=$1 +DOCKERHUB_REPO=apacherocketmq/rocketmq-exporter +IMAGE_NAME=${DOCKERHUB_REPO}:${ROCKETMQ_EXPORTER_VERSION}-alpine-operator-0.3.0 + +checkVersion $ROCKETMQ_EXPORTER_VERSION + +docker build -t $IMAGE_NAME --build-arg version=${ROCKETMQ_EXPORTER_VERSION} . + +docker push $IMAGE_NAME diff --git a/images/rocketmq-exporter/alpine/exporterStart.sh b/images/rocketmq-exporter/alpine/exporterStart.sh new file mode 100644 index 00000000..27c63762 --- /dev/null +++ b/images/rocketmq-exporter/alpine/exporterStart.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# 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. + +java -jar /rocketmq-exporter/rocketmq-exporter.jar --spring.config.location=/rocketmq-exporter/application.yml diff --git a/pkg/apis/rocketmq/v1alpha1/nameservice_types.go b/pkg/apis/rocketmq/v1alpha1/nameservice_types.go index b8900e9b..b4939a1b 100644 --- a/pkg/apis/rocketmq/v1alpha1/nameservice_types.go +++ b/pkg/apis/rocketmq/v1alpha1/nameservice_types.go @@ -49,6 +49,17 @@ type NameServiceSpec struct { HostPath string `json:"hostPath"` // VolumeClaimTemplates defines the StorageClass VolumeClaimTemplates []corev1.PersistentVolumeClaim `json:"volumeClaimTemplates"` + // rocketmq exporter + Exporter RocketmqExporter `json:"exporter,omitempty"` +} + +// RocketmqExporter defines the specification for the rocketmq exporter +type RocketmqExporter struct { + Enabled bool `json:"enabled,omitempty"` + Image string `json:"image,omitempty"` + ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"` + Env []corev1.EnvVar `json:"env"` + Resources corev1.ResourceRequirements `json:"resources,omitempty"` } // NameServiceStatus defines the observed state of NameService diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 5ebf7da6..e81192da 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -141,4 +141,19 @@ const ( // TopicListConsumerGroup is the consumer group field index of the output when using command check topic list TopicListConsumerGroup = 2 + + // ExporterContainerName is the name of rocketmq exporter + ExporterContainerName = "rocketmq-exporter" + + // ExporterDefaultRequestCPU is the default value of rocketmq-exporter's request CPU + ExporterDefaultRequestCPU = "100m" + + // ExporterDefaultLimitCPU is the default value of rocketmq-exporter's limit CPU + ExporterDefaultLimitCPU = "200m" + + // ExporterDefaultRequestMemory is the default value of rocketmq-exporter's Request Memory + ExporterDefaultRequestMemory = "200Mi" + + // ExporterDefaultLimitMemory is the default value of rocketmq-exporter's limit Memory + ExporterDefaultLimitMemory = "300Mi" ) diff --git a/pkg/controller/nameservice/nameservice_controller.go b/pkg/controller/nameservice/nameservice_controller.go index 410515f8..761a7327 100644 --- a/pkg/controller/nameservice/nameservice_controller.go +++ b/pkg/controller/nameservice/nameservice_controller.go @@ -20,6 +20,7 @@ package nameservice import ( "context" + "k8s.io/apimachinery/pkg/api/resource" "os/exec" "reflect" "strconv" @@ -342,8 +343,42 @@ func (r *ReconcileNameService) statefulSetForNameService(nameService *rocketmqv1 VolumeClaimTemplates: getVolumeClaimTemplates(nameService), }, } + if nameService.Spec.Exporter.Enabled { + exporter := r.createRocketMQExporterContainer(nameService) + dep.Spec.Template.Spec.Containers = append(dep.Spec.Template.Spec.Containers, exporter) + } // Set Broker instance as the owner and controller controllerutil.SetControllerReference(nameService, dep, r.scheme) return dep } + +func (r *ReconcileNameService) createRocketMQExporterContainer(nameService *rocketmqv1alpha1.NameService) (container corev1.Container) { + container = corev1.Container{ + Name: cons.ExporterContainerName, + Image: nameService.Spec.Exporter.Image, + Env: nameService.Spec.Exporter.Env, + ImagePullPolicy: func(specPolicy corev1.PullPolicy) corev1.PullPolicy { + if specPolicy == "" { + return corev1.PullAlways + } + return specPolicy + }(nameService.Spec.Exporter.ImagePullPolicy), + Resources: func(requirements corev1.ResourceRequirements) corev1.ResourceRequirements { + if requirements.Limits.Memory().IsZero() && requirements.Requests.Memory().IsZero() { + return corev1.ResourceRequirements{ + Limits: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse(cons.ExporterDefaultLimitCPU), + corev1.ResourceMemory: resource.MustParse(cons.ExporterDefaultLimitMemory), + }, + Requests: corev1.ResourceList{ + corev1.ResourceCPU: resource.MustParse(cons.ExporterDefaultRequestCPU), + corev1.ResourceMemory: resource.MustParse(cons.ExporterDefaultRequestMemory), + }, + } + } + return requirements + }(nameService.Spec.Exporter.Resources), + } + return +}