From dcdb76d5b5e7296f09c8b3de98bb9b393c0871be Mon Sep 17 00:00:00 2001 From: linxin Date: Tue, 7 May 2024 17:30:42 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=E4=BF=AE=E5=A4=8Dpacket-io?= =?UTF-8?q?=E6=9C=AA=E6=AD=A3=E5=BC=8F=E8=BF=90=E8=A1=8C=E6=97=B6=E5=AF=BC?= =?UTF-8?q?=E8=87=B4monit=E7=9B=B8=E5=85=B3=E5=AE=B9=E5=99=A8=E9=87=8D?= =?UTF-8?q?=E5=90=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../helm/templates/deployment-mrzcpd.yaml | 100 ++++++++++++++++-- 1 file changed, 94 insertions(+), 6 deletions(-) diff --git a/ansible/roles/mrzcpd/files/helm/templates/deployment-mrzcpd.yaml b/ansible/roles/mrzcpd/files/helm/templates/deployment-mrzcpd.yaml index 0d2d4724..6a5f46c2 100644 --- a/ansible/roles/mrzcpd/files/helm/templates/deployment-mrzcpd.yaml +++ b/ansible/roles/mrzcpd/files/helm/templates/deployment-mrzcpd.yaml @@ -168,6 +168,7 @@ spec: - "bash" - "-ec" - | + rm -f /run/mrzcpd/mrmonit.daemon rm -f /run/mrzcpd/huge_pages/rtemap_* rm -f /run/.rte_config rm -f /run/.rte_hugepage_info @@ -176,11 +177,40 @@ spec: privileged: true - command: - - /opt/tsg/mrzcpd/bin/monit_device - - --prometheus-client + - "bash" + - "-ec" + - | + while ! nc -z localhost 9086; do sleep 1; done; + /opt/tsg/mrzcpd/bin/monit_device --prometheus-client image: "registry.gdnt-cloud.website/tsg-packet-io-engine:{{ .Chart.AppVersion }}" imagePullPolicy: Never name: mrapm-device +{{- if eq .Values.mrzcpd.debug.enable_liveness_probe .Values.define_enable_val_yes }} + livenessProbe: + httpGet: + host: 127.0.0.1 + httpHeaders: + - name: Custom-Header + value: Awesome + path: /probe + port: 9086 + initialDelaySeconds: 20 + periodSeconds: 3 + successThreshold: 1 + timeoutSeconds: 1 + startupProbe: + httpGet: + host: 127.0.0.1 + httpHeaders: + - name: Custom-Header + value: Awesome + path: /probe + port: 9086 + initialDelaySeconds: 20 + periodSeconds: 3 + successThreshold: 1 + timeoutSeconds: 1 +{{- end }} volumeMounts: - mountPath: /var/run/mrzcpd name: run-mrzcpd @@ -192,11 +222,40 @@ spec: name: localtime-node readOnly: true - command: - - /opt/tsg/mrzcpd/bin/monit_stream - - --prometheus-client + - "bash" + - "-ec" + - | + while ! nc -z localhost 9086; do sleep 1; done; + /opt/tsg/mrzcpd/bin/monit_stream --prometheus-client image: "registry.gdnt-cloud.website/tsg-packet-io-engine:{{ .Chart.AppVersion }}" imagePullPolicy: Never name: monit-stream +{{- if eq .Values.mrzcpd.debug.enable_liveness_probe .Values.define_enable_val_yes }} + livenessProbe: + httpGet: + host: 127.0.0.1 + httpHeaders: + - name: Custom-Header + value: Awesome + path: /probe + port: 9086 + initialDelaySeconds: 20 + periodSeconds: 3 + successThreshold: 1 + timeoutSeconds: 1 + startupProbe: + httpGet: + host: 127.0.0.1 + httpHeaders: + - name: Custom-Header + value: Awesome + path: /probe + port: 9086 + initialDelaySeconds: 20 + periodSeconds: 3 + successThreshold: 1 + timeoutSeconds: 1 +{{- end }} volumeMounts: - mountPath: /var/run/mrzcpd name: run-mrzcpd @@ -208,11 +267,40 @@ spec: name: localtime-node readOnly: true - command: - - /opt/tsg/mrzcpd/bin/monit_obp - - --prometheus-client + - "bash" + - "-ec" + - | + while ! nc -z localhost 9086; do sleep 1; done; + /opt/tsg/mrzcpd/bin/monit_obp --prometheus-client image: "registry.gdnt-cloud.website/tsg-packet-io-engine:{{ .Chart.AppVersion }}" imagePullPolicy: Never name: monit-obp +{{- if eq .Values.mrzcpd.debug.enable_liveness_probe .Values.define_enable_val_yes }} + livenessProbe: + httpGet: + host: 127.0.0.1 + httpHeaders: + - name: Custom-Header + value: Awesome + path: /probe + port: 9086 + initialDelaySeconds: 20 + periodSeconds: 3 + successThreshold: 1 + timeoutSeconds: 1 + startupProbe: + httpGet: + host: 127.0.0.1 + httpHeaders: + - name: Custom-Header + value: Awesome + path: /probe + port: 9086 + initialDelaySeconds: 20 + periodSeconds: 3 + successThreshold: 1 + timeoutSeconds: 1 +{{- end }} volumeMounts: - mountPath: /var/run/mrzcpd name: run-mrzcpd