From 7d117fd810ee39747b979c67f377727fe82a2028 Mon Sep 17 00:00:00 2001 From: linxin Date: Mon, 4 Nov 2024 18:51:53 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:TSG-23355:Change=20the=20mou?= =?UTF-8?q?nt=20type=20of=20dp-trace=20and=20packet-io=20configmaps=20from?= =?UTF-8?q?=20file=20to=20directory.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dp-trace-telemetry/templates/dp_trace_dy.conf.j2 | 5 ++--- .../dp-trace-telemetry/helm/templates/deployment.yaml | 9 ++++----- .../packet-io-engine/helm/templates/deployment.yaml | 9 ++++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/containers/dp-trace-telemetry/templates/dp_trace_dy.conf.j2 b/containers/dp-trace-telemetry/templates/dp_trace_dy.conf.j2 index 9a8146e6..252ad84c 100644 --- a/containers/dp-trace-telemetry/templates/dp_trace_dy.conf.j2 +++ b/containers/dp-trace-telemetry/templates/dp_trace_dy.conf.j2 @@ -4,10 +4,9 @@ dp_trace_merge_timeout=30 {% if datapath_trace.rule -%} {% for rule in datapath_trace.rule -%} [dp_trace_rule:{{ rule.id }}] -{%- if rule.enable == "yes" -%} +{% if rule.enable -%} enable=1 -{% endif -%} -{%- if rule.enable == "no" -%} +{% else -%} enable=0 {% endif -%} {%- if rule.bpf_expr is defined -%} diff --git a/helmcharts/dp-trace-telemetry/helm/templates/deployment.yaml b/helmcharts/dp-trace-telemetry/helm/templates/deployment.yaml index 502392af..4bb237be 100644 --- a/helmcharts/dp-trace-telemetry/helm/templates/deployment.yaml +++ b/helmcharts/dp-trace-telemetry/helm/templates/deployment.yaml @@ -43,18 +43,17 @@ spec: - "bash" - "-ec" - | - /usr/local/bin/j2 -f yaml /templates/dp_trace_dy.conf.j2 /templates/values.yaml -o /opt/tsg/dp_trace_telemetry/share_conf/dp_trace_dy.conf - WATCH_DIR="/templates/values.yaml" + /usr/local/bin/j2 -f yaml /templates/dp_trace_dy.conf.j2 /templates/configmap/values.yaml -o /opt/tsg/dp_trace_telemetry/share_conf/dp_trace_dy.conf + WATCH_DIR="/templates/configmap" while inotifywait -r -e modify,create "$WATCH_DIR"; do echo "send HUB signal to dp_trace" - /usr/local/bin/j2 -f yaml /templates/dp_trace_dy.conf.j2 /templates/values.yaml -o /opt/tsg/dp_trace_telemetry/share_conf/dp_trace_dy.conf + /usr/local/bin/j2 -f yaml /templates/dp_trace_dy.conf.j2 /templates/configmap/values.yaml -o /opt/tsg/dp_trace_telemetry/share_conf/dp_trace_dy.conf pkill -1 dp-trace-telemetry echo "signal send" done volumeMounts: - name: dp-trace-dy - mountPath: "/templates/values.yaml" - subPath: "values.yaml" + mountPath: "/templates/configmap" - name: share-config mountPath: /opt/tsg/dp_trace_telemetry/share_conf/ lifecycle: diff --git a/helmcharts/packet-io-engine/helm/templates/deployment.yaml b/helmcharts/packet-io-engine/helm/templates/deployment.yaml index 9d5249ac..36c82b15 100644 --- a/helmcharts/packet-io-engine/helm/templates/deployment.yaml +++ b/helmcharts/packet-io-engine/helm/templates/deployment.yaml @@ -43,11 +43,11 @@ spec: - "bash" - "-ec" - | - /usr/local/bin/j2 -f yaml /templates/mrglobal.dynamic.conf.j2 /templates/values.yaml -o /opt/tsg/config/shared/mrglobal.dynamic.conf - WATCH_DIR="/templates/values.yaml" + /usr/local/bin/j2 -f yaml /templates/mrglobal.dynamic.conf.j2 /templates/configmap/values.yaml -o /opt/tsg/config/shared/mrglobal.dynamic.conf + WATCH_DIR="/templates/configmap" while inotifywait -r -e modify,create "$WATCH_DIR"; do echo "send HUB signal to mrzcpd" - /usr/local/bin/j2 -f yaml /templates/mrglobal.dynamic.conf.j2 /templates/values.yaml -o /opt/tsg/config/shared/mrglobal.dynamic.conf + /usr/local/bin/j2 -f yaml /templates/mrglobal.dynamic.conf.j2 /templates/configmap/values.yaml -o /opt/tsg/config/shared/mrglobal.dynamic.conf pkill -1 mrzcpd echo "signal send" done @@ -55,8 +55,7 @@ spec: - name: shared-dir mountPath: /opt/tsg/config/shared - name: packet-io-engine-reload-conf - mountPath: /templates/values.yaml - subPath: "values.yaml" + mountPath: /templates/configmap securityContext: privileged: true lifecycle: