Skip to content

Commit d2e8cfc

Browse files
authored
feat(observability): add logLevel option to module config (#194)
Sets a logLevel for this components: - virtualization-api - virtualization-controller - kube-api-proxy - vmi-router Signed-off-by: Roman Sysoev <[email protected]>
1 parent ecffccb commit d2e8cfc

File tree

6 files changed

+39
-2
lines changed

6 files changed

+39
-2
lines changed

openapi/config-values.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,18 @@ properties:
184184
properties:
185185
type:
186186
enum: ["ObjectStorage"]
187+
logLevel:
188+
type: string
189+
description: |
190+
Sets a logging level.
191+
192+
Working for this components:
193+
- `virtualization-api`
194+
- `virtualization-controller`
195+
- `kube-api-proxy`
196+
- `vmi-router`
197+
enum:
198+
- "debug"
199+
- "info"
200+
- "warning"
201+
- "error"

openapi/doc-ru-config-values.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,13 @@ properties:
9191
bucket:
9292
description: |
9393
Контейнер, в котором вы можете хранить свои файлы и объекты данных.
94+
logLevel:
95+
type: string
96+
description: |
97+
Устанавливает уровень логирования.
98+
99+
Работает для следующих компонентов:
100+
- `virtualization-api`
101+
- `virtualization-controller`
102+
- `kube-api-proxy`
103+
- `vmi-router`

templates/_kube_api_rewriter.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- define "kube_api_rewriter.env" -}}
22
- name: LOG_LEVEL
3-
value: Debug
3+
value: {{ .Values.virtualization.logLevel }}
44
{{- end -}}
55

66
{{- define "kubeproxy_resources" -}}
@@ -31,7 +31,7 @@ spec:
3131
image: {{ $proxyImage }}
3232
imagePullPolicy: IfNotPresent
3333
env:
34-
{{- include "kube_api_rewriter.env" . | nindent 8 }}
34+
{{- include "kube_api_rewriter.env" $ctx | nindent 8 }}
3535
resources:
3636
requests:
3737
{{- include "helm_lib_module_ephemeral_storage_only_logs" . | nindent 12 }}

templates/kubevirt/vmi-router/daemonset.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ spec:
6565
valueFrom:
6666
fieldRef:
6767
fieldPath: spec.nodeName
68+
{{- if eq .Values.virtualization.logLevel "debug" }}
69+
- name: VERBOSITY
70+
value: "10"
71+
{{- end }}
6872
resources:
6973
requests:
7074
{{- include "helm_lib_module_ephemeral_storage_only_logs" . | nindent 14 }}

templates/virtualization-api/deployment.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ spec:
6565
- --kubevirt-cabundle=/etc/virt-api/certificates/ca.crt
6666
- --kubevirt-endpoint=virt-api.d8-{{ .Chart.Name}}.svc
6767
- --secure-port=8443
68+
{{- if eq .Values.virtualization.logLevel "debug" }}
69+
- --v=10
70+
{{- else }}
6871
- --v=3
72+
{{- end }}
6973
- --tls-cert-file=/etc/virtualziation-api/certificates/tls.crt
7074
- --tls-private-key-file=/etc/virtualziation-api/certificates/tls.key
7175
- --proxy-client-cert-file=/etc/virtualziation-api-proxy/certificates/tls.crt

templates/virtualization-controller/_helpers.tpl

+4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
- name: KUBECONFIG
44
value: "/kubeconfig.local/proxy.kubeconfig"
55
- name: VERBOSITY
6+
{{- if eq .Values.virtualization.logLevel "debug" }}
7+
value: "10"
8+
{{- else }}
69
value: "3"
10+
{{- end }}
711
- name: FORCE_BRIDGE_NETWORK_BINDING
812
value: "1"
913
- name: DISABLE_HYPERV_SYNIC

0 commit comments

Comments
 (0)