From 05e3b896690298e7bcb774102356ff85950ad6fc Mon Sep 17 00:00:00 2001 From: Kalin Krustev Date: Mon, 7 Oct 2024 16:05:41 +0000 Subject: [PATCH] fix monitoring OutOfSync loop --- .../install/values-grafana-operator.yaml.tpl | 6 +++- .../install/values-prom-operator.yaml.tpl | 28 +++++++++++-------- .../monitoring/monitoring-install.yaml.tpl | 8 ++++++ 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/terraform/gitops/generate-files/templates/monitoring/install/values-grafana-operator.yaml.tpl b/terraform/gitops/generate-files/templates/monitoring/install/values-grafana-operator.yaml.tpl index 043ea2bf8..8e405f138 100644 --- a/terraform/gitops/generate-files/templates/monitoring/install/values-grafana-operator.yaml.tpl +++ b/terraform/gitops/generate-files/templates/monitoring/install/values-grafana-operator.yaml.tpl @@ -4,4 +4,8 @@ operator: nodeAffinityPreset: type: hard key: workload-class.mojaloop.io/MONITORING - values: ["enabled"] \ No newline at end of file + values: ["enabled"] + resources: + requests: + cpu: 20m + memory: 100Mi diff --git a/terraform/gitops/generate-files/templates/monitoring/install/values-prom-operator.yaml.tpl b/terraform/gitops/generate-files/templates/monitoring/install/values-prom-operator.yaml.tpl index a436af226..0539c2403 100644 --- a/terraform/gitops/generate-files/templates/monitoring/install/values-prom-operator.yaml.tpl +++ b/terraform/gitops/generate-files/templates/monitoring/install/values-prom-operator.yaml.tpl @@ -11,7 +11,7 @@ alertmanager: nodeAffinityPreset: type: hard key: workload-class.mojaloop.io/MONITORING - values: ["enabled"] + values: ["enabled"] prometheus: persistence: enabled: true @@ -37,23 +37,27 @@ prometheus: - name: central-monitoring url: ${central_observability_endpoint}/api/v1/push headers: - X-Scope-OrgID: ${central_observability_tenant_id} -%{endif ~} + X-Scope-OrgID: ${central_observability_tenant_id} +%{endif ~} %{if enable_central_observability_read ~} remoteRead: - name: central-monitoring url: ${central_observability_endpoint}/prometheus/api/v1/read headers: - X-Scope-OrgID: ${central_observability_tenant_id} -%{endif ~} + X-Scope-OrgID: ${central_observability_tenant_id} +%{endif ~} operator: nodeAffinityPreset: type: hard key: workload-class.mojaloop.io/MONITORING - values: ["enabled"] + values: ["enabled"] + resources: + requests: + cpu: 20m + memory: 100Mi kubelet: serviceMonitor: relabelings: @@ -64,19 +68,19 @@ kubelet: targetLabel: kubernetes_io_hostname replacement: $${1} action: replace - metricRelabelings: + metricRelabelings: - sourceLabels: ['__name__'] regex: 'apiserver_request_duration_seconds_bucket|apiserver_request_sli_duration_seconds_bucket' action: drop - sourceLabels: ['__name__'] regex: 'apiserver_request_body_size_bytes_bucket|apiserver_response_sizes_bucket' - action: drop + action: drop - sourceLabels: ['__name__'] regex: 'etcd_request_duration_seconds_bucket' action: drop kubeApiServer: - enabled: false + enabled: false commonLabels: build: argocd @@ -85,14 +89,14 @@ commonAnnotations: node-exporter: serviceMonitor: - relabelings: + relabelings: - sourceLabels: [__meta_kubernetes_pod_node_name] targetLabel: nodename tolerations: - operator: "Exists" blackboxExporter: - enabled: false + enabled: false nodeAffinityPreset: type: hard key: workload-class.mojaloop.io/MONITORING - values: ["enabled"] \ No newline at end of file + values: ["enabled"] \ No newline at end of file diff --git a/terraform/gitops/generate-files/templates/monitoring/monitoring-install.yaml.tpl b/terraform/gitops/generate-files/templates/monitoring/monitoring-install.yaml.tpl index ea4a6ad8b..97a13b893 100644 --- a/terraform/gitops/generate-files/templates/monitoring/monitoring-install.yaml.tpl +++ b/terraform/gitops/generate-files/templates/monitoring/monitoring-install.yaml.tpl @@ -29,6 +29,14 @@ spec: kind: StatefulSet jqPathExpressions: - ".spec.volumeClaimTemplates[]?" + - group: admissionregistration.k8s.io + kind: MutatingWebhookConfiguration + jqPathExpressions: + - .webhooks[]?.clientConfig.caBundle + - group: admissionregistration.k8s.io + kind: ValidatingWebhookConfiguration + jqPathExpressions: + - .webhooks[]?.clientConfig.caBundle syncPolicy: automated: prune: true