From 0e5c580e75a214b09a044e653e9060d0d3748403 Mon Sep 17 00:00:00 2001 From: Fabio Kaiser Rauber Date: Wed, 4 Feb 2026 16:39:04 -0300 Subject: [PATCH] Release postfix chart version 0.2.0 --- charts/postfix/v0.2.0/Chart.yaml | 16 +++ charts/postfix/v0.2.0/templates/NOTES.txt | 3 + charts/postfix/v0.2.0/templates/_helpers.tpl | 72 +++++++++++ charts/postfix/v0.2.0/templates/app.yaml | 117 ++++++++++++++++++ .../postfix/v0.2.0/templates/configmap.yaml | 11 ++ charts/postfix/v0.2.0/templates/hpa.yaml | 29 +++++ charts/postfix/v0.2.0/templates/pvc.yaml | 17 +++ charts/postfix/v0.2.0/templates/service.yaml | 18 +++ charts/postfix/v0.2.0/values.yaml | 72 +++++++++++ 9 files changed, 355 insertions(+) create mode 100644 charts/postfix/v0.2.0/Chart.yaml create mode 100644 charts/postfix/v0.2.0/templates/NOTES.txt create mode 100644 charts/postfix/v0.2.0/templates/_helpers.tpl create mode 100644 charts/postfix/v0.2.0/templates/app.yaml create mode 100644 charts/postfix/v0.2.0/templates/configmap.yaml create mode 100644 charts/postfix/v0.2.0/templates/hpa.yaml create mode 100644 charts/postfix/v0.2.0/templates/pvc.yaml create mode 100644 charts/postfix/v0.2.0/templates/service.yaml create mode 100644 charts/postfix/v0.2.0/values.yaml diff --git a/charts/postfix/v0.2.0/Chart.yaml b/charts/postfix/v0.2.0/Chart.yaml new file mode 100644 index 0000000..34c27ab --- /dev/null +++ b/charts/postfix/v0.2.0/Chart.yaml @@ -0,0 +1,16 @@ +apiVersion: v2 +name: postfix +description: Postfix containers based on Alpine Linux + +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.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.10.7" diff --git a/charts/postfix/v0.2.0/templates/NOTES.txt b/charts/postfix/v0.2.0/templates/NOTES.txt new file mode 100644 index 0000000..584df52 --- /dev/null +++ b/charts/postfix/v0.2.0/templates/NOTES.txt @@ -0,0 +1,3 @@ +Your postfix service is installed! + + diff --git a/charts/postfix/v0.2.0/templates/_helpers.tpl b/charts/postfix/v0.2.0/templates/_helpers.tpl new file mode 100644 index 0000000..3f7aa3d --- /dev/null +++ b/charts/postfix/v0.2.0/templates/_helpers.tpl @@ -0,0 +1,72 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "postfix.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 "postfix.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 "postfix.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "postfix.labels" -}} +helm.sh/chart: {{ include "postfix.chart" . }} +{{ include "postfix.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "postfix.selectorLabels" -}} +app.kubernetes.io/name: {{ include "postfix.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "postfix.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "postfix.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + +{{/* +Return true if a configmap object should be created for Postfix +*/}} +{{- define "postfix.createConfigmap" -}} +{{- if .Values.postfix.configuration }} + {{- true -}} +{{- else -}} +{{- end -}} +{{- end -}} diff --git a/charts/postfix/v0.2.0/templates/app.yaml b/charts/postfix/v0.2.0/templates/app.yaml new file mode 100644 index 0000000..2d268db --- /dev/null +++ b/charts/postfix/v0.2.0/templates/app.yaml @@ -0,0 +1,117 @@ +apiVersion: apps/v1 +kind: {{ .Values.postfix.kind }} +metadata: + name: {{ include "postfix.fullname" . }} + labels: + {{- include "postfix.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + {{- if (eq .Values.postfix.kind "StatefulSet") }} + serviceName: {{ include "postfix.fullname" . }} + {{- end }} + selector: + matchLabels: + {{- include "postfix.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "postfix.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: DOMAIN + value: {{ .Values.postfix.domain | quote }} + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: MESSAGE_SIZE_LIMIT + value: {{ .Values.postfix.messageSizeLimit | quote }} + - name: RELAYHOST + value: {{ .Values.postfix.relayHost | quote }} + - name: RELAYNETS + value: {{ .Values.postfix.relayNets | quote }} + - name: SENDER_BCC + value: {{ .Values.postfix.senderBcc | quote }} + ports: + - name: smtp + containerPort: 25 + protocol: TCP + {{- if .Values.postfix.hostPort }} + hostPort: {{ .Values.postfix.hostPort }} + {{- end }} + livenessProbe: + tcpSocket: + port: 25 + initialDelaySeconds: 10 + periodSeconds: 15 + readinessProbe: + tcpSocket: + port: 25 + initialDelaySeconds: 10 + periodSeconds: 15 + volumeMounts: + {{- if .Values.persistence.enabled }} + - name: spool + mountPath: /var/spool/postfix + {{- end }} + {{- if .Values.postfix.configuration }} + - name: config + mountPath: /overrides/postfix.cf + subPath: postfix.cf + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "postfix.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + topologyKey: "kubernetes.io/hostname" + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + volumes: + {{- if .Values.persistence.enabled }} + - name: spool + persistentVolumeClaim: + claimName: {{ include "postfix.fullname" . }} + {{- end }} + {{- if .Values.postfix.configuration }} + - name: config + configMap: + name: {{ include "postfix.fullname" . }} + {{- end }} + diff --git a/charts/postfix/v0.2.0/templates/configmap.yaml b/charts/postfix/v0.2.0/templates/configmap.yaml new file mode 100644 index 0000000..002e845 --- /dev/null +++ b/charts/postfix/v0.2.0/templates/configmap.yaml @@ -0,0 +1,11 @@ +{{- if (include "postfix.createConfigmap" .) }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "postfix.fullname" . }} + namespace: {{ .Release.Namespace | quote }} + labels: {{- include "postfix.labels" . | nindent 4 }} +data: + postfix.cf: |- +{{ .Values.postfix.configuration | indent 4 }} +{{- end -}} diff --git a/charts/postfix/v0.2.0/templates/hpa.yaml b/charts/postfix/v0.2.0/templates/hpa.yaml new file mode 100644 index 0000000..1117550 --- /dev/null +++ b/charts/postfix/v0.2.0/templates/hpa.yaml @@ -0,0 +1,29 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "postfix.fullname" . }} + labels: + {{- include "postfix.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "postfix.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 }} + diff --git a/charts/postfix/v0.2.0/templates/pvc.yaml b/charts/postfix/v0.2.0/templates/pvc.yaml new file mode 100644 index 0000000..517140c --- /dev/null +++ b/charts/postfix/v0.2.0/templates/pvc.yaml @@ -0,0 +1,17 @@ +{{- if and .Values.persistence.enabled (eq .Values.postfix.kind "StatefulSet") }} +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "postfix.fullname" . }} + labels: + {{- include "postfix.labels" . | nindent 4 }} +spec: + accessModes: + - {{ .Values.persistence.accessMode }} + resources: + requests: + storage: {{ .Values.persistence.size }} + {{- if .Values.persistence.storageClassName }} + storageClassName: {{ .Values.persistence.storageClassName }} + {{- end }} +{{- end }} diff --git a/charts/postfix/v0.2.0/templates/service.yaml b/charts/postfix/v0.2.0/templates/service.yaml new file mode 100644 index 0000000..e0e4cc5 --- /dev/null +++ b/charts/postfix/v0.2.0/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "postfix.fullname" . }} + labels: + {{- include "postfix.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.service.annotations | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: 25 + protocol: TCP + name: smtp + selector: + {{- include "postfix.selectorLabels" . | nindent 4 }} + loadBalancerIP: {{ .Values.service.loadBalancerIP }} diff --git a/charts/postfix/v0.2.0/values.yaml b/charts/postfix/v0.2.0/values.yaml new file mode 100644 index 0000000..6db1c6e --- /dev/null +++ b/charts/postfix/v0.2.0/values.yaml @@ -0,0 +1,72 @@ +# Default values for postfix. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 2 + +image: + repository: interlegis/alpine-postfix + 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 + +service: + type: ClusterIP + port: 25 + annotations: {} + loadBalancerIP: "" + +resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +persistence: + enabled: false + size: 5Gi + accessMode: ReadWriteOnce + # storageClassName: "" # Uncomment to specify a storage class + +postfix: + domain: interlegis.leg.br + messageSizeLimit: "50000000" + relayHost: "" + relayNets: 10.42.0.0/16 + senderBcc: "" + kind: StatefulSet + configuration: "" + hostPort: 25 + +autoscaling: + enabled: false + minReplicas: 2 + maxReplicas: 6 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} +