跳到主要内容
版本:v3&v6

开启/关闭插件远程调试

操作步骤

进入 K3S 机器

sudo su -

根据插件instanceID找到对应的configMap,并且编辑

kubectl -n{namespace} get configmap | grep plugin-runtime-{instanceID}
kubectl -n{namespace} edit configmap plugin-runtime-{instanceID}-configmap

在configMap的config.yaml中添加local配置

apiVersion: v1
kind: ConfigMap
metadata:
name: plugin-runtime-{instaceID}-configmap
namespace: {namespace}
...
annotations:
appID: 9OSk7Lpw
appName: 工时审批
...
selfLink: ...
data:
config.yaml: |
platform:
...
runtime:
...
plugin:
...
local:
log_level: debug
debug_mode: true

删除对应的插件pod

kubectl -n{namespace} get pod |grep plugin-runtime-{instanceID}
kubectl -n{namespace} delete pod {podname}

验证

kubectl -n{namespace} logs  {podname}
日志包含了debug级别的日志
time=2025-01-09T15:52:59+08:00 level=Debug role=Host app=9OSk7Lpw instance={instanceID} msg="... "