diff --git a/charts/tidb-cluster/templates/_helpers.tpl b/charts/tidb-cluster/templates/_helpers.tpl index 766d43789b..f790cc145d 100644 --- a/charts/tidb-cluster/templates/_helpers.tpl +++ b/charts/tidb-cluster/templates/_helpers.tpl @@ -152,17 +152,3 @@ drainer-config: |- {{- define "drainer-configmap.data-digest" -}} {{ include "drainer-configmap.data" . | sha256sum | trunc 8 }} {{- end -}} - -{{/* -Encapsulate tikv-importer configmap data for consistent digest calculation -*/}} -{{- define "importer-configmap.data" -}} -config-file: |- - {{- if .Values.importer.config }} -{{ .Values.importer.config | indent 2 }} - {{- end -}} -{{- end -}} - -{{- define "importer-configmap.data-digest" -}} -{{ include "importer-configmap.data" . | sha256sum | trunc 8 }} -{{- end -}} diff --git a/charts/tidb-cluster/templates/tikv-importer-configmap.yaml b/charts/tidb-cluster/templates/tikv-importer-configmap.yaml deleted file mode 100644 index 07c647fa62..0000000000 --- a/charts/tidb-cluster/templates/tikv-importer-configmap.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if .Values.importer.create }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "cluster.name" . }}-importer-{{ template "importer-configmap.data-digest" . }} - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: importer - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -data: -{{ include "importer-configmap.data" . | indent 2 }} -{{- end }} diff --git a/charts/tidb-cluster/templates/tikv-importer-service.yaml b/charts/tidb-cluster/templates/tikv-importer-service.yaml deleted file mode 100644 index c8451c407c..0000000000 --- a/charts/tidb-cluster/templates/tikv-importer-service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- if .Values.importer.create }} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "cluster.name" . }}-importer - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: importer - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -spec: - clusterIP: None - ports: - - name: importer - port: 8287 - selector: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: importer -{{- end }} diff --git a/charts/tidb-cluster/templates/tikv-importer-statefulset.yaml b/charts/tidb-cluster/templates/tikv-importer-statefulset.yaml deleted file mode 100644 index c5e7383d33..0000000000 --- a/charts/tidb-cluster/templates/tikv-importer-statefulset.yaml +++ /dev/null @@ -1,94 +0,0 @@ -{{- if .Values.importer.create }} -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ template "cluster.name" . }}-importer - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: importer - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -spec: - selector: - matchLabels: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: importer - serviceName: {{ template "cluster.name" . }}-importer - replicas: 1 - template: - metadata: - annotations: - prometheus.io/scrape: "true" - prometheus.io/path: "/metrics" - prometheus.io/port: "9091" - labels: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: importer - spec: - {{- if .Values.importer.affinity }} - affinity: -{{ toYaml .Values.importer.affinity | indent 6 }} - {{- end }} - {{- if .Values.importer.tolerations }} - tolerations: -{{ toYaml .Values.importer.tolerations | indent 6 }} - {{- end }} - containers: - - name: importer - image: {{ .Values.importer.image }} - imagePullPolicy: {{ .Values.importer.imagePullPolicy | default "IfNotPresent"}} - command: - - /tikv-importer - # tikv-importer does not support domain name: https://github.com/tikv/importer/issues/16 - # - --addr=${MY_POD_NAME}.tikv-importer:8287 - - --addr=$(MY_POD_IP):8287 - - --config=/etc/tikv-importer/tikv-importer.toml - - --import-dir=/var/lib/tikv-importer - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - - name: MY_POD_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - {{- if and (ne .Values.timezone "UTC") (ne .Values.timezone "") }} - - name: TZ - value: {{ .Values.timezone | default "UTC" }} - {{- end }} - volumeMounts: - - name: data - mountPath: /var/lib/tikv-importer - - name: config - mountPath: /etc/tikv-importer - {{- if .Values.importer.resources }} - resources: -{{ toYaml .Values.importer.resources | indent 10 }} - {{- end }} - - name: pushgateway - image: {{ .Values.importer.pushgatewayImage }} - imagePullPolicy: {{ .Values.importer.pushgatewayImagePullPolicy | default "IfNotPresent" }} - volumes: - - name: config - configMap: - name: {{ template "cluster.name" . }}-importer-{{ template "importer-configmap.data-digest" . }} - items: - - key: config-file - path: tikv-importer.toml - volumeClaimTemplates: - - metadata: - name: data - spec: - accessModes: [ "ReadWriteOnce" ] - storageClassName: {{ .Values.importer.storageClassName }} - resources: - requests: - storage: {{ .Values.importer.storage }} -{{- end }} diff --git a/charts/tidb-cluster/values.yaml b/charts/tidb-cluster/values.yaml index 74badd87d0..254b9bf935 100644 --- a/charts/tidb-cluster/values.yaml +++ b/charts/tidb-cluster/values.yaml @@ -838,30 +838,6 @@ scheduledBackup: ## refer to https://kubernetes.io/docs/concepts/configuration/taint-and-toleration tolerations: [] -importer: - create: false - image: pingcap/tidb-lightning:v7.1.1 - imagePullPolicy: IfNotPresent - storageClassName: local-storage - storage: 200Gi - resources: {} - # limits: - # cpu: 16000m - # memory: 8Gi - # requests: - # cpu: 16000m - # memory: 8Gi - affinity: {} - tolerations: [] - pushgatewayImage: prom/pushgateway:v0.3.1 - pushgatewayImagePullPolicy: IfNotPresent - config: | - log-level = "info" - [metric] - job = "tikv-importer" - interval = "15s" - address = "localhost:9091" - metaInstance: "{{ $labels.instance }}" metaType: "{{ $labels.type }}" metaValue: "{{ $value }}" diff --git a/charts/tidb-lightning/templates/scripts/_start_lightning.sh.tpl b/charts/tidb-lightning/templates/scripts/_start_lightning.sh.tpl index 2e1c9a48a9..2cbe8c594d 100644 --- a/charts/tidb-lightning/templates/scripts/_start_lightning.sh.tpl +++ b/charts/tidb-lightning/templates/scripts/_start_lightning.sh.tpl @@ -29,9 +29,7 @@ sed "s#CHECKPOINT_USE_DATA_DIR#$data_dir#g" /etc/tidb-lightning/tidb-lightning.t /tidb-lightning \ --pd-urls={{ .Values.targetTidbCluster.name }}-pd.{{ .Values.targetTidbCluster.namespace | default .Release.Namespace }}:{{ .Values.targetTidbCluster.pdClientPort | default 2379 }} \ --status-addr=0.0.0.0:8289 \ -{{- if eq .Values.backend "importer" }} - --importer={{ .Values.targetTidbCluster.name }}-importer.{{ .Values.targetTidbCluster.namespace | default .Release.Namespace }}:8287 \ -{{- else if eq .Values.backend "tidb" }} +{{- if eq .Values.backend "tidb" }} --backend=tidb \ --tidb-port={{ .Values.targetTidbCluster.port | default 4000 }} \ {{- else if eq .Values.backend "local" }} diff --git a/charts/tidb-lightning/values.yaml b/charts/tidb-lightning/values.yaml index 8c19b0133b..a1b3f18804 100644 --- a/charts/tidb-lightning/values.yaml +++ b/charts/tidb-lightning/values.yaml @@ -97,7 +97,7 @@ annotations: {} tolerations: [] affinity: {} -# The delivery backend used to import data (valid options include `local`, `tidb` and `importer`(deprecated)). +# The delivery backend used to import data (valid options include `local` and `tidb`. # If set to `local`, then the following `sortedKV` should be set. backend: local diff --git a/charts/tikv-importer/.helmignore b/charts/tikv-importer/.helmignore deleted file mode 100644 index f0c1319444..0000000000 --- a/charts/tikv-importer/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# Patterns to ignore when building packages. -# This supports shell glob matching, relative path matching, and -# negation (prefixed with !). Only one pattern per line. -.DS_Store -# Common VCS dirs -.git/ -.gitignore -.bzr/ -.bzrignore -.hg/ -.hgignore -.svn/ -# Common backup files -*.swp -*.bak -*.tmp -*~ -# Various IDEs -.project -.idea/ -*.tmproj diff --git a/charts/tikv-importer/Chart.yaml b/charts/tikv-importer/Chart.yaml deleted file mode 100644 index df3701c8a2..0000000000 --- a/charts/tikv-importer/Chart.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -description: A Helm chart for TiKV Importer -name: tikv-importer -version: v1-canary -home: https://github.com/pingcap/tidb-operator -sources: - - https://github.com/pingcap/tidb-operator -keywords: - - newsql - - htap - - database - - mysql - - raft diff --git a/charts/tikv-importer/templates/_helpers.tpl b/charts/tikv-importer/templates/_helpers.tpl deleted file mode 100644 index 80de40603d..0000000000 --- a/charts/tikv-importer/templates/_helpers.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "chart.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Encapsulate tikv-importer configmap data for consistent digest calculation -*/}} -{{- define "importer-configmap.data" -}} -config-file: |- - {{- if .Values.config }} -{{ .Values.config | indent 2 }} - {{- end -}} - {{- if and .Values.tlsCluster .Values.tlsCluster.enabled }} - [security] - ca-path="/var/lib/importer-tls/ca.crt" - cert-path="/var/lib/importer-tls/tls.crt" - key-path="/var/lib/importer-tls/tls.key" - {{- end }} -{{- end -}} - -{{- define "importer-configmap.data-digest" -}} -{{ include "importer-configmap.data" . | sha256sum | trunc 8 }} -{{- end -}} diff --git a/charts/tikv-importer/templates/tikv-importer-configmap.yaml b/charts/tikv-importer/templates/tikv-importer-configmap.yaml deleted file mode 100644 index 9e21e96b66..0000000000 --- a/charts/tikv-importer/templates/tikv-importer-configmap.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Values.clusterName }}-importer-{{ template "importer-configmap.data-digest" . }} - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Values.clusterName }} - app.kubernetes.io/component: importer - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -data: -{{ include "importer-configmap.data" . | indent 2 }} diff --git a/charts/tikv-importer/templates/tikv-importer-service.yaml b/charts/tikv-importer/templates/tikv-importer-service.yaml deleted file mode 100644 index 189579c77c..0000000000 --- a/charts/tikv-importer/templates/tikv-importer-service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Values.clusterName }}-importer - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Values.clusterName }} - app.kubernetes.io/component: importer - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -spec: - clusterIP: None - ports: - - name: importer - port: 8287 - - name: status - port: 8286 - selector: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/instance: {{ .Values.clusterName }} - app.kubernetes.io/component: importer diff --git a/charts/tikv-importer/templates/tikv-importer-statefulset.yaml b/charts/tikv-importer/templates/tikv-importer-statefulset.yaml deleted file mode 100644 index 922333b5c5..0000000000 --- a/charts/tikv-importer/templates/tikv-importer-statefulset.yaml +++ /dev/null @@ -1,101 +0,0 @@ -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: {{ .Values.clusterName }}-importer - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Values.clusterName }} - app.kubernetes.io/component: importer - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} -spec: - selector: - matchLabels: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/instance: {{ .Values.clusterName }} - app.kubernetes.io/component: importer - serviceName: {{ .Values.clusterName }}-importer - replicas: 1 - template: - metadata: - annotations: - prometheus.io/scrape: "true" - prometheus.io/path: "/metrics" - prometheus.io/port: "8286" - labels: - app.kubernetes.io/name: {{ template "chart.name" . }} - app.kubernetes.io/instance: {{ .Values.clusterName }} - app.kubernetes.io/component: importer - spec: - {{- if .Values.affinity }} - affinity: -{{ toYaml .Values.affinity | indent 6 }} - {{- end }} - {{- if .Values.tolerations }} - tolerations: -{{ toYaml .Values.tolerations | indent 6 }} - {{- end }} - {{- if .Values.imagePullSecrets }} - imagePullSecrets: -{{ toYaml .Values.imagePullSecrets | indent 6 }} - {{- end }} - containers: - - name: importer - image: {{ .Values.image }} - imagePullPolicy: {{ .Values.imagePullPolicy | default "IfNotPresent"}} - command: - - /tikv-importer - # tikv-importer does not support domain name: https://github.com/tikv/importer/issues/16 - # - --addr=${MY_POD_NAME}.tikv-importer:8287 - - --addr=$(MY_POD_IP):8287 - - --config=/etc/tikv-importer/tikv-importer.toml - - --import-dir=/var/lib/tikv-importer - env: - - name: MY_POD_NAME - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: metadata.name - - name: MY_POD_IP - valueFrom: - fieldRef: - apiVersion: v1 - fieldPath: status.podIP - - name: TZ - value: {{ .Values.timezone | default "UTC" }} - volumeMounts: - - name: data - mountPath: /var/lib/tikv-importer - - name: config - mountPath: /etc/tikv-importer - {{- if and .Values.tlsCluster .Values.tlsCluster.enabled }} - - name: importer-tls - mountPath: /var/lib/importer-tls - readOnly: true - {{- end }} - {{- if .Values.resources }} - resources: -{{ toYaml .Values.resources | indent 10 }} - {{- end }} - volumes: - - name: config - configMap: - name: {{ .Values.clusterName }}-importer-{{ template "importer-configmap.data-digest" . }} - items: - - key: config-file - path: tikv-importer.toml - {{- if and .Values.tlsCluster .Values.tlsCluster.enabled }} - - name: importer-tls - secret: - secretName: {{ .Values.clusterName }}-importer-cluster-secret - {{- end }} - volumeClaimTemplates: - - metadata: - name: data - spec: - accessModes: [ "ReadWriteOnce" ] - storageClassName: {{ .Values.storageClassName }} - resources: - requests: - storage: {{ .Values.storage }} diff --git a/charts/tikv-importer/values.yaml b/charts/tikv-importer/values.yaml deleted file mode 100644 index 47aa4c6801..0000000000 --- a/charts/tikv-importer/values.yaml +++ /dev/null @@ -1,37 +0,0 @@ -# Default values for tikv-importer. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -# timezone is the default system timzone for TiDB -timezone: UTC - -# clusterName is the TiDB cluster name -clusterName: demo - -image: pingcap/tidb-lightning:v7.1.1 -imagePullPolicy: IfNotPresent -# imagePullSecrets: [] - -# Whether enable the TLS connection between TiDB cluster components. -# If enabled, a Secret named "-importer-cluster-secret" must exist. -# To create this Secret: kubectl create secret generic -importer-cluster-secret --namespace= --from-file=tls.crt= --from-file=tls.key= --from-file=ca.crt= -tlsCluster: {} - # enabled: true - -storageClassName: local-storage -storage: 20Gi -resources: - {} - # limits: - # cpu: 16000m - # memory: 8Gi - # requests: - # cpu: 16000m - # memory: 8Gi -affinity: {} -tolerations: [] -pushgatewayImage: prom/pushgateway:v0.3.1 -pushgatewayImagePullPolicy: IfNotPresent -config: | - log-level = "info" - status-server-address = "0.0.0.0:8286" diff --git a/hack/gen-tls-certs.sh b/hack/gen-tls-certs.sh index 4bc1358a11..ef0303f889 100755 --- a/hack/gen-tls-certs.sh +++ b/hack/gen-tls-certs.sh @@ -193,7 +193,7 @@ if [[ -d $TLS_DIR ]]; then rm -rf $TLS_DIR fi -components=("pd" "tidb" "tikv" "pump" "ticdc" "tiflash" "importer" "lightning") +components=("pd" "tidb" "tikv" "pump" "ticdc" "tiflash" "lightning") if [[ $# -eq 1 && $1 = "clean" ]]; then echo "cleaning up" diff --git a/pkg/monitor/monitor/template.go b/pkg/monitor/monitor/template.go index c1513a909a..b2638e75b6 100644 --- a/pkg/monitor/monitor/template.go +++ b/pkg/monitor/monitor/template.go @@ -51,7 +51,6 @@ var ( pumpPattern = "pump" drainerPattern = "drainer" cdcPattern = "ticdc" - importerPattern = "importer" lightningPattern = "tidb-lightning" dmWorkerPattern = dmWorker dmMasterPattern = dmMaster @@ -101,7 +100,6 @@ func newPrometheusConfig(cmodel *MonitorConfigModel) yaml.MapSlice { scrapeJobs = append(scrapeJobs, scrapeJob("pump", pumpPattern, cmodel, buildAddressRelabelConfigByComponent("pump"))...) scrapeJobs = append(scrapeJobs, scrapeJob("drainer", drainerPattern, cmodel, buildAddressRelabelConfigByComponent("drainer"))...) scrapeJobs = append(scrapeJobs, scrapeJob("ticdc", cdcPattern, cmodel, buildAddressRelabelConfigByComponent("ticdc"))...) - scrapeJobs = append(scrapeJobs, scrapeJob("importer", importerPattern, cmodel, buildAddressRelabelConfigByComponent("importer"))...) scrapeJobs = append(scrapeJobs, scrapeJob("lightning", lightningPattern, cmodel, buildAddressRelabelConfigByComponent("lightning"))...) scrapeJobs = append(scrapeJobs, scrapeJob(dmWorker, dmWorkerPattern, cmodel, buildAddressRelabelConfigByComponent(dmWorker))...) scrapeJobs = append(scrapeJobs, scrapeJob(dmMaster, dmMasterPattern, cmodel, buildAddressRelabelConfigByComponent(dmMaster))...) @@ -178,19 +176,6 @@ func buildAddressRelabelConfigByComponent(kind string) yaml.MapSlice { portLabel, }}, } - case "importer": - return yaml.MapSlice{ - {Key: "action", Value: "replace"}, - {Key: "regex", Value: addressPattern}, - {Key: "replacement", Value: "$1.$2-importer.$3:$4"}, - {Key: "target_label", Value: "__address__"}, - {Key: "source_labels", Value: []string{ - podNameLabel, - instanceLabel, - namespaceLabel, - portLabel, - }}, - } case "drainer": return yaml.MapSlice{ {Key: "action", Value: "replace"}, diff --git a/pkg/monitor/monitor/template_test.go b/pkg/monitor/monitor/template_test.go index 326c07ceae..22444fd9cc 100644 --- a/pkg/monitor/monitor/template_test.go +++ b/pkg/monitor/monitor/template_test.go @@ -734,79 +734,6 @@ scrape_configs: - __tmp_hash regex: $(SHARD) action: keep -- job_name: ns1-target-importer - honor_labels: true - scrape_interval: 15s - scheme: http - kubernetes_sd_configs: - - api_server: null - role: pod - namespaces: - names: - - ns1 - tls_config: - insecure_skip_verify: true - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - action: keep - regex: target - - source_labels: - - __meta_kubernetes_namespace - action: keep - regex: ns1 - - source_labels: - - __meta_kubernetes_pod_annotation_prometheus_io_scrape - action: keep - regex: "true" - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_component - action: keep - regex: importer - - action: replace - regex: (.+);(.+);(.+);(.+) - replacement: $1.$2-importer.$3:$4 - target_label: __address__ - source_labels: - - __meta_kubernetes_pod_name - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - - __meta_kubernetes_namespace - - __meta_kubernetes_pod_annotation_prometheus_io_port - - source_labels: - - __meta_kubernetes_namespace - action: replace - target_label: kubernetes_namespace - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - action: replace - target_label: cluster - - source_labels: - - __meta_kubernetes_pod_name - action: replace - target_label: instance - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_component - action: replace - target_label: component - - source_labels: - - __meta_kubernetes_namespace - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - separator: '-' - target_label: tidb_cluster - - source_labels: - - __meta_kubernetes_pod_annotation_prometheus_io_path - action: replace - target_label: __metrics_path__ - regex: (.+) - - source_labels: - - __address__ - action: hashmod - target_label: __tmp_hash - modulus: 0 - - source_labels: - - __tmp_hash - regex: $(SHARD) - action: keep - job_name: ns1-target-lightning honor_labels: true scrape_interval: 15s @@ -1778,79 +1705,6 @@ scrape_configs: - __tmp_hash regex: $(SHARD) action: keep -- job_name: ns1-target-importer - honor_labels: true - scrape_interval: 15s - scheme: http - kubernetes_sd_configs: - - api_server: null - role: pod - namespaces: - names: - - ns1 - tls_config: - insecure_skip_verify: true - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - action: keep - regex: target - - source_labels: - - __meta_kubernetes_namespace - action: keep - regex: ns1 - - source_labels: - - __meta_kubernetes_pod_annotation_prometheus_io_scrape - action: keep - regex: "true" - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_component - action: keep - regex: importer - - action: replace - regex: (.+);(.+);(.+);(.+) - replacement: $1.$2-importer.$3:$4 - target_label: __address__ - source_labels: - - __meta_kubernetes_pod_name - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - - __meta_kubernetes_namespace - - __meta_kubernetes_pod_annotation_prometheus_io_port - - source_labels: - - __meta_kubernetes_namespace - action: replace - target_label: kubernetes_namespace - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - action: replace - target_label: cluster - - source_labels: - - __meta_kubernetes_pod_name - action: replace - target_label: instance - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_component - action: replace - target_label: component - - source_labels: - - __meta_kubernetes_namespace - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - separator: '-' - target_label: tidb_cluster - - source_labels: - - __meta_kubernetes_pod_annotation_prometheus_io_path - action: replace - target_label: __metrics_path__ - regex: (.+) - - source_labels: - - __address__ - action: hashmod - target_label: __tmp_hash - modulus: 0 - - source_labels: - - __tmp_hash - regex: $(SHARD) - action: keep - job_name: ns1-target-lightning honor_labels: true scrape_interval: 15s @@ -2834,81 +2688,6 @@ scrape_configs: - __tmp_hash regex: $(SHARD) action: keep -- job_name: ns1-target-importer - honor_labels: true - scrape_interval: 15s - scheme: https - kubernetes_sd_configs: - - api_server: null - role: pod - namespaces: - names: - - ns1 - tls_config: - ca_file: /var/lib/cluster-assets-tls/secret_ns1_target-cluster-client-secret_ca.crt - cert_file: /var/lib/cluster-assets-tls/secret_ns1_target-cluster-client-secret_tls.crt - key_file: /var/lib/cluster-assets-tls/secret_ns1_target-cluster-client-secret_tls.key - relabel_configs: - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - action: keep - regex: target - - source_labels: - - __meta_kubernetes_namespace - action: keep - regex: ns1 - - source_labels: - - __meta_kubernetes_pod_annotation_prometheus_io_scrape - action: keep - regex: "true" - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_component - action: keep - regex: importer - - action: replace - regex: (.+);(.+);(.+);(.+) - replacement: $1.$2-importer.$3:$4 - target_label: __address__ - source_labels: - - __meta_kubernetes_pod_name - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - - __meta_kubernetes_namespace - - __meta_kubernetes_pod_annotation_prometheus_io_port - - source_labels: - - __meta_kubernetes_namespace - action: replace - target_label: kubernetes_namespace - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - action: replace - target_label: cluster - - source_labels: - - __meta_kubernetes_pod_name - action: replace - target_label: instance - - source_labels: - - __meta_kubernetes_pod_label_app_kubernetes_io_component - action: replace - target_label: component - - source_labels: - - __meta_kubernetes_namespace - - __meta_kubernetes_pod_label_app_kubernetes_io_instance - separator: '-' - target_label: tidb_cluster - - source_labels: - - __meta_kubernetes_pod_annotation_prometheus_io_path - action: replace - target_label: __metrics_path__ - regex: (.+) - - source_labels: - - __address__ - action: hashmod - target_label: __tmp_hash - modulus: 0 - - source_labels: - - __tmp_hash - regex: $(SHARD) - action: keep - job_name: ns1-target-lightning honor_labels: true scrape_interval: 15s @@ -3190,7 +2969,7 @@ func TestMultipleClusterConfigRender(t *testing.T) { for _, item := range pc { key := item.Key if key == "scrape_configs" { - g.Expect(len(item.Value.([]yaml.MapSlice))).Should(Equal(26)) + g.Expect(len(item.Value.([]yaml.MapSlice))).Should(Equal(24)) } }