Skip to content

Commit

Permalink
[ATMOSPHERE-550] chart/ovn: make vector config as customizable (#2086)
Browse files Browse the repository at this point in the history
Co-authored-by: okozachenko1203 <[email protected]>
  • Loading branch information
okozachenko1203 and okozachenko1203 authored Nov 1, 2024
1 parent 81e4e36 commit f0e5466
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 79 deletions.
36 changes: 3 additions & 33 deletions charts/ovn/templates/secret-vector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,14 @@ limitations under the License.
*/}}

{{- if .Values.pod.sidecars.vector }}
{{- $envAll := . }}

---
apiVersion: v1
kind: Secret
metadata:
name: ovn-vector-config
type: Opaque
stringData:
vector.toml: |
[sources.file_logs]
type = "file"
include = [ "/logs/ovn-controller.log" ]
[sinks.ovn_log_parser_in]
type = "http"
inputs = ["file_logs"]
uri = "{{ tuple "ovn_logging_parser" "default" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }}"
encoding.codec = "json"
method = "post"
[sources.ovn_log_parser_out]
type = "http_server"
address = "0.0.0.0:5001"
encoding = "json"
[transforms.parse_log_message]
type = "remap"
inputs = ["ovn_log_parser_out"]
source = '''
del(.source_type)
del(.path)
'''
[sinks.loki_sink]
type = "loki"
labels.event_source = "network_logs"
inputs = ["parse_log_message"]
endpoint = "http://loki.monitoring:3100"
encoding.codec = "json"
tenant_id = "{{`{{ project_id }}`}}"
data:
{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.vector "key" "vector.toml" "format" "Secret" ) | indent 2 }}
{{- end }}
32 changes: 32 additions & 0 deletions charts/ovn/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,38 @@ conf:
thunder-lock: true
worker-reload-mercy: 80
wsgi-file: /var/lib/openstack/bin/neutron-ovn-network-logging-parser-wsgi
vector: |
[sources.file_logs]
type = "file"
include = [ "/logs/ovn-controller.log" ]
[sinks.ovn_log_parser_in]
type = "http"
inputs = ["file_logs"]
uri = "{{ tuple "ovn_logging_parser" "default" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }}"
encoding.codec = "json"
method = "post"
[sources.ovn_log_parser_out]
type = "http_server"
address = "0.0.0.0:5001"
encoding = "json"
[transforms.parse_log_message]
type = "remap"
inputs = ["ovn_log_parser_out"]
source = '''
del(.source_type)
del(.path)
'''
[sinks.loki_sink]
type = "loki"
labels.event_source = "network_logs"
inputs = ["parse_log_message"]
endpoint = "http://loki.monitoring:3100"
encoding.codec = "json"
tenant_id = "{{`{{ project_id }}`}}"
pod:
# NOTE: should be same as nova.pod.use_fqdn.compute
Expand Down
94 changes: 48 additions & 46 deletions charts/patches/ovn/0002-add-logging-parser.patch
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ index 47b84be8..0d221f19 100644
{{- end }}

diff --git a/ovn/templates/daemonset-controller.yaml b/ovn/templates/daemonset-controller.yaml
index e421794f..843cbeaa 100644
index 6c240213..82b70f78 100644
--- a/ovn/templates/daemonset-controller.yaml
+++ b/ovn/templates/daemonset-controller.yaml
@@ -156,6 +156,52 @@ spec:
mountPath: /var/log/ovn
- name: run-ovn
- name: run-openvswitch
mountPath: /run/ovn
+ {{- if .Values.pod.sidecars.vector }}
+ - name: vector
Expand Down Expand Up @@ -126,7 +126,7 @@ index e421794f..843cbeaa 100644
volumes:
- name: ovn-bin
configMap:
@@ -225,4 +225,17 @@
@@ -179,4 +225,17 @@ spec:
type: DirectoryOrCreate
- name: gw-enabled
emptyDir: {}
Expand All @@ -146,10 +146,10 @@ index e421794f..843cbeaa 100644
{{- end }}
diff --git a/ovn/templates/secret-vector.yaml b/ovn/templates/secret-vector.yaml
new file mode 100644
index 00000000..028e8a9a
index 00000000..989f3afa
--- /dev/null
+++ b/ovn/templates/secret-vector.yaml
@@ -0,0 +1,56 @@
@@ -0,0 +1,26 @@
+{{/*
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
Expand All @@ -165,15 +165,52 @@ index 00000000..028e8a9a
+*/}}
+
+{{- if .Values.pod.sidecars.vector }}
+{{- $envAll := . }}
+
+---
+apiVersion: v1
+kind: Secret
+metadata:
+ name: ovn-vector-config
+type: Opaque
+stringData:
+ vector.toml: |
+data:
+{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.vector "key" "vector.toml" "format" "Secret" ) | indent 2 }}
+{{- end }}
diff --git a/ovn/values.yaml b/ovn/values.yaml
index 8459e33a..3ffdecec 100644
--- a/ovn/values.yaml
+++ b/ovn/values.yaml
@@ -27,6 +27,8 @@ images:
ovn_controller_kubectl: docker.io/openstackhelm/ceph-config-helper:latest-ubuntu_jammy
dep_check: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal
image_repo_sync: docker.io/library/docker:17.07.0
+ vector: docker.io/timberio/vector:0.39.0-debian
+ ovn_logging_parser: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy
pull_policy: "IfNotPresent"
local_registry:
active: false
@@ -83,6 +85,56 @@ conf:
# br-public: eth1
auto_bridge_add: {}

+ ovn_network_logging_parser_uwsgi:
+ uwsgi:
+ add-header: "Connection: close"
+ buffer-size: 65535
+ die-on-term: true
+ enable-threads: true
+ exit-on-reload: false
+ hook-master-start: unix_signal:15 gracefully_kill_them_all
+ lazy-apps: true
+ log-x-forwarded-for: true
+ master: true
+ processes: 1
+ procname-prefix-spaced: "neutron-ovn-network-logging-parser:"
+ route-user-agent: '^kube-probe.* donotlog:'
+ thunder-lock: true
+ worker-reload-mercy: 80
+ wsgi-file: /var/lib/openstack/bin/neutron-ovn-network-logging-parser-wsgi
+ vector: |
+ [sources.file_logs]
+ type = "file"
+ include = [ "/logs/ovn-controller.log" ]
Expand Down Expand Up @@ -205,45 +242,11 @@ index 00000000..028e8a9a
+ endpoint = "http://loki.monitoring:3100"
+ encoding.codec = "json"
+ tenant_id = "{{`{{ project_id }}`}}"
+{{- end }}
diff --git a/ovn/values.yaml b/ovn/values.yaml
index b07a0f5a..79fde2c2 100644
--- a/ovn//values.yaml
+++ b/ovn//values.yaml
@@ -26,5 +26,7 @@ images:
dep_check: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal
image_repo_sync: docker.io/library/docker:17.07.0
+ vector: docker.io/timberio/vector:0.39.0-debian
+ ovn_logging_parser: docker.io/openstackhelm/neutron:2024.1-ubuntu_jammy
pull_policy: "IfNotPresent"
local_registry:
active: false
@@ -82,6 +84,24 @@ conf:
# br-public: eth1
auto_bridge_add: {}

+ ovn_network_logging_parser_uwsgi:
+ uwsgi:
+ add-header: "Connection: close"
+ buffer-size: 65535
+ die-on-term: true
+ enable-threads: true
+ exit-on-reload: false
+ hook-master-start: unix_signal:15 gracefully_kill_them_all
+ lazy-apps: true
+ log-x-forwarded-for: true
+ master: true
+ processes: 1
+ procname-prefix-spaced: "neutron-ovn-network-logging-parser:"
+ route-user-agent: '^kube-probe.* donotlog:'
+ thunder-lock: true
+ worker-reload-mercy: 80
+ wsgi-file: /var/lib/openstack/bin/neutron-ovn-network-logging-parser-wsgi
+
pod:
# NOTE: should be same as nova.pod.use_fqdn.compute
use_fqdn:
@@ -109,6 +129,12 @@ pod:
@@ -102,6 +154,12 @@ pod:
controller:
readOnlyRootFilesystem: true
privileged: true
Expand All @@ -256,7 +259,7 @@ index b07a0f5a..79fde2c2 100644
tolerations:
ovn_ovsdb_nb:
enabled: false
@@ -237,6 +263,20 @@ pod:
@@ -217,6 +275,20 @@ pod:
limits:
memory: "1024Mi"
cpu: "2000m"
Expand All @@ -277,8 +280,7 @@ index b07a0f5a..79fde2c2 100644
jobs:
image_repo_sync:
requests:
@@ -245,7 +286,11 @@ pod:
limits:
@@ -226,6 +298,10 @@ pod:
memory: "1024Mi"
cpu: "2000m"

Expand All @@ -289,7 +291,7 @@ index b07a0f5a..79fde2c2 100644
secrets:
oci_image_registry:
ovn: ovn-oci-image-registry-key
@@ -304,6 +349,22 @@ endpoints:
@@ -284,6 +360,22 @@ endpoints:
default: 6642
raft:
default: 6644
Expand Down

0 comments on commit f0e5466

Please sign in to comment.