From 5f95e32e6a4dfcb3eb5b65f81f2a15ecc3f19f34 Mon Sep 17 00:00:00 2001 From: sophon Date: Thu, 24 Oct 2024 14:18:01 +0800 Subject: [PATCH 1/2] chore: removed agamotto addon --- .../apecloud-otel-collector-addon.yaml | 52 ----- .../apecloud-otel-collector-values.yaml | 22 --- deploy/helm/values.yaml | 79 -------- .../instanceset/revision_util_test.go | 179 +----------------- 4 files changed, 1 insertion(+), 331 deletions(-) delete mode 100644 deploy/helm/templates/applications/apecloud-otel-collector-addon.yaml delete mode 100644 deploy/helm/templates/applications/apecloud-otel-collector-values.yaml diff --git a/deploy/helm/templates/applications/apecloud-otel-collector-addon.yaml b/deploy/helm/templates/applications/apecloud-otel-collector-addon.yaml deleted file mode 100644 index 4635c7895e2..00000000000 --- a/deploy/helm/templates/applications/apecloud-otel-collector-addon.yaml +++ /dev/null @@ -1,52 +0,0 @@ -{{- if has "apecloud-otel-collector" .Values.autoInstalledAddons }} -apiVersion: extensions.kubeblocks.io/v1alpha1 -kind: Addon -metadata: - name: apecloud-otel-collector - labels: - {{- include "kubeblocks.labels" . | nindent 4 }} - "addon.kubeblocks.io/provider": apecloud - "addon.kubeblocks.io/version": "0.1.2-beta.3" - {{- if .Values.keepAddons }} - annotations: - helm.sh/resource-policy: keep - {{- end }} -spec: - description: apecloud-otel-collector is a high-performance data collection agent with luxuriant function, which inspired by OpenTelemetry. - type: Helm - - helm: - {{- include "kubeblocks.addonChartLocationURL" ( dict "name" "apecloud-otel-collector" "version" "0.1.2-beta.3" "values" .Values) | indent 4 }} - {{- include "kubeblocks.addonChartsImage" . | indent 4 }} - {{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "0.1.2-beta.3" "values" .Values) | indent 4 }} - - installValues: - configMapRefs: - - name: {{ include "addon.apecloud-otel-collector.name" . }}-chart-kubeblocks-values - key: values-kubeblocks-override.yaml - - valuesMapping: - jsonMap: - tolerations: tolerations - resources: - cpu: - requests: resources.requests.cpu - limits: resources.limits.cpu - memory: - requests: resources.requests.memory - limits: resources.limits.memory - - defaultInstallValues: - - enabled: true - {{- $tolerations := .Values.tolerations }} - {{- $dataPlaneTolerations := .Values.dataPlane.tolerations }} - {{- $mergedTolerations := concat $tolerations $dataPlaneTolerations }} - {{- with $mergedTolerations }} - tolerations: {{ toJson . | quote }} - {{- end }} - - installable: - autoInstall: {{ .Values.agamotto.enabled }} -{{- end }} - - diff --git a/deploy/helm/templates/applications/apecloud-otel-collector-values.yaml b/deploy/helm/templates/applications/apecloud-otel-collector-values.yaml deleted file mode 100644 index 0197687d3e0..00000000000 --- a/deploy/helm/templates/applications/apecloud-otel-collector-values.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- if has "apecloud-otel-collector" .Values.autoInstalledAddons }} - {{- $imageRegistry := include "kubeblocks.imageRegistry" . }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "addon.apecloud-otel-collector.name" . }}-chart-kubeblocks-values - labels: - {{- include "kubeblocks.labels" . | nindent 4 }} - {{- if .Values.keepAddons }} - annotations: - helm.sh/resource-policy: keep - {{- end }} -data: - values-kubeblocks-override.yaml: |- - {{- $agamotto := get .Values "agamotto" }} - {{- $image := get $agamotto "image" }} - {{- if not $image.registry }} - {{- $image = set $image "registry" $imageRegistry }} - {{- end }} - {{- $agamotto = set $agamotto "image" $image }} - {{- toYaml $agamotto | nindent 4 }} -{{- end }} \ No newline at end of file diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml index e33791e5db1..fa0e64bff34 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -1475,9 +1475,6 @@ prometheus: - source_labels: [__meta_kubernetes_service_label_app_kubernetes_io_managed_by] action: keep regex: kubeblocks - - source_labels: [__meta_kubernetes_service_label_monitor_kubeblocks_io_managed_by] - action: drop - regex: agamotto - source_labels: [__meta_kubernetes_service_annotation_monitor_kubeblocks_io_scrape] action: keep regex: true @@ -1515,39 +1512,6 @@ prometheus: regex: Succeeded|Failed|Completed action: drop - - job_name: 'kubeblocks-agamotto' - honor_labels: true - - kubernetes_sd_configs: - - role: endpoints - - relabel_configs: - - source_labels: [__meta_kubernetes_service_label_monitor_kubeblocks_io_managed_by] - action: keep - regex: agamotto - - source_labels: [__meta_kubernetes_service_annotation_monitor_kubeblocks_io_scrape] - action: keep - regex: true - - source_labels: [__meta_kubernetes_service_annotation_monitor_kubeblocks_io_scheme] - action: replace - target_label: __scheme__ - regex: (https?) - - source_labels: [__meta_kubernetes_service_annotation_monitor_kubeblocks_io_path] - action: replace - target_label: __metrics_path__ - regex: (.+) - - source_labels: [__address__, __meta_kubernetes_service_annotation_monitor_kubeblocks_io_port] - action: replace - target_label: __address__ - regex: (.+?)(?::\d+)?;(\d+) - replacement: $1:$2 - - action: labelmap - regex: __meta_kubernetes_service_annotation_monitor_kubeblocks_io_param_(.+) - replacement: __param_$1 - - source_labels: [__meta_kubernetes_pod_phase] - regex: Pending|Succeeded|Failed|Completed - action: drop - pushgateway: ## If false, pushgateway will not be installed ## @@ -1817,13 +1781,6 @@ enabledAlphaFeatureGates: recoverVolumeExpansionFailure: false -agamotto: - enabled: false - image: - # if the value of agamotto.image.registry is not specified using `--set`, it will be set to the value of 'image.registry' by default - registry: "" - - provider: "" # cloud be "aws","gcp","aliyun","tencentCloud", "huaweiCloud", "azure" validProviders: - "aws" @@ -1935,9 +1892,6 @@ vmagent: - source_labels: [ __meta_kubernetes_service_label_app_kubernetes_io_managed_by ] action: keep regex: kubeblocks - - source_labels: [ __meta_kubernetes_service_label_monitor_kubeblocks_io_managed_by ] - action: drop - regex: agamotto - source_labels: [ __meta_kubernetes_service_annotation_monitor_kubeblocks_io_scrape ] action: keep regex: true @@ -1975,39 +1929,6 @@ vmagent: regex: Pending|Succeeded|Failed|Completed action: drop - - job_name: 'kubeblocks-agamotto' - honor_labels: true - - kubernetes_sd_configs: - - role: endpoints - - relabel_configs: - - source_labels: [ __meta_kubernetes_service_label_monitor_kubeblocks_io_managed_by ] - action: keep - regex: agamotto - - source_labels: [ __meta_kubernetes_service_annotation_monitor_kubeblocks_io_scrape ] - action: keep - regex: true - - source_labels: [ __meta_kubernetes_service_annotation_monitor_kubeblocks_io_scheme ] - action: replace - target_label: __scheme__ - regex: (https?) - - source_labels: [ __meta_kubernetes_service_annotation_monitor_kubeblocks_io_path ] - action: replace - target_label: __metrics_path__ - regex: (.+) - - source_labels: [ __address__, __meta_kubernetes_service_annotation_monitor_kubeblocks_io_port ] - action: replace - target_label: __address__ - regex: (.+?)(?::\d+)?;(\d+) - replacement: $1:$2 - - action: labelmap - regex: __meta_kubernetes_service_annotation_monitor_kubeblocks_io_param_(.+) - replacement: __param_$1 - - source_labels: [ __meta_kubernetes_pod_phase ] - regex: Pending|Succeeded|Failed|Completed - action: drop - crd: enabled: true diff --git a/pkg/controller/instanceset/revision_util_test.go b/pkg/controller/instanceset/revision_util_test.go index 9347a12da3a..334173c8a02 100644 --- a/pkg/controller/instanceset/revision_util_test.go +++ b/pkg/controller/instanceset/revision_util_test.go @@ -406,183 +406,6 @@ var _ = Describe("revision util test", func() { } ] }, - { - "command": [ - "/bin/agamotto", - "--config=/opt/conf/metrics-config.yaml" - ], - "env": [ - { - "name": "KB_POD_NAME", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "metadata.name" - } - } - }, - { - "name": "KB_POD_UID", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "metadata.uid" - } - } - }, - { - "name": "KB_NAMESPACE", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "metadata.namespace" - } - } - }, - { - "name": "KB_SA_NAME", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "spec.serviceAccountName" - } - } - }, - { - "name": "KB_NODENAME", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "spec.nodeName" - } - } - }, - { - "name": "KB_HOST_IP", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "status.hostIP" - } - } - }, - { - "name": "KB_POD_IP", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "status.podIP" - } - } - }, - { - "name": "KB_POD_IPS", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "status.podIPs" - } - } - }, - { - "name": "KB_HOSTIP", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "status.hostIP" - } - } - }, - { - "name": "KB_PODIP", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "status.podIP" - } - } - }, - { - "name": "KB_PODIPS", - "valueFrom": { - "fieldRef": { - "apiVersion": "v1", - "fieldPath": "status.podIPs" - } - } - }, - { - "name": "KB_POD_FQDN", - "value": "$(KB_POD_NAME).redis-test-redis-headless.$(KB_NAMESPACE).svc" - }, - { - "name": "ENDPOINT", - "value": "localhost:6379" - }, - { - "name": "REDIS_USER", - "valueFrom": { - "secretKeyRef": { - "key": "username", - "name": "redis-test-conn-credential", - "optional": false - } - } - }, - { - "name": "REDIS_PASSWORD", - "valueFrom": { - "secretKeyRef": { - "key": "password", - "name": "redis-test-conn-credential", - "optional": false - } - } - } - ], - "envFrom": [ - { - "configMapRef": { - "name": "redis-test-redis-env", - "optional": false - } - }, - { - "configMapRef": { - "name": "redis-test-redis-its-env", - "optional": false - } - } - ], - "image": "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/agamotto:0.1.2-beta.1", - "imagePullPolicy": "IfNotPresent", - "name": "metrics", - "ports": [ - { - "containerPort": 9121, - "name": "http-metrics", - "protocol": "TCP" - } - ], - "resources": { - "limits": { - "cpu": "0", - "memory": "0" - } - }, - "securityContext": { - "runAsNonRoot": true, - "runAsUser": 1001 - }, - "terminationMessagePath": "/dev/termination-log", - "terminationMessagePolicy": "File", - "volumeMounts": [ - { - "mountPath": "/opt/conf", - "name": "redis-metrics-config" - } - ] - }, { "command": [ "role-probe", @@ -961,7 +784,7 @@ var _ = Describe("revision util test", func() { Expect(err).Should(Succeed()) cr, err := NewRevision(its) Expect(err).Should(Succeed()) - Expect(cr.Name).Should(Equal("redis-test-redis-56666f656d")) + Expect(cr.Name).Should(Equal("redis-test-redis-cc4cd5c55")) }) }) From f83e86de974beafc03cff90ddf083ebcd74ac656 Mon Sep 17 00:00:00 2001 From: sophon Date: Fri, 25 Oct 2024 14:53:08 +0800 Subject: [PATCH 2/2] chore: remove apecloud-otel-collector from values.yaml --- deploy/helm/templates/_helpers.tpl | 7 ------- deploy/helm/values.yaml | 1 - 2 files changed, 8 deletions(-) diff --git a/deploy/helm/templates/_helpers.tpl b/deploy/helm/templates/_helpers.tpl index 034e4d003a6..08483b5ea01 100644 --- a/deploy/helm/templates/_helpers.tpl +++ b/deploy/helm/templates/_helpers.tpl @@ -270,13 +270,6 @@ Define addon loki name {{- print "loki" }} {{- end }} -{{/* -Define addon apecloud-otel-collector name -*/}} -{{- define "addon.apecloud-otel-collector.name" -}} -{{- print "apecloud-otel-collector" }} -{{- end }} - {{/* Get cloud provider, now support aws, gcp, aliyun and tencentCloud. TODO: For azure, we should get provider from node.Spec.ProviderID diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml index fa0e64bff34..497727414d8 100644 --- a/deploy/helm/values.yaml +++ b/deploy/helm/values.yaml @@ -474,7 +474,6 @@ autoInstalledAddons: - "qdrant" - "redis" - "alertmanager-webhook-adaptor" - - "apecloud-otel-collector" - "aws-load-balancer-controller" - "csi-hostpath-driver" - "csi-driver-nfs"