Skip to content

Commit

Permalink
feat(observability): add logLevel option to module config (#194)
Browse files Browse the repository at this point in the history
Sets a logLevel for this components:
- virtualization-api
- virtualization-controller
- kube-api-proxy
- vmi-router

Signed-off-by: Roman Sysoev <[email protected]>
  • Loading branch information
hardcoretime authored Jul 6, 2024
1 parent ecffccb commit d2e8cfc
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 2 deletions.
15 changes: 15 additions & 0 deletions openapi/config-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,18 @@ properties:
properties:
type:
enum: ["ObjectStorage"]
logLevel:
type: string
description: |
Sets a logging level.
Working for this components:
- `virtualization-api`
- `virtualization-controller`
- `kube-api-proxy`
- `vmi-router`
enum:
- "debug"
- "info"
- "warning"
- "error"
10 changes: 10 additions & 0 deletions openapi/doc-ru-config-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,13 @@ properties:
bucket:
description: |
Контейнер, в котором вы можете хранить свои файлы и объекты данных.
logLevel:
type: string
description: |
Устанавливает уровень логирования.
Работает для следующих компонентов:
- `virtualization-api`
- `virtualization-controller`
- `kube-api-proxy`
- `vmi-router`
4 changes: 2 additions & 2 deletions templates/_kube_api_rewriter.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- define "kube_api_rewriter.env" -}}
- name: LOG_LEVEL
value: Debug
value: {{ .Values.virtualization.logLevel }}
{{- end -}}

{{- define "kubeproxy_resources" -}}
Expand Down Expand Up @@ -31,7 +31,7 @@ spec:
image: {{ $proxyImage }}
imagePullPolicy: IfNotPresent
env:
{{- include "kube_api_rewriter.env" . | nindent 8 }}
{{- include "kube_api_rewriter.env" $ctx | nindent 8 }}
resources:
requests:
{{- include "helm_lib_module_ephemeral_storage_only_logs" . | nindent 12 }}
Expand Down
4 changes: 4 additions & 0 deletions templates/kubevirt/vmi-router/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
{{- if eq .Values.virtualization.logLevel "debug" }}
- name: VERBOSITY
value: "10"
{{- end }}
resources:
requests:
{{- include "helm_lib_module_ephemeral_storage_only_logs" . | nindent 14 }}
Expand Down
4 changes: 4 additions & 0 deletions templates/virtualization-api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ spec:
- --kubevirt-cabundle=/etc/virt-api/certificates/ca.crt
- --kubevirt-endpoint=virt-api.d8-{{ .Chart.Name}}.svc
- --secure-port=8443
{{- if eq .Values.virtualization.logLevel "debug" }}
- --v=10
{{- else }}
- --v=3
{{- end }}
- --tls-cert-file=/etc/virtualziation-api/certificates/tls.crt
- --tls-private-key-file=/etc/virtualziation-api/certificates/tls.key
- --proxy-client-cert-file=/etc/virtualziation-api-proxy/certificates/tls.crt
Expand Down
4 changes: 4 additions & 0 deletions templates/virtualization-controller/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
- name: KUBECONFIG
value: "/kubeconfig.local/proxy.kubeconfig"
- name: VERBOSITY
{{- if eq .Values.virtualization.logLevel "debug" }}
value: "10"
{{- else }}
value: "3"
{{- end }}
- name: FORCE_BRIDGE_NETWORK_BINDING
value: "1"
- name: DISABLE_HYPERV_SYNIC
Expand Down

0 comments on commit d2e8cfc

Please sign in to comment.