Files
k8s-apps/mail/roundcube.yaml
2026-03-22 20:53:47 +00:00

291 lines
6.3 KiB
YAML

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: roundcubemail-www
namespace: mail
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 200Mi
storageClassName: cephfs-hyper
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: roundcubemail-temp
namespace: mail
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
storageClassName: cephfs-hyper
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: roundcubemail-db
namespace: mail
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
storageClassName: cephfs-hyper
---
apiVersion: v1
kind: ConfigMap
metadata:
name: roundcubenginx-config
namespace: mail
data:
default.conf: |
server {
listen [::]:80 default_server;
server_name _;
root /var/www/html;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php(/|$) {
try_files $uri =404;
fastcgi_pass roundcubemail:9000;
fastcgi_read_timeout 300;
proxy_read_timeout 300;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
client_max_body_size 6m;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: roundcubedb
namespace: mail
labels:
service: roundcubedb
spec:
replicas: 1
selector:
matchLabels:
service: roundcubedb
strategy:
type: Recreate
template:
metadata:
labels:
service: roundcubedb
spec:
containers:
- name: roundcubedb
image: postgres
imagePullPolicy: ""
env:
- name: POSTGRES_DB
value: roundcube
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: roundcubemail-shared-secret
key: DB_USER
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: roundcubemail-shared-secret
key: DB_PASSWORD
ports:
- containerPort: 5432
volumeMounts:
- mountPath: /var/lib/postgresql
name: roundcubemail-db
restartPolicy: Always
serviceAccountName: ""
volumes:
- name: roundcubemail-db
persistentVolumeClaim:
claimName: roundcubemail-db
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: roundcubemail
namespace: mail
labels:
service: roundcubemail
spec:
replicas: 1
selector:
matchLabels:
service: roundcubemail
strategy:
type: Recreate
template:
metadata:
labels:
service: roundcubemail
spec:
containers:
- name: roundcubemail
image: roundcube/roundcubemail:1.6.1-fpm-alpine
imagePullPolicy: ""
env:
- name: ROUNDCUBEMAIL_DB_TYPE
value: pgsql
- name: ROUNDCUBEMAIL_DB_HOST
value: roundcubedb
- name: ROUNDCUBEMAIL_DB_NAME
value: roundcube
- name: ROUNDCUBEMAIL_DB_USER
valueFrom:
secretKeyRef:
name: roundcubemail-shared-secret
key: DB_USER
- name: ROUNDCUBEMAIL_DB_PASSWORD
valueFrom:
secretKeyRef:
name: roundcubemail-shared-secret
key: DB_PASSWORD
- name: ROUNDCUBEMAIL_DES_KEY
valueFrom:
secretKeyRef:
name: roundcubemail-shared-secret
key: DES_KEY
- name: ROUNDCUBEMAIL_DEFAULT_HOST
value: tls://mail.apps.undercloud.dev.
- name: ROUNDCUBEMAIL_SMTP_SERVER
value: tls://mail.apps.undercloud.dev.
- name: ROUNDCUBEMAIL_SKIN
value: elastic
- name: ROUNDCUBEMAIL_PLUGINS
value: archive,zipdownload,newmail_notifier
ports:
- containerPort: 9000
volumeMounts:
- mountPath: /var/www/html
name: www-data
- mountPath: /tmp/roundcube-temp
name: temp-data
restartPolicy: Always
# serviceAccountName: ""
volumes:
- name: www-data
persistentVolumeClaim:
claimName: roundcubemail-www
- name: temp-data
persistentVolumeClaim:
claimName: roundcubemail-temp
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: roundcubenginx
namespace: mail
labels:
app: roundcubenginx
spec:
replicas: 1
selector:
matchLabels:
app: roundcubenginx
strategy:
type: Recreate
template:
metadata:
labels:
app: roundcubenginx
spec:
containers:
- name: roundcubenginx
image: nginx
imagePullPolicy: IfNotPresent
env:
- name: NGINX_HOST
value: localhost
- name: NGINX_PHP_CGI
value: roundcubemail:9000
ports:
- containerPort: 80
volumeMounts:
- name: www-data
mountPath: /var/www/html
- name: nginx-config
mountPath: /etc/nginx/conf.d/default.conf
subPath: default.conf
restartPolicy: Always
serviceAccountName: ""
volumes:
- name: www-data
persistentVolumeClaim:
claimName: roundcubemail-www
- name: nginx-config
configMap:
name: roundcubenginx-config
---
apiVersion: v1
kind: Service
metadata:
name: roundcubedb
namespace: mail
labels:
service: roundcubedb
spec:
ipFamilies:
- IPv6
- IPv4
ipFamilyPolicy: PreferDualStack
type: ClusterIP
ports:
- port: 5432
targetPort: 5432
protocol: TCP
selector:
service: roundcubedb
---
apiVersion: v1
kind: Service
metadata:
name: roundcubemail
namespace: mail
labels:
service: roundcubemail
spec:
ipFamilies:
- IPv6
- IPv4
ipFamilyPolicy: PreferDualStack
type: ClusterIP
ports:
- port: 9000
targetPort: 9000
protocol: TCP
selector:
service: roundcubemail
---
apiVersion: v1
kind: Service
metadata:
name: roundcubenginx
namespace: mail
labels:
app: roundcubenginx
spec:
ipFamilies:
- IPv6
ipFamilyPolicy: SingleStack
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 80
selector:
app: roundcubenginx