Skip to content

Commit

Permalink
feat: cleanup volume
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-segning committed Nov 22, 2024
1 parent f7c56a2 commit 66abea0
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Wazuh Helm chart

[![Helm Publish](https://github.com/ADORSYS-GIS/wazuh-helm/actions/workflows/helm-publish.yml/badge.svg)](https://github.com/ADORSYS-GIS/wazuh-helm/actions/workflows/helm-publish.yml)
[![Helm Publish](https://github.com/ADORSYS-GIS/wazuh-helm/actions/workflows/helm-publish.yml/badge.svg)](https://github.com/ADORSYS-GIS/wazuh-helm/actions/workflows/helm-publish.yml) [![Build Docker image](https://github.com/ADORSYS-GIS/wazuh-helm/actions/workflows/build-envsubst.yml/badge.svg)](https://github.com/ADORSYS-GIS/wazuh-helm/actions/workflows/build-envsubst.yml)

To use this chart, you need to have first a root CA.
To create one you can use the following commands:
Expand Down
2 changes: 1 addition & 1 deletion charts/wazuh/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.14
version: 0.2.15

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
7 changes: 4 additions & 3 deletions charts/wazuh/templates/manager/sts.wazuh-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ spec:
{{ include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8}}
{{- end }}
initContainers:
{{ range $k, $v := .initContainers }}
- name: {{ include "common.tplvalues.render" (dict "value" $k "context" $) }}
{{ include "common.tplvalues.render" (dict "value" $v "context" $) | nindent 10}}
{{- end }}
- name: wazuh-init
##
##
Expand Down Expand Up @@ -102,9 +106,6 @@ spec:
readOnly: true
- name: wazuh-config-temp
mountPath: /processed
{{ with .initContainers -}}
{{ include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8}}
{{- end }}
securityContext:
fsGroup: 1000
containers:
Expand Down
5 changes: 3 additions & 2 deletions charts/wazuh/templates/manager/sts.wazuh-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ spec:
readOnly: true
- name: wazuh-config-temp
mountPath: /processed
{{ with .initContainers -}}
{{ include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8}}
{{ range $k, $v := .initContainers }}
- name: {{ include "common.tplvalues.render" (dict "value" $k "context" $) }}
{{ include "common.tplvalues.render" (dict "value" $v "context" $) | nindent 10}}
{{- end }}
securityContext:
fsGroup: 1000
Expand Down
45 changes: 45 additions & 0 deletions charts/wazuh/values-cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
worker:
initContainers:
# Cleanup residue files in PV
cleanup-pv:
image: busybox
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 100m
memory: 256Mi
command:
- /bin/sh
- -c
- |
set -ex
# Clear any existing files in the persistent volume
rm -rf /var/ossec/*
volumeMounts:
- mountPath: /var/ossec
name: '{{ include "common.names.fullname" $ }}-manager-worker'

master:
initContainers:
# Cleanup residue files in PV
cleanup-pv:
image: busybox
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
cpu: 100m
memory: 256Mi
command:
- /bin/sh
- -c
- |
set -ex
# Clear any existing files in the persistent volume
rm -rf /var/ossec/*
volumeMounts:
- mountPath: /var/ossec
name: '{{ include "common.names.fullname" $ }}-manager-master'
4 changes: 2 additions & 2 deletions charts/wazuh/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ worker:

##
##
initContainers: [ ]
initContainers: { }
##
##
env: [ ]
Expand Down Expand Up @@ -450,7 +450,7 @@ master:
type: RollingUpdate
##
initContainers:
- name: permission-fix
permission-fix:
image: busybox
resources:
requests:
Expand Down

0 comments on commit 66abea0

Please sign in to comment.