diff --git a/sogo/external-secret.yaml b/sogo/external-secret.yaml deleted file mode 100644 index 5579afe..0000000 --- a/sogo/external-secret.yaml +++ /dev/null @@ -1,23 +0,0 @@ - -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: sogo-postgres-credentials -spec: - secretStoreRef: - name: vault-backend - kind: ClusterSecretStore - refreshInterval: 15m - target: - name: sogo-postgres-credentials - creationPolicy: Owner - data: - - secretKey: username - remoteRef: - key: kv/sogo - property: postgres_user - - secretKey: password - remoteRef: - key: kv/sogo - property: postgres_pw - diff --git a/sogo/postgresql-cluster.yaml b/sogo/postgresql-cluster.yaml deleted file mode 100644 index 17d9dac..0000000 --- a/sogo/postgresql-cluster.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: postgresql.cnpg.io/v1 -kind: Cluster -metadata: - name: sogo-postgres -spec: - instances: 1 - - primaryUpdateStrategy: unsupervised - - bootstrap: - initdb: - database: sogo - owner: sogo - secret: - name: sogo-postgres-credentials - - storage: - storageClass: longhorn - size: 20Gi - - diff --git a/sogo/sogo-config-secret.yaml b/sogo/sogo-config-secret.yaml deleted file mode 100644 index 2f0527c..0000000 --- a/sogo/sogo-config-secret.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: sogo-secrets -spec: - secretStoreRef: - name: vault-backend - kind: ClusterSecretStore - refreshInterval: 15m - target: - name: sogo-secrets - creationPolicy: Owner - template: - engineVersion: v2 - data: - SOGoProfileURL: "postgresql://{{ .postgres_user }}:{{ .postgres_pw }}@sogo-postgres-rw:5432/sogo/sogo_user_profile" - OCSFolderInfoURL: "postgresql://{{ .postgres_user }}:{{ .postgres_pw }}@sogo-postgres-rw:5432/sogo/sogo_folder_info" - OCSSessionsFolderURL: "postgresql://{{ .postgres_user }}:{{ .postgres_pw }}@sogo-postgres-rw:5432/sogo/sogo_sessions_folder" - OCSCacheFolderURL: "postgresql://{{ .postgres_user }}:{{ .postgres_pw }}@sogo-postgres-rw:5432/sogo/sogo_cache_folder" - OCSStoreURL: "postgresql://{{ .postgres_user }}:{{ .postgres_pw }}@sogo-postgres-rw:5432/sogo/sogo_store" - OCSAclURL: "postgresql://{{ .postgres_user }}:{{ .postgres_pw }}@sogo-postgres-rw:5432/sogo/sogo_acl" - SOGoUserSources__yaml: | - - type: sql - id: directory - viewURL: "postgresql://{{ .postgres_user }}:{{ .postgres_pw }}@sogo-postgres-rw:5432/sogo/sogo_users" - canAuthenticate: NO - isAddressBook: NO - userPasswordAlgorithm: none - SOGoIMAPServer: "imaps://stalwart.stalwart.svc.cluster.local:993" - SOGoSieveServer: "sieve://stalwart.stalwart.svc.cluster.local:4190" - SOGoSMTPServer: "stalwart.stalwart.svc.cluster.local" - SOGoMailDomain: "hensen.io" - SOGoForceExternalLoginWithEmail: "YES" - dataFrom: - - extract: - key: kv/sogo diff --git a/stalwart/.helmignore b/stalwart/.helmignore deleted file mode 100644 index e69de29..0000000 diff --git a/stalwart/Chart.yaml b/stalwart/Chart.yaml deleted file mode 100644 index 3c4cc8b..0000000 --- a/stalwart/Chart.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: v2 -name: stalwart -description: Helm chart for Stalwart -version: 0.1.0 -appVersion: "latest" diff --git a/stalwart/templates/_helpers.tpl b/stalwart/templates/_helpers.tpl deleted file mode 100644 index cb6c25f..0000000 --- a/stalwart/templates/_helpers.tpl +++ /dev/null @@ -1,49 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "stalwart.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -*/}} -{{- define "stalwart.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 "stalwart.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "stalwart.labels" -}} -helm.sh/chart: {{ include "stalwart.chart" . }} -{{ include "stalwart.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "stalwart.selectorLabels" -}} -app.kubernetes.io/name: {{ include "stalwart.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} diff --git a/stalwart/templates/configmap.yaml b/stalwart/templates/configmap.yaml deleted file mode 100644 index 41ab8e5..0000000 --- a/stalwart/templates/configmap.yaml +++ /dev/null @@ -1,117 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "stalwart.fullname" . }}-config - labels: - {{- include "stalwart.labels" . | nindent 4 }} -data: - config.toml: | - [server] - hostname = "{{ .Values.config.hostname }}" - max-connections = 8192 - allowed-ip = {{ .Values.config.allowedIPs | toJson }} - - [server.socket] - backlog = 1024 - nodelay = true - reuse-addr = true - reuse-port = true - - [server.listener.http] - bind = "[::]:8080" - protocol = "http" - - [server.listener.https] - bind = "[::]:443" - protocol = "http" - tls.implicit = true - - [server.listener.smtp] - bind = "[::]:25" - protocol = "smtp" - - [server.listener.submission] - bind = "[::]:587" - protocol = "smtp" - - [server.listener.submissions] - bind = "[::]:465" - protocol = "smtp" - tls.implicit = true - - [server.listener.imap] - bind = "[::]:143" - protocol = "imap" - - [server.listener.imaptls] - bind = "[::]:993" - protocol = "imap" - tls.implicit = true - - [server.listener.pop3] - bind = "[::]:110" - protocol = "pop3" - - [server.listener.pop3s] - bind = "[::]:995" - protocol = "pop3" - tls.implicit = true - - [server.listener.sieve] - bind = "[::]:4190" - protocol = "managesieve" - - [http] - use-x-forwarded = {{ .Values.config.useXForwarded }} - - [storage] - data = "rocksdb" - blob = "rocksdb" - fts = "rocksdb" - lookup = "rocksdb" - directory = "internal" - - [store.rocksdb] - type = "rocksdb" - path = "/opt/stalwart/data" - compression = "lz4" - - [directory.internal] - type = "internal" - store = "rocksdb" - - [authentication.fallback-admin] - user = "%{env:STALWART_ADMIN_USER}%" - secret = "%{env:STALWART_ADMIN_PASSWORD}%" - - [queue.strategy] - route = [ { if = "is_local_domain('', rcpt_domain)", then = "'local'" }, - { else = "'smtp2go'" } ] - - [queue.route."smtp2go"] - type = "relay" - address = "mail-eu.smtp2go.com" - port = 2525 - protocol = "smtp" - - [queue.route."smtp2go".tls] - implicit = false - allow-invalid-certs = false - - [queue.route."smtp2go".auth] - username = "%{env:SMTP2GO_USER}%" - secret = "%{env:SMTP2GO_PASSWORD}%" - - [certificate."default"] - cert = "%{file:/opt/stalwart/certs/tls.crt}%" - private-key = "%{file:/opt/stalwart/certs/tls.key}%" - default = true - - [tracer.log] - type = "log" - enable = true - level = "info" - path = "/opt/stalwart/logs" - prefix = "stalwart.log" - rotate = "daily" - ansi = false diff --git a/stalwart/templates/deployment.yaml b/stalwart/templates/deployment.yaml deleted file mode 100644 index de9d0e5..0000000 --- a/stalwart/templates/deployment.yaml +++ /dev/null @@ -1,91 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "stalwart.fullname" . }} - labels: - {{- include "stalwart.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "stalwart.selectorLabels" . | nindent 6 }} - template: - metadata: - annotations: - checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} - labels: - {{- include "stalwart.selectorLabels" . | nindent 8 }} - spec: - hostname: mail - subdomain: hensen-io - containers: - - name: stalwart - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - env: - - name: STALWART_ADMIN_USER - valueFrom: - secretKeyRef: - name: {{ include "stalwart.fullname" . }}-admin - key: user - - name: STALWART_ADMIN_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "stalwart.fullname" . }}-admin - key: pw - - name: SMTP2GO_USER - valueFrom: - secretKeyRef: - name: {{ include "stalwart.fullname" . }}-smtp2go - key: user - - name: SMTP2GO_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "stalwart.fullname" . }}-smtp2go - key: pw - livenessProbe: - httpGet: - path: /healthz/live - port: 8080 - initialDelaySeconds: 30 - periodSeconds: 10 - readinessProbe: - httpGet: - path: /healthz/ready - port: 8080 - initialDelaySeconds: 5 - periodSeconds: 10 - ports: - - containerPort: 8080 - - containerPort: 443 - - containerPort: 25 - hostPort: 25 - - containerPort: 587 - hostPort: 587 - - containerPort: 465 - hostPort: 465 - - containerPort: 143 - hostPort: 143 - - containerPort: 993 - hostPort: 993 - - containerPort: 4190 - hostPort: 4190 - volumeMounts: - - name: stalwart-volume - mountPath: {{ .Values.persistence.mountPath }} - - name: config - mountPath: /opt/stalwart/etc/config.toml - subPath: config.toml - - name: tls-certs - mountPath: /opt/stalwart/certs - readOnly: true - volumes: - - name: stalwart-volume - persistentVolumeClaim: - claimName: {{ include "stalwart.fullname" . }} - - name: config - configMap: - name: {{ include "stalwart.fullname" . }}-config - - name: tls-certs - secret: - secretName: {{ .Values.tls.secretName }} diff --git a/stalwart/templates/external-secret.yaml b/stalwart/templates/external-secret.yaml deleted file mode 100644 index 40f8a24..0000000 --- a/stalwart/templates/external-secret.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: {{ include "stalwart.fullname" . }}-admin - namespace: {{ .Release.Namespace }} - labels: - {{- include "stalwart.labels" . | nindent 4 }} -spec: - refreshInterval: "15m" - secretStoreRef: - name: vault-backend - kind: ClusterSecretStore - target: - name: {{ include "stalwart.fullname" . }}-admin - creationPolicy: Owner - data: - - secretKey: user - remoteRef: - key: kv/stalwartadmin - property: user - - secretKey: pw - remoteRef: - key: kv/stalwartadmin - property: pw diff --git a/stalwart/templates/ingress.yaml b/stalwart/templates/ingress.yaml deleted file mode 100644 index 5c76eb8..0000000 --- a/stalwart/templates/ingress.yaml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ include "stalwart.fullname" . }} - labels: - {{- include "stalwart.labels" . | nindent 4 }} - annotations: - cert-manager.io/cluster-issuer: prod-cluster-issuer - nginx.ingress.kubernetes.io/backend-protocol: "HTTP" - nginx.ingress.kubernetes.io/ssl-passthrough: "false" -spec: - ingressClassName: nginx - rules: - - host: mail.hensen.io - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: {{ include "stalwart.fullname" . }} - port: - number: 8080 - - host: autoconfig.hensen.io - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: {{ include "stalwart.fullname" . }} - port: - number: 8080 - - host: autodiscover.hensen.io - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: {{ include "stalwart.fullname" . }} - port: - number: 8080 - tls: - - secretName: letsencrypt-prod - hosts: - - mail.hensen.io - - autoconfig.hensen.io - - autodiscover.hensen.io diff --git a/stalwart/templates/pvc.yaml b/stalwart/templates/pvc.yaml deleted file mode 100644 index 48cd8cc..0000000 --- a/stalwart/templates/pvc.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if .Values.persistence.enabled }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ include "stalwart.fullname" . }} - labels: - {{- include "stalwart.labels" . | nindent 4 }} -spec: - accessModes: - - {{ .Values.persistence.accessMode }} - storageClassName: {{ .Values.persistence.storageClass }} - resources: - requests: - storage: {{ .Values.persistence.size }} -{{- end }} diff --git a/stalwart/templates/service.yaml b/stalwart/templates/service.yaml deleted file mode 100644 index db60800..0000000 --- a/stalwart/templates/service.yaml +++ /dev/null @@ -1,35 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "stalwart.fullname" . }} - labels: - {{- include "stalwart.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - name: http - port: 8080 - targetPort: 8080 - - name: https - port: 443 - targetPort: 443 - - name: smtp - port: 25 - targetPort: 25 - - name: submission - port: 587 - targetPort: 587 - - name: smtps - port: 465 - targetPort: 465 - - name: imap - port: 143 - targetPort: 143 - - name: imaps - port: 993 - targetPort: 993 - - name: sieve - port: 4190 - targetPort: 4190 - selector: - {{- include "stalwart.selectorLabels" . | nindent 4 }} diff --git a/stalwart/templates/smtp2go-secret.yaml b/stalwart/templates/smtp2go-secret.yaml deleted file mode 100644 index 32b7b7f..0000000 --- a/stalwart/templates/smtp2go-secret.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: {{ include "stalwart.fullname" . }}-smtp2go - namespace: {{ .Release.Namespace }} - labels: - {{- include "stalwart.labels" . | nindent 4 }} -spec: - refreshInterval: "15m" - secretStoreRef: - name: vault-backend - kind: ClusterSecretStore - target: - name: {{ include "stalwart.fullname" . }}-smtp2go - creationPolicy: Owner - data: - - secretKey: user - remoteRef: - key: kv/smtp2go - property: user - - secretKey: pw - remoteRef: - key: kv/smtp2go - property: pw diff --git a/stalwart/values.yaml b/stalwart/values.yaml deleted file mode 100644 index ab6f6c9..0000000 --- a/stalwart/values.yaml +++ /dev/null @@ -1,38 +0,0 @@ -image: - repository: stalwartlabs/stalwart - pullPolicy: IfNotPresent - tag: "latest" - -service: - type: NodePort - ports: - http: 8080 - https: 443 - smtp: 25 - submission: 587 - smtps: 465 - imap: 143 - imaps: 993 - sieve: 4190 - -persistence: - enabled: true - storageClass: longhorn - accessMode: ReadWriteOnce - size: 10Gi - mountPath: /opt/stalwart - -replicaCount: 1 - -tls: - secretName: letsencrypt-prod - -config: - hostname: "mail.hensen.io" - # Whitelist cluster IPs to prevent ingress from being banned - allowedIPs: - - "127.0.0.1" - - "::1" - - "10.0.0.0/8" - # Trust X-Forwarded-For header from reverse proxy for real client IP - useXForwarded: true