Fábio Kaiser Rauber
2 years ago
9 changed files with 342 additions and 0 deletions
@ -0,0 +1,23 @@ |
|||||
|
# Patterns to ignore when building packages. |
||||
|
# This supports shell glob matching, relative path matching, and |
||||
|
# negation (prefixed with !). Only one pattern per line. |
||||
|
.DS_Store |
||||
|
# Common VCS dirs |
||||
|
.git/ |
||||
|
.gitignore |
||||
|
.bzr/ |
||||
|
.bzrignore |
||||
|
.hg/ |
||||
|
.hgignore |
||||
|
.svn/ |
||||
|
# Common backup files |
||||
|
*.swp |
||||
|
*.bak |
||||
|
*.tmp |
||||
|
*.orig |
||||
|
*~ |
||||
|
# Various IDEs |
||||
|
.project |
||||
|
.idea/ |
||||
|
*.tmproj |
||||
|
.vscode/ |
@ -0,0 +1,16 @@ |
|||||
|
apiVersion: v2 |
||||
|
name: rspamd |
||||
|
description: Fast, free and open-source spam filtering system. |
||||
|
|
||||
|
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.1.0 |
||||
|
|
||||
|
# 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 |
||||
|
# follow Semantic Versioning. They should reflect the version the application is using. |
||||
|
# It is recommended to use it with quotes. |
||||
|
appVersion: "3.2.0" |
@ -0,0 +1 @@ |
|||||
|
Your RSpamd instance is installed! |
@ -0,0 +1,51 @@ |
|||||
|
{{/* |
||||
|
Expand the name of the chart. |
||||
|
*/}} |
||||
|
{{- define "rspamd.name" -}} |
||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} |
||||
|
{{- end }} |
||||
|
|
||||
|
{{/* |
||||
|
Create a default fully qualified app name. |
||||
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). |
||||
|
If release name contains chart name it will be used as a full name. |
||||
|
*/}} |
||||
|
{{- define "rspamd.fullname" -}} |
||||
|
{{- if .Values.fullnameOverride }} |
||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} |
||||
|
{{- else }} |
||||
|
{{- $name := default .Chart.Name .Values.nameOverride }} |
||||
|
{{- if contains $name .Release.Name }} |
||||
|
{{- .Release.Name | trunc 63 | trimSuffix "-" }} |
||||
|
{{- else }} |
||||
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
|
|
||||
|
{{/* |
||||
|
Create chart name and version as used by the chart label. |
||||
|
*/}} |
||||
|
{{- define "rspamd.chart" -}} |
||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} |
||||
|
{{- end }} |
||||
|
|
||||
|
{{/* |
||||
|
Common labels |
||||
|
*/}} |
||||
|
{{- define "rspamd.labels" -}} |
||||
|
helm.sh/chart: {{ include "rspamd.chart" . }} |
||||
|
{{ include "rspamd.selectorLabels" . }} |
||||
|
{{- if .Chart.AppVersion }} |
||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} |
||||
|
{{- end }} |
||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }} |
||||
|
{{- end }} |
||||
|
|
||||
|
{{/* |
||||
|
Selector labels |
||||
|
*/}} |
||||
|
{{- define "rspamd.selectorLabels" -}} |
||||
|
app.kubernetes.io/name: {{ include "rspamd.name" . }} |
||||
|
app.kubernetes.io/instance: {{ .Release.Name }} |
||||
|
{{- end }} |
@ -0,0 +1,72 @@ |
|||||
|
apiVersion: apps/v1 |
||||
|
kind: Deployment |
||||
|
metadata: |
||||
|
name: {{ include "rspamd.fullname" . }} |
||||
|
labels: |
||||
|
{{- include "rspamd.labels" . | nindent 4 }} |
||||
|
spec: |
||||
|
{{- if not .Values.autoscaling.enabled }} |
||||
|
replicas: {{ .Values.replicaCount }} |
||||
|
{{- end }} |
||||
|
selector: |
||||
|
matchLabels: |
||||
|
{{- include "rspamd.selectorLabels" . | nindent 6 }} |
||||
|
template: |
||||
|
metadata: |
||||
|
{{- with .Values.podAnnotations }} |
||||
|
annotations: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
labels: |
||||
|
{{- include "rspamd.selectorLabels" . | nindent 8 }} |
||||
|
spec: |
||||
|
{{- with .Values.imagePullSecrets }} |
||||
|
imagePullSecrets: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
securityContext: |
||||
|
{{- toYaml .Values.podSecurityContext | nindent 8 }} |
||||
|
containers: |
||||
|
- name: {{ .Chart.Name }} |
||||
|
securityContext: |
||||
|
{{- toYaml .Values.securityContext | nindent 12 }} |
||||
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }} |
||||
|
env: |
||||
|
- name: PASSWORD |
||||
|
value: {{ .Values.rspamd.password | quote }} |
||||
|
ports: |
||||
|
- name: http |
||||
|
containerPort: {{ .Values.service.ports.http }} |
||||
|
protocol: TCP |
||||
|
- name: antispam |
||||
|
containerPort: {{ .Values.service.ports.antispam }} |
||||
|
protocol: TCP |
||||
|
livenessProbe: |
||||
|
httpGet: |
||||
|
path: / |
||||
|
port: http |
||||
|
periodSeconds: 10 |
||||
|
failureThreshold: 3 |
||||
|
timeoutSeconds: 5 |
||||
|
readinessProbe: |
||||
|
httpGet: |
||||
|
path: / |
||||
|
port: http |
||||
|
periodSeconds: 10 |
||||
|
failureThreshold: 3 |
||||
|
timeoutSeconds: 5 |
||||
|
resources: |
||||
|
{{- toYaml .Values.resources | nindent 12 }} |
||||
|
{{- with .Values.nodeSelector }} |
||||
|
nodeSelector: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.affinity }} |
||||
|
affinity: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
||||
|
{{- with .Values.tolerations }} |
||||
|
tolerations: |
||||
|
{{- toYaml . | nindent 8 }} |
||||
|
{{- end }} |
@ -0,0 +1,28 @@ |
|||||
|
{{- if .Values.autoscaling.enabled }} |
||||
|
apiVersion: autoscaling/v2beta1 |
||||
|
kind: HorizontalPodAutoscaler |
||||
|
metadata: |
||||
|
name: {{ include "rspamd.fullname" . }} |
||||
|
labels: |
||||
|
{{- include "rspamd.labels" . | nindent 4 }} |
||||
|
spec: |
||||
|
scaleTargetRef: |
||||
|
apiVersion: apps/v1 |
||||
|
kind: Deployment |
||||
|
name: {{ include "rspamd.fullname" . }} |
||||
|
minReplicas: {{ .Values.autoscaling.minReplicas }} |
||||
|
maxReplicas: {{ .Values.autoscaling.maxReplicas }} |
||||
|
metrics: |
||||
|
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }} |
||||
|
- type: Resource |
||||
|
resource: |
||||
|
name: cpu |
||||
|
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} |
||||
|
{{- end }} |
||||
|
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} |
||||
|
- type: Resource |
||||
|
resource: |
||||
|
name: memory |
||||
|
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
@ -0,0 +1,61 @@ |
|||||
|
{{- if .Values.ingress.enabled -}} |
||||
|
{{- $fullName := include "rspamd.fullname" . -}} |
||||
|
{{- $svcPort := .Values.service.port -}} |
||||
|
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} |
||||
|
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} |
||||
|
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} |
||||
|
apiVersion: networking.k8s.io/v1 |
||||
|
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} |
||||
|
apiVersion: networking.k8s.io/v1beta1 |
||||
|
{{- else -}} |
||||
|
apiVersion: extensions/v1beta1 |
||||
|
{{- end }} |
||||
|
kind: Ingress |
||||
|
metadata: |
||||
|
name: {{ $fullName }} |
||||
|
labels: |
||||
|
{{- include "rspamd.labels" . | nindent 4 }} |
||||
|
{{- with .Values.ingress.annotations }} |
||||
|
annotations: |
||||
|
{{- toYaml . | nindent 4 }} |
||||
|
{{- end }} |
||||
|
spec: |
||||
|
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} |
||||
|
ingressClassName: {{ .Values.ingress.className }} |
||||
|
{{- end }} |
||||
|
{{- if .Values.ingress.tls }} |
||||
|
tls: |
||||
|
{{- range .Values.ingress.tls }} |
||||
|
- hosts: |
||||
|
{{- range .hosts }} |
||||
|
- {{ . | quote }} |
||||
|
{{- end }} |
||||
|
secretName: {{ .secretName }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
|
rules: |
||||
|
{{- range .Values.ingress.hosts }} |
||||
|
- host: {{ .host | quote }} |
||||
|
http: |
||||
|
paths: |
||||
|
{{- range .paths }} |
||||
|
- path: {{ .path }} |
||||
|
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} |
||||
|
pathType: {{ .pathType }} |
||||
|
{{- end }} |
||||
|
backend: |
||||
|
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} |
||||
|
service: |
||||
|
name: {{ $fullName }} |
||||
|
port: |
||||
|
number: {{ $svcPort }} |
||||
|
{{- else }} |
||||
|
serviceName: {{ $fullName }} |
||||
|
servicePort: {{ $svcPort }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
||||
|
{{- end }} |
@ -0,0 +1,19 @@ |
|||||
|
apiVersion: v1 |
||||
|
kind: Service |
||||
|
metadata: |
||||
|
name: {{ include "rspamd.fullname" . }} |
||||
|
labels: |
||||
|
{{- include "rspamd.labels" . | nindent 4 }} |
||||
|
spec: |
||||
|
type: {{ .Values.service.type }} |
||||
|
ports: |
||||
|
- port: {{ .Values.service.ports.antispam }} |
||||
|
targetPort: {{ .Values.service.ports.antispam }} |
||||
|
protocol: TCP |
||||
|
name: antispam |
||||
|
- port: {{ .Values.service.ports.http }} |
||||
|
targetPort: {{ .Values.service.ports.http }} |
||||
|
protocol: TCP |
||||
|
name: http |
||||
|
selector: |
||||
|
{{- include "rspamd.selectorLabels" . | nindent 4 }} |
@ -0,0 +1,71 @@ |
|||||
|
# Default values for rspamd. |
||||
|
replicaCount: 1 |
||||
|
|
||||
|
image: |
||||
|
repository: interlegis/alpine-rspamd |
||||
|
pullPolicy: IfNotPresent |
||||
|
# Overrides the image tag whose default is the chart appVersion. |
||||
|
tag: "" |
||||
|
|
||||
|
imagePullSecrets: [] |
||||
|
nameOverride: "" |
||||
|
fullnameOverride: "" |
||||
|
|
||||
|
podAnnotations: {} |
||||
|
|
||||
|
podSecurityContext: {} |
||||
|
# fsGroup: 2000 |
||||
|
|
||||
|
securityContext: {} |
||||
|
# capabilities: |
||||
|
# drop: |
||||
|
# - ALL |
||||
|
# readOnlyRootFilesystem: true |
||||
|
# runAsNonRoot: true |
||||
|
# runAsUser: 1000 |
||||
|
|
||||
|
rspamd: |
||||
|
password: apassword |
||||
|
|
||||
|
service: |
||||
|
type: ClusterIP |
||||
|
ports: |
||||
|
antispam: 11333 |
||||
|
http: 11334 |
||||
|
|
||||
|
ingress: |
||||
|
enabled: false |
||||
|
className: "" |
||||
|
annotations: {} |
||||
|
# kubernetes.io/ingress.class: nginx |
||||
|
# kubernetes.io/tls-acme: "true" |
||||
|
hosts: |
||||
|
- host: chart-example.local |
||||
|
paths: |
||||
|
- path: / |
||||
|
pathType: ImplementationSpecific |
||||
|
tls: [] |
||||
|
# - secretName: chart-example-tls |
||||
|
# hosts: |
||||
|
# - chart-example.local |
||||
|
|
||||
|
resources: {} |
||||
|
# limits: |
||||
|
# cpu: 100m |
||||
|
# memory: 128Mi |
||||
|
# requests: |
||||
|
# cpu: 100m |
||||
|
# memory: 128Mi |
||||
|
|
||||
|
autoscaling: |
||||
|
enabled: false |
||||
|
minReplicas: 2 |
||||
|
maxReplicas: 6 |
||||
|
targetCPUUtilizationPercentage: 80 |
||||
|
# targetMemoryUtilizationPercentage: 80 |
||||
|
|
||||
|
nodeSelector: {} |
||||
|
|
||||
|
tolerations: [] |
||||
|
|
||||
|
affinity: {} |
Loading…
Reference in new issue