mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-07 15:04:56 +08:00
Compare commits
3 commits
76bde40218
...
11f1fb0cf9
Author | SHA1 | Date | |
---|---|---|---|
|
11f1fb0cf9 | ||
|
bbe209cea2 | ||
|
a47f941243 |
8 changed files with 40 additions and 14 deletions
|
@ -628,6 +628,7 @@ Chart configuration is as follows:
|
||||||
| `service.spec` | `{}` | Additional service specifications |
|
| `service.spec` | `{}` | Additional service specifications |
|
||||||
| `service.nodePort` | *empty* | Use a specific `nodePort` |
|
| `service.nodePort` | *empty* | Use a specific `nodePort` |
|
||||||
| `service.nodeIP` | *empty* | Use a specific `nodeIP` |
|
| `service.nodeIP` | *empty* | Use a specific `nodeIP` |
|
||||||
|
| `service.externalTrafficPolicy` | *empty* | Set `loadbalancer` [External traffic policy](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip) |
|
||||||
| `resources` | `{}` | [Pod resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
|
| `resources` | `{}` | [Pod resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
|
||||||
| `autoscaling.enabled` | `false` | Set to `true` to enable [Horisontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) |
|
| `autoscaling.enabled` | `false` | Set to `true` to enable [Horisontal Pod Autoscaler](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) |
|
||||||
| `autoscaling.minReplicas` | `1` | Minimum number of replicas |
|
| `autoscaling.minReplicas` | `1` | Minimum number of replicas |
|
||||||
|
@ -639,7 +640,8 @@ Chart configuration is as follows:
|
||||||
| `nodeSelector` | `{}` | Standard Kubernetes stuff |
|
| `nodeSelector` | `{}` | Standard Kubernetes stuff |
|
||||||
| `tolerations` | `[]` | Standard Kubernetes stuff |
|
| `tolerations` | `[]` | Standard Kubernetes stuff |
|
||||||
| `affinity` | `{}` | Standard Kubernetes stuff |
|
| `affinity` | `{}` | Standard Kubernetes stuff |
|
||||||
| `certs.create` | `{}` | Auto generate TLS certificates for Postfix |
|
| `certs.create` | `false` | Auto generate TLS certificates for Postfix |
|
||||||
|
| `certs.existingSecret` | `""` | Existing secret containing the TLS certificates for Postfix |
|
||||||
| `extraVolumes` | `[]` | Append any extra volumes to the pod |
|
| `extraVolumes` | `[]` | Append any extra volumes to the pod |
|
||||||
| `extraVolumeMounts` | `[]` | Append any extra volume mounts to the postfix container |
|
| `extraVolumeMounts` | `[]` | Append any extra volume mounts to the postfix container |
|
||||||
| `extraInitContainers` | `[]` | Execute any extra init containers on startup |
|
| `extraInitContainers` | `[]` | Execute any extra init containers on startup |
|
||||||
|
|
|
@ -76,3 +76,14 @@ checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . |
|
||||||
configmap.reloader.stakater.com/reload: "{{ include "mail.fullname" . }}"
|
configmap.reloader.stakater.com/reload: "{{ include "mail.fullname" . }}"
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the secret containing HTTPS/TLS certificates
|
||||||
|
*/}}
|
||||||
|
{{- define "tls.secretName" -}}
|
||||||
|
{{- $secretName := .Values.certs.existingSecret -}}
|
||||||
|
{{- if $secretName -}}
|
||||||
|
{{- printf "%s" (tpl $secretName .) -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-certs" (include "mail.fullname" .) -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
|
@ -16,7 +16,7 @@ data:
|
||||||
{{- range $key, $value := .Values.config.opendkim }}
|
{{- range $key, $value := .Values.config.opendkim }}
|
||||||
OPENDKIM_{{ $key }}: {{ $value | quote }}
|
OPENDKIM_{{ $key }}: {{ $value | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.certs.create }}
|
{{- if or .Values.certs.create .Values.certs.existingSecret }}
|
||||||
_enable_tls.sh: |
|
_enable_tls.sh: |
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
|
|
@ -10,7 +10,7 @@ apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
type: kubernetes.io/tls
|
type: kubernetes.io/tls
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ $fullName }}-certs
|
name: {{ include "tls.secretName" . }}
|
||||||
labels:
|
labels:
|
||||||
{{- $labels | nindent 4 }}
|
{{- $labels | nindent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
|
|
|
@ -14,6 +14,9 @@ metadata:
|
||||||
{{- with .Values.service.annotations }}{{ toYaml . | nindent 4 }}{{ end }}
|
{{- with .Values.service.annotations }}{{ toYaml . | nindent 4 }}{{ end }}
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.service.type }}
|
type: {{ .Values.service.type }}
|
||||||
|
{{- if .Values.externalTrafficPolicy }}
|
||||||
|
externalTrafficPolicy: {{ .Values.externalTrafficPolicy }}
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.service.spec }}{{ toYaml . | nindent 2 }}{{ end }}
|
{{- with .Values.service.spec }}{{ toYaml . | nindent 2 }}{{ end }}
|
||||||
ports:
|
ports:
|
||||||
- port: {{ .Values.service.port }}
|
- port: {{ .Values.service.port }}
|
||||||
|
|
|
@ -117,7 +117,7 @@ spec:
|
||||||
subPath: logrotate.sh
|
subPath: logrotate.sh
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.certs.create }}
|
{{- if or .Values.certs.create .Values.certs.existingSecret }}
|
||||||
- name: certs
|
- name: certs
|
||||||
mountPath: /var/run/certs
|
mountPath: /var/run/certs
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
@ -189,14 +189,14 @@ spec:
|
||||||
volumes:
|
volumes:
|
||||||
- name: tmp
|
- name: tmp
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
{{- if .Values.certs.create }}
|
{{- if or .Values.certs.create .Values.certs.existingSecret }}
|
||||||
- name: certs-init
|
- name: certs-init
|
||||||
configMap:
|
configMap:
|
||||||
name: {{ $fullName }}
|
name: {{ $fullName }}
|
||||||
defaultMode: 0755
|
defaultMode: 0755
|
||||||
- name: certs
|
- name: certs
|
||||||
secret:
|
secret:
|
||||||
secretName: {{ $fullName }}-certs
|
secretName: {{ include "tls.secretName" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
# Socket directories
|
# Socket directories
|
||||||
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
||||||
|
|
|
@ -19,6 +19,7 @@ service:
|
||||||
port: 587
|
port: 587
|
||||||
labels: {}
|
labels: {}
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
# externalTrafficPolicy: Cluster
|
||||||
# nodePort:
|
# nodePort:
|
||||||
|
|
||||||
# StatefulSets now require a headless service
|
# StatefulSets now require a headless service
|
||||||
|
@ -84,7 +85,8 @@ metrics:
|
||||||
# a pod and let `StatefulSet` recreate it.
|
# a pod and let `StatefulSet` recreate it.
|
||||||
recreateOnRedeploy: true
|
recreateOnRedeploy: true
|
||||||
|
|
||||||
resources: {}
|
resources:
|
||||||
|
{}
|
||||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
# choice for the user. This also increases chances charts run on environments with little
|
# choice for the user. This also increases chances charts run on environments with little
|
||||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
|
@ -136,8 +138,8 @@ container:
|
||||||
certs:
|
certs:
|
||||||
# Auto-generate certificates for the server and mount them into Postfix volume
|
# Auto-generate certificates for the server and mount them into Postfix volume
|
||||||
create: false
|
create: false
|
||||||
# Provide existing cert
|
# Provide existing secret name
|
||||||
existing: false
|
existingSecret: ""
|
||||||
|
|
||||||
# Define data which should be stored in a Secret
|
# Define data which should be stored in a Secret
|
||||||
# (and shared with the pod as environment variables)
|
# (and shared with the pod as environment variables)
|
||||||
|
@ -154,7 +156,8 @@ existingSecret: ""
|
||||||
mountSecret:
|
mountSecret:
|
||||||
enabled: false
|
enabled: false
|
||||||
path: /var/lib/secret
|
path: /var/lib/secret
|
||||||
data: {}
|
data:
|
||||||
|
{}
|
||||||
# e.g.
|
# e.g.
|
||||||
# dkim-private: |
|
# dkim-private: |
|
||||||
# -----BEGIN RSA PRIVATE KEY-----
|
# -----BEGIN RSA PRIVATE KEY-----
|
||||||
|
@ -162,7 +165,8 @@ mountSecret:
|
||||||
# -----END RSA PRIVATE KEY-----
|
# -----END RSA PRIVATE KEY-----
|
||||||
|
|
||||||
config:
|
config:
|
||||||
general: {}
|
general:
|
||||||
|
{}
|
||||||
# e.g.
|
# e.g.
|
||||||
# TZ:
|
# TZ:
|
||||||
# FORCE_COLOR:
|
# FORCE_COLOR:
|
||||||
|
@ -178,18 +182,21 @@ config:
|
||||||
# SMTP_HEADER_CHECKS:
|
# SMTP_HEADER_CHECKS:
|
||||||
# DKIM_SELECTOR:
|
# DKIM_SELECTOR:
|
||||||
# DKIM_AUTOGENERATE:
|
# DKIM_AUTOGENERATE:
|
||||||
postfix: {}
|
postfix:
|
||||||
|
{}
|
||||||
# e.g.
|
# e.g.
|
||||||
# myhostname: "postfix"
|
# myhostname: "postfix"
|
||||||
# smtp_tls_security_level: "encrypt"
|
# smtp_tls_security_level: "encrypt"
|
||||||
opendkim: {}
|
opendkim:
|
||||||
|
{}
|
||||||
# e.g.
|
# e.g.
|
||||||
# RequireSafeKeys: "yes"
|
# RequireSafeKeys: "yes"
|
||||||
|
|
||||||
dns:
|
dns:
|
||||||
policy: ""
|
policy: ""
|
||||||
# policy: "None"
|
# policy: "None"
|
||||||
nameservers: {}
|
nameservers:
|
||||||
|
{}
|
||||||
# - 8.8.8.8
|
# - 8.8.8.8
|
||||||
# - 8.8.4.4
|
# - 8.8.4.4
|
||||||
searches: ""
|
searches: ""
|
||||||
|
|
3
helm/test_16_certs_existing_secret.yml
Normal file
3
helm/test_16_certs_existing_secret.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
certs:
|
||||||
|
create: false
|
||||||
|
existingSecret: "controller-generated-secret"
|
Loading…
Add table
Reference in a new issue