--- apiVersion: apps/v1 kind: StatefulSet metadata: name: smarthost namespace: mail annotations: configmap.reloader.stakater.com/reload: "smarthost-config" spec: serviceName: smarthost replicas: 2 selector: matchLabels: app.kubernetes.io/name: smarthost template: metadata: labels: app.kubernetes.io/name: smarthost spec: topologySpreadConstraints: - maxSkew: 1 topologyKey: kubernetes.io/hostname whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app.kubernetes.io/name: smarthost securityContext: seccompProfile: type: RuntimeDefault containers: - name: postfix image: artifactapi.k8s.syd1.au.unkin.net/docker-internal/postfix:0.1.0 imagePullPolicy: IfNotPresent ports: - containerPort: 25 name: smtp protocol: TCP readinessProbe: tcpSocket: port: smtp initialDelaySeconds: 5 periodSeconds: 10 livenessProbe: exec: command: ["postfix", "status"] initialDelaySeconds: 30 periodSeconds: 30 # postfix master runs as root and drops to the postfix user per service. securityContext: allowPrivilegeEscalation: false capabilities: drop: - ALL add: - CHOWN - DAC_OVERRIDE - FOWNER - SETUID - SETGID - NET_BIND_SERVICE resources: requests: cpu: 50m memory: 128Mi limits: cpu: 500m memory: 512Mi volumeMounts: - name: spool mountPath: /var/spool/postfix - name: tls mountPath: /etc/postfix/tls readOnly: true - name: config mountPath: /etc/postfix/main.cf subPath: main.cf readOnly: true - name: config mountPath: /etc/postfix/master.cf subPath: master.cf readOnly: true - name: config mountPath: /etc/postfix/relay_domains subPath: relay_domains readOnly: true - name: config mountPath: /etc/postfix/transport subPath: transport readOnly: true - name: config mountPath: /etc/postfix/gateways.cidr subPath: gateways.cidr readOnly: true - name: config mountPath: /etc/postfix/mynetworks.cidr subPath: mynetworks.cidr readOnly: true - name: config mountPath: /etc/postfix/tls_policy subPath: tls_policy readOnly: true volumes: - name: config configMap: name: smarthost-config - name: tls secret: secretName: wildcard-main-unkin-net-tls volumeClaimTemplates: - metadata: name: spool spec: accessModes: [ReadWriteOnce] storageClassName: cephrbd-fast-delete resources: requests: storage: 50Gi