mirror of
https://github.com/rubenhensen/k8scd.git
synced 2026-09-17 02:12:55 +02:00
@@ -1,7 +1,7 @@
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: sogo
|
||||
name: snappymail-folder
|
||||
namespace: argocd
|
||||
finalizers:
|
||||
- resources-finalizer.argocd.argoproj.io
|
||||
@@ -10,13 +10,13 @@ spec:
|
||||
source:
|
||||
repoURL: https://github.com/rubenhensen/k8scd.git
|
||||
targetRevision: HEAD
|
||||
path: sogo
|
||||
path: snappymail
|
||||
destination:
|
||||
server: https://kubernetes.default.svc
|
||||
namespace: sogo
|
||||
namespace: snappymail
|
||||
syncPolicy:
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
automated:
|
||||
selfHeal: true
|
||||
prune: true
|
||||
syncOptions:
|
||||
- CreateNamespace=true
|
||||
@@ -0,0 +1,53 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: snappymail
|
||||
labels:
|
||||
app: snappymail
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: snappymail
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: snappymail
|
||||
spec:
|
||||
containers:
|
||||
- name: snappymail
|
||||
image: djmaze/snappymail:latest
|
||||
ports:
|
||||
- containerPort: 8888
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: TZ
|
||||
value: Europe/Amsterdam
|
||||
volumeMounts:
|
||||
- name: snappymail-data
|
||||
mountPath: /var/lib/snappymail
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8888
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 8888
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
resources:
|
||||
requests:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
volumes:
|
||||
- name: snappymail-data
|
||||
persistentVolumeClaim:
|
||||
claimName: snappymail-data
|
||||
@@ -0,0 +1,27 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: snappymail
|
||||
labels:
|
||||
app: snappymail
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: prod-cluster-issuer
|
||||
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
|
||||
nginx.ingress.kubernetes.io/proxy-body-size: "50m"
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
tls:
|
||||
- hosts:
|
||||
- post.hensen.io
|
||||
secretName: snappymail-tls
|
||||
rules:
|
||||
- host: post.hensen.io
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: snappymail
|
||||
port:
|
||||
number: 80
|
||||
@@ -1,8 +1,9 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: sogo-data
|
||||
namespace: sogo
|
||||
name: snappymail-data
|
||||
labels:
|
||||
app: snappymail
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
@@ -0,0 +1,14 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: snappymail
|
||||
labels:
|
||||
app: snappymail
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8888
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: snappymail
|
||||
@@ -1,66 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: sogo-config
|
||||
namespace: sogo
|
||||
data:
|
||||
sogo.yaml: |
|
||||
# Mail Server Configuration
|
||||
SOGoIMAPServer: stalwart.stalwart.svc.cluster.local:143
|
||||
SOGoSMTPServer: stalwart.stalwart.svc.cluster.local:587
|
||||
SOGoMailDomain: hensen.io
|
||||
SOGoForceIMAPLoginWithEmail: true
|
||||
|
||||
# Database Configuration
|
||||
SOGoProfileURL: "postgresql://sogo:${POSTGRES_PASSWORD}@sogo-postgres-rw.sogo.svc.cluster.local:5432/sogo/sogo_user_profile?sslmode=require"
|
||||
OCSFolderInfoURL: "postgresql://sogo:${POSTGRES_PASSWORD}@sogo-postgres-rw.sogo.svc.cluster.local:5432/sogo/sogo_folder_info?sslmode=require"
|
||||
OCSSessionsFolderURL: "postgresql://sogo:${POSTGRES_PASSWORD}@sogo-postgres-rw.sogo.svc.cluster.local:5432/sogo/sogo_sessions_folder?sslmode=require"
|
||||
OCSAclURL: "postgresql://sogo:${POSTGRES_PASSWORD}@sogo-postgres-rw.sogo.svc.cluster.local:5432/sogo/sogo_acl?sslmode=require"
|
||||
|
||||
# General Settings
|
||||
SOGoTimeZone: Europe/Amsterdam
|
||||
SOGoLanguage: English
|
||||
SOGoSuperUsername: admin@hensen.io
|
||||
|
||||
# Modules
|
||||
SOGoModules:
|
||||
- Mail
|
||||
- Calendar
|
||||
- Contacts
|
||||
- Tasks
|
||||
|
||||
# Calendar Settings
|
||||
SOGoCalendarDefaultRoles:
|
||||
- PublicViewer
|
||||
- ConfidentialDAndTViewer
|
||||
SOGoFirstDayOfWeek: 1
|
||||
SOGoFirstWeekOfYear: January1
|
||||
SOGoDayStartTime: 8
|
||||
SOGoDayEndTime: 18
|
||||
|
||||
# Authentication
|
||||
SOGoAuthenticationType: IMAP
|
||||
|
||||
# WebUI Settings
|
||||
SOGoPageTitle: "SOGo @ hensen.io"
|
||||
SOGoLoginModule: Mail
|
||||
SOGoRefreshViewCheck: every_5_minutes
|
||||
SOGoMailMessageCheck: every_5_minutes
|
||||
|
||||
# Mail Preferences
|
||||
SOGoMailAuxiliaryUserAccountsEnabled: true
|
||||
SOGoMailComposeMessageType: html
|
||||
SOGoMailReplyPlacement: below
|
||||
SOGoMailSignaturePlacement: below
|
||||
|
||||
# Security
|
||||
SOGoPasswordChangeEnabled: false
|
||||
SOGoXSRFValidationEnabled: true
|
||||
|
||||
# Performance
|
||||
SOGoMemcachedHost: ""
|
||||
WOWorkersCount: 3
|
||||
WOListenQueueSize: 5
|
||||
WONoDetach: true
|
||||
WOLogFile: "-"
|
||||
WOPidFile: /var/run/sogo/sogo.pid
|
||||
@@ -1,86 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: sogo
|
||||
namespace: sogo
|
||||
labels:
|
||||
app: sogo
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: sogo
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: sogo
|
||||
spec:
|
||||
initContainers:
|
||||
- name: config-init
|
||||
image: alpine:latest
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
apk add --no-cache python3
|
||||
ENCODED_PASSWORD=$(python3 -c "import urllib.parse; print(urllib.parse.quote('${POSTGRES_PASSWORD}', safe=''))")
|
||||
export POSTGRES_PASSWORD="${ENCODED_PASSWORD}"
|
||||
cat /config-template/sogo.yaml | sed "s|\${POSTGRES_PASSWORD}|${POSTGRES_PASSWORD}|g" > /config/sogo.yaml
|
||||
echo "Configuration file prepared with URL-encoded password"
|
||||
env:
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: sogo-postgres-credentials
|
||||
key: password
|
||||
volumeMounts:
|
||||
- name: config-template
|
||||
mountPath: /config-template
|
||||
- name: config
|
||||
mountPath: /config
|
||||
containers:
|
||||
- name: sogo
|
||||
image: sonroyaalmerol/docker-sogo:latest
|
||||
ports:
|
||||
- containerPort: 80
|
||||
name: http
|
||||
env:
|
||||
- name: TZ
|
||||
value: "Europe/Amsterdam"
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /etc/sogo/sogo.conf.d/
|
||||
- name: data
|
||||
mountPath: /srv/lib/sogo
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "200m"
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "1000m"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /SOGo
|
||||
port: 80
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 30
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /SOGo
|
||||
port: 80
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
volumes:
|
||||
- name: config-template
|
||||
configMap:
|
||||
name: sogo-config
|
||||
- name: config
|
||||
emptyDir: {}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: sogo-data
|
||||
@@ -1,22 +0,0 @@
|
||||
apiVersion: external-secrets.io/v1beta1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: sogo-postgres-credentials
|
||||
namespace: sogo
|
||||
spec:
|
||||
refreshInterval: 15m
|
||||
secretStoreRef:
|
||||
name: vault-backend
|
||||
kind: ClusterSecretStore
|
||||
target:
|
||||
name: sogo-postgres-credentials
|
||||
creationPolicy: Owner
|
||||
template:
|
||||
data:
|
||||
username: "sogo"
|
||||
password: "{{ .postgres_pw }}"
|
||||
data:
|
||||
- secretKey: postgres_pw
|
||||
remoteRef:
|
||||
key: kv/sogo
|
||||
property: postgres_pw
|
||||
@@ -1,26 +0,0 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: sogo
|
||||
namespace: sogo
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: prod-cluster-issuer
|
||||
nginx.ingress.kubernetes.io/backend-protocol: HTTP
|
||||
nginx.ingress.kubernetes.io/proxy-body-size: "50m"
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
tls:
|
||||
- hosts:
|
||||
- post.hensen.io
|
||||
secretName: sogo-tls
|
||||
rules:
|
||||
- host: post.hensen.io
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: sogo
|
||||
port:
|
||||
number: 80
|
||||
@@ -1,25 +0,0 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: sogo-postgres
|
||||
namespace: sogo
|
||||
spec:
|
||||
instances: 1
|
||||
|
||||
storage:
|
||||
size: 10Gi
|
||||
storageClass: longhorn
|
||||
|
||||
bootstrap:
|
||||
initdb:
|
||||
database: sogo
|
||||
owner: sogo
|
||||
secret:
|
||||
name: sogo-postgres-credentials
|
||||
postInitSQL:
|
||||
- CREATE EXTENSION IF NOT EXISTS pg_trgm;
|
||||
|
||||
postgresql:
|
||||
parameters:
|
||||
max_connections: "100"
|
||||
shared_buffers: "256MB"
|
||||
@@ -1,16 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: sogo
|
||||
namespace: sogo
|
||||
labels:
|
||||
app: sogo
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: sogo
|
||||
Reference in New Issue
Block a user