mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-06 06:25:40 +08:00
Rename chart and fix minor issues
This commit is contained in:
parent
cf22956bf7
commit
6bae2c20ba
12 changed files with 45 additions and 35 deletions
|
@ -1,5 +1,5 @@
|
|||
apiVersion: v2
|
||||
name: postfix
|
||||
name: mail
|
||||
description: Helm chart for Postfix mail server
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
|
@ -1,16 +1,16 @@
|
|||
Postfix service installed. Send email by using the following address and port:
|
||||
|
||||
{{- if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "postfix.fullname" . }})
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "mail.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "postfix.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "postfix.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "mail.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "mail.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "postfix.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "mail.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 587:587
|
||||
{{- end }}
|
|
@ -2,7 +2,7 @@
|
|||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "postfix.name" -}}
|
||||
{{- define "mail.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
|
@ -11,7 +11,7 @@ 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" -}}
|
||||
{{- define "mail.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
|
@ -27,16 +27,16 @@ If release name contains chart name it will be used as a full name.
|
|||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "postfix.chart" -}}
|
||||
{{- define "mail.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" . }}
|
||||
{{- define "mail.labels" -}}
|
||||
helm.sh/chart: {{ include "mail.chart" . }}
|
||||
{{ include "mail.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
|
@ -46,17 +46,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "postfix.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "postfix.name" . }}
|
||||
{{- define "mail.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "mail.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "postfix.serviceAccountName" -}}
|
||||
{{- define "mail.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "postfix.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- default (include "mail.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
|
@ -65,13 +65,13 @@ Create the name of the service account to use
|
|||
{{/*
|
||||
Define checksum annotations
|
||||
*/}}
|
||||
{{- define "postfix.checksums" -}}
|
||||
{{- define "mail.checksums" -}}
|
||||
# Reload for Statefulset when configmap changes on deployment
|
||||
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "postfix.reloader" -}}
|
||||
{{- define "mail.reloader" -}}
|
||||
# Auto-reload postfix if somebody changes config map directly in Kuberentes.
|
||||
# Uses: https://github.com/stakater/Reloader
|
||||
configmap.reloader.stakater.com/reload: "{{ include "postfix.fullname" . }}"
|
||||
configmap.reloader.stakater.com/reload: "{{ include "mail.fullname" . }}"
|
||||
{{- end -}}
|
|
@ -1,4 +1,4 @@
|
|||
{{- $chart := "postfix" -}}
|
||||
{{- $chart := "mail" -}}
|
||||
{{- $fullName := include (print $chart ".fullname") . -}}
|
||||
{{- $labels := include (print $chart ".labels") . -}}
|
||||
{{- $files := .Files -}}
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.autoscaling.enabled }}
|
||||
{{- $chart := "postfix" -}}
|
||||
{{- $chart := "mail" -}}
|
||||
{{- $fullName := include (print $chart ".fullname") . -}}
|
||||
{{- $labels := include (print $chart ".labels") . -}}
|
||||
{{- $kind := "StatefulSet" -}}
|
|
@ -1,4 +1,4 @@
|
|||
{{- $chart := "postfix" -}}
|
||||
{{- $chart := "mail" -}}
|
||||
{{- $fullName := include (print $chart ".fullname") . -}}
|
||||
{{- $labels := include (print $chart ".labels") . -}}
|
||||
{{- $selectorLabels := include (print $chart ".selectorLabels") . -}}
|
|
@ -1,5 +1,5 @@
|
|||
{{- if .Values.serviceAccount.create -}}
|
||||
{{- $chart := "postfix" -}}
|
||||
{{- $chart := "mail" -}}
|
||||
{{- $labels := include (print $chart ".labels") . -}}
|
||||
{{- $serviceAccountName := include (print $chart ".serviceAccountName") . -}}
|
||||
apiVersion: v1
|
|
@ -1,4 +1,4 @@
|
|||
{{- $chart := "postfix" -}}
|
||||
{{- $chart := "mail" -}}
|
||||
{{- $fullName := include (print $chart ".fullname") . -}}
|
||||
{{- $labels := include (print $chart ".labels") . -}}
|
||||
{{- $reloaderAnnotations := include (print $chart ".reloader") . -}}
|
||||
|
@ -55,22 +55,21 @@ spec:
|
|||
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
securityContext: {{- toYaml .Values.container.postfix.securityContext | indent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
ports:
|
||||
- name: smtp
|
||||
containerPort: 587
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 60
|
||||
periodSeconds: 30
|
||||
tcpSocket:
|
||||
port: 587
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 120
|
||||
periodSeconds: 60
|
||||
tcpSocket:
|
||||
port: 587
|
||||
envFrom:
|
||||
|
@ -82,7 +81,14 @@ spec:
|
|||
name: {{ $fullName }}
|
||||
{{- with .Values.extraVolumeMounts }}{{- toYaml . | nindent 12 }}{{ end }}
|
||||
resources: {{ toYaml .Values.resources | nindent 12 }}
|
||||
|
||||
{{- if .Values.persistence.enabled }}
|
||||
{{- with .Values.extraVolumes }}volumes: {{- toYaml . | nindent 8 }}{{ end }}
|
||||
{{- else }}
|
||||
volumes:
|
||||
- name: {{ $fullName }}
|
||||
emptyDir: {}
|
||||
{{- with .Values.extraVolumes }}{{- toYaml . | nindent 8 }}{{ end }}
|
||||
{{- end }}
|
||||
{{- if .Values.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
|
@ -98,10 +104,4 @@ spec:
|
|||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{ with .Values.extraVolumes }}volumes: {{- toYaml . | nindent 4 }}{{ end }}
|
||||
{{- else }}
|
||||
volumes:
|
||||
- name: {{ $fullName }}
|
||||
emptyDir: {}
|
||||
{{- with .Values.extraVolumes }}{{- toYaml . | nindent 4 }}{{ end }}
|
||||
{{- end }}
|
|
@ -2,6 +2,7 @@ replicaCount: 1
|
|||
|
||||
image:
|
||||
repository: boky/postfix
|
||||
# tag: "" # If not specified uses chart's AppVersion as the tag
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
imagePullSecrets: []
|
|
@ -1,2 +1,11 @@
|
|||
image:
|
||||
tag: v2.0.1 # Override version from Chart's AppVersion
|
||||
|
||||
persistence:
|
||||
enabled: false
|
||||
|
||||
config:
|
||||
general:
|
||||
TZ: Europe/London
|
||||
ALLOWED_SENDER_DOMAINS: example.org
|
||||
FORCE_COLOR: "1"
|
||||
|
|
Loading…
Add table
Reference in a new issue