diff --git a/charts/memgraph-high-availability/templates/_helpers.tpl b/charts/memgraph-high-availability/templates/_helpers.tpl index 2144eaf..c73b62d 100644 --- a/charts/memgraph-high-availability/templates/_helpers.tpl +++ b/charts/memgraph-high-availability/templates/_helpers.tpl @@ -108,6 +108,7 @@ livenessProbe: - "--also-log-to-stderr" {{- end }} - "--log-file={{ $logging.log_file }}" +- "--log-retention-days={{ $logging.log_retention_days }}" {{- end }} diff --git a/charts/memgraph-high-availability/templates/coordinators.yaml b/charts/memgraph-high-availability/templates/coordinators.yaml index ac4fdaf..42929f4 100644 --- a/charts/memgraph-high-availability/templates/coordinators.yaml +++ b/charts/memgraph-high-availability/templates/coordinators.yaml @@ -216,6 +216,9 @@ spec: {{- if hasPrefix "--bolt-key-file" $arg }} {{- fail (printf "Do not set --bolt-key-file in coordinators[id=%s].args; enable coordinators[id=%s].tls.bolt instead (auto-appended)." $coordinator.id $coordinator.id) }} {{- end }} + {{- if hasPrefix "--log-retention-days" $arg }} + {{- fail (printf "Do not set --log-retention-days in coordinators[id=%s].args; configure commonArgs.coordinators.logging.log_retention_days instead." $coordinator.id) }} + {{- end }} {{- end }} {{- if and $coordinator.tls.bolt.enabled (not $coordinator.tls.bolt.secretName) }} {{- fail (printf "coordinators[id=%s].tls.bolt.enabled is true but secretName is empty." $coordinator.id) }} diff --git a/charts/memgraph-high-availability/templates/data.yaml b/charts/memgraph-high-availability/templates/data.yaml index 9e71615..8fafc64 100644 --- a/charts/memgraph-high-availability/templates/data.yaml +++ b/charts/memgraph-high-availability/templates/data.yaml @@ -216,6 +216,9 @@ spec: {{- if hasPrefix "--bolt-key-file" $arg }} {{- fail (printf "Do not set --bolt-key-file in data[id=%s].args; enable data[id=%s].tls.bolt instead (auto-appended)." $data.id $data.id) }} {{- end }} + {{- if hasPrefix "--log-retention-days" $arg }} + {{- fail (printf "Do not set --log-retention-days in data[id=%s].args; configure commonArgs.data.logging.log_retention_days instead." $data.id) }} + {{- end }} {{- end }} {{- if and $data.tls.bolt.enabled (not $data.tls.bolt.secretName) }} {{- fail (printf "data[id=%s].tls.bolt.enabled is true but secretName is empty." $data.id) }} diff --git a/charts/memgraph-high-availability/values.yaml b/charts/memgraph-high-availability/values.yaml index dc03b94..a1c95e1 100644 --- a/charts/memgraph-high-availability/values.yaml +++ b/charts/memgraph-high-availability/values.yaml @@ -361,11 +361,13 @@ commonArgs: log_level: "TRACE" # Must not be empty. also_log_to_stderr: true # Can only be bool log_file: "/var/log/memgraph/memgraph.log" # If empty, log file won't be created + log_retention_days: 35 # For how many days should logs get persisted coordinators: # Common args for coordinator instances logging: log_level: "TRACE" # Must not be empty. also_log_to_stderr: true # Can only be bool log_file: "/var/log/memgraph/memgraph.log" # If empty, log file won't be created + log_retention_days: 35 # If setting the --memory-limit flag under data instances, check that the amount of resources that a pod has been given is more than the actual memory limit you give to Memgraph # Setting the Memgraph's memory limit to more than the available resources can trigger pod eviction and restarts before Memgraph can make a query exception and continue running