Skip to content

322 task create helm subchart for rspamd service#324

Draft
Aravinda-HWK wants to merge 9 commits intoLSFLK:mainfrom
Aravinda-HWK:322-task-create-helm-subchart-for-rspamd-service
Draft

322 task create helm subchart for rspamd service#324
Aravinda-HWK wants to merge 9 commits intoLSFLK:mainfrom
Aravinda-HWK:322-task-create-helm-subchart-for-rspamd-service

Conversation

@Aravinda-HWK
Copy link
Copy Markdown
Collaborator

📌 Description

This PR is to create the rspamd helm chart along with unbound and redis charts.


🔍 Changes Made

  • Added charts for the rspamd, redis, and unbound
  • Update the documentation

✅ Checklist (Email System)

  • Core services tested (SMTP, IMAP, mail storage, end-to-end delivery)
  • Security & compliance verified (auth via Thunder IDP, TLS, DKIM/SPF/DMARC, spam/virus filtering)
  • Configuration & deployment checked (configs generated, Docker/Compose updated)
  • Reliability confirmed (error handling, logging, monitoring)
  • Documentation & usage notes updated (README, deployment, API)

🧪 Testing Instructions


📷 Screenshots / Logs (if applicable)


⚠️ Notes for Reviewers

Aravinda-HWK and others added 9 commits April 3, 2026 10:44
- Introduced Redis chart with service, statefulset, and service account templates.
- Added Rspamd chart including service, statefulset, config maps, and network policies.
- Implemented liveness and readiness probes for both Redis and Rspamd.
- Configured persistence for Redis and Rspamd with volume claim templates.
- Created helper templates for both charts to manage naming and labels.
- Added README files for both charts with installation and configuration instructions.
- Established dependencies between Rspamd and Redis, Unbound, and ClamAV.
…lates (LSFLK#320)

* Create Helm subchart for OpenDKIM service with configuration and templates

* Add detailed local testing instructions for OpenDKIM chart

* Refactor OpenDKIM Helm chart: remove PVC template and adjust workload.yaml for persistence handling
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces three new Helm subcharts—Redis, Unbound, and Rspamd—to provide a comprehensive spam and malware filtering solution. The review identified several critical issues and improvement opportunities: the Rspamd configuration incorrectly attempts to use a hostname in a resolv.conf override, which requires an IP address; the Unbound chart runs with excessive root and privileged security contexts; and the Redis implementation lacks the clustering logic necessary to support more than one replica safely. Furthermore, feedback suggests quoting secret values to prevent parsing errors, implementing more robust timeout parsing in shell scripts, and avoiding the latest image tag to ensure deterministic deployments.

Comment on lines +39 to +40
resolv.conf: |
nameserver {{ .Values.dependencies.unbound.host }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The nameserver directive in /etc/resolv.conf requires an IP address. Using a hostname like {{ .Values.dependencies.unbound.host }} is invalid and will cause DNS resolution to fail. Additionally, overriding the pod's resolv.conf via subPath is generally discouraged as it breaks standard Kubernetes service discovery and does not receive updates if the ConfigMap changes.

Comment on lines +21 to +27
runAsUser: 0
runAsNonRoot: false

securityContext:
privileged: true
allowPrivilegeEscalation: true
runAsUser: 0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Running Unbound as root (runAsUser: 0) with privileged: true is a significant security risk. Containers should run as non-root whenever possible. If binding to port 53 is required, use the NET_BIND_SERVICE capability instead of full privileges, or run Unbound on a high port and map it via the Service.

@@ -0,0 +1,73 @@
replicaCount: 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Redis chart is implemented as a basic StatefulSet without clustering or sentinel logic. If replicaCount is set to a value greater than 1, it will result in multiple independent Redis instances, which will cause data inconsistency for Rspamd. This value should remain 1 unless a proper high-availability configuration is implemented.

{{- include "rspamd.labels" . | nindent 4 }}
type: Opaque
stringData:
password: {{ .Values.webui.password }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The password value should be quoted to ensure that special characters do not cause YAML parsing errors.

  password: {{ .Values.webui.password | quote }}

- -c
- |
echo "Checking Redis connectivity at {{ .Values.dependencies.redis.host }}:{{ .Values.dependencies.redis.port }}"
timeout_sec={{ .Values.dependencies.initCheckTimeout | replace "s" "" }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The replace "s" "" logic is fragile. If the initCheckTimeout value uses a different unit (like '1m') or has no unit, the shell script will fail with a syntax error during the numeric comparison. Consider enforcing a numeric value in seconds or using a more robust parsing method.


image:
repository: rspamd/rspamd
tag: "latest"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using the latest tag for container images is discouraged in production as it makes deployments non-deterministic. It is better to use a specific version tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Create Helm Subchart for Rspamd Service

1 participant