From d469503e841af0eef83f8a06742b0ec339a96611 Mon Sep 17 00:00:00 2001 From: Erwan Miran Date: Mon, 29 Jul 2024 08:57:56 +0200 Subject: [PATCH] Make netchecker log levels configurable (#11334) * Make netchecker log levels configurable * use ETCD_LOG_LEVEL --- roles/kubernetes-apps/ansible/defaults/main.yml | 5 +++++ .../ansible/templates/netchecker-agent-ds.yml.j2 | 2 +- .../ansible/templates/netchecker-agent-hostnet-ds.yml.j2 | 2 +- .../ansible/templates/netchecker-server-deployment.yml.j2 | 5 ++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/roles/kubernetes-apps/ansible/defaults/main.yml b/roles/kubernetes-apps/ansible/defaults/main.yml index 726e7fc21..daebd07f6 100644 --- a/roles/kubernetes-apps/ansible/defaults/main.yml +++ b/roles/kubernetes-apps/ansible/defaults/main.yml @@ -94,6 +94,11 @@ netchecker_server_user: 1000 netchecker_agent_group: 1000 netchecker_server_group: 1000 +# Log levels +netchecker_agent_log_level: 5 +netchecker_server_log_level: 5 +netchecker_etcd_log_level: info + # Dashboard dashboard_replicas: 1 diff --git a/roles/kubernetes-apps/ansible/templates/netchecker-agent-ds.yml.j2 b/roles/kubernetes-apps/ansible/templates/netchecker-agent-ds.yml.j2 index 40dd199e0..b1461b61f 100644 --- a/roles/kubernetes-apps/ansible/templates/netchecker-agent-ds.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/netchecker-agent-ds.yml.j2 @@ -35,7 +35,7 @@ spec: fieldRef: fieldPath: spec.nodeName args: - - "-v=5" + - "-v={{ netchecker_agent_log_level }}" - "-alsologtostderr=true" - "-serverendpoint=netchecker-service:8081" - "-reportinterval={{ agent_report_interval }}" diff --git a/roles/kubernetes-apps/ansible/templates/netchecker-agent-hostnet-ds.yml.j2 b/roles/kubernetes-apps/ansible/templates/netchecker-agent-hostnet-ds.yml.j2 index 50e279335..2dd113cc6 100644 --- a/roles/kubernetes-apps/ansible/templates/netchecker-agent-hostnet-ds.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/netchecker-agent-hostnet-ds.yml.j2 @@ -37,7 +37,7 @@ spec: fieldRef: fieldPath: spec.nodeName args: - - "-v=5" + - "-v={{ netchecker_agent_log_level }}" - "-alsologtostderr=true" - "-serverendpoint=netchecker-service:8081" - "-reportinterval={{ agent_report_interval }}" diff --git a/roles/kubernetes-apps/ansible/templates/netchecker-server-deployment.yml.j2 b/roles/kubernetes-apps/ansible/templates/netchecker-server-deployment.yml.j2 index 02fd6b680..2f5c003f1 100644 --- a/roles/kubernetes-apps/ansible/templates/netchecker-server-deployment.yml.j2 +++ b/roles/kubernetes-apps/ansible/templates/netchecker-server-deployment.yml.j2 @@ -43,7 +43,7 @@ spec: ports: - containerPort: 8081 args: - - -v=5 + - -v={{ netchecker_server_log_level }} - -logtostderr - -kubeproxyinit=false - -endpoint=0.0.0.0:8081 @@ -51,6 +51,9 @@ spec: - name: etcd image: "{{ etcd_image_repo }}:{{ netcheck_etcd_image_tag }}" imagePullPolicy: {{ k8s_image_pull_policy }} + env: + - name: ETCD_LOG_LEVEL + value: "{{ netchecker_etcd_log_level }}" command: - etcd - --listen-client-urls=http://127.0.0.1:2379