Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(observability): add logLevel option to module config #194

Merged
merged 2 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading