k8s-manifests/customers/base/nextcloud-deployment.yml

245 lines
8.2 KiB
YAML
Raw Normal View History

2023-03-28 21:37:32 +00:00
kind: StatefulSet
2023-03-27 11:45:09 +00:00
apiVersion: apps/v1
metadata:
name: customer-node
labels:
app: customer-node
spec:
replicas: 1
selector:
matchLabels:
app: customer-node
2023-03-28 21:37:32 +00:00
updateStrategy:
type: RollingUpdate
2023-03-28 21:14:35 +00:00
volumeClaimTemplates:
2023-03-28 21:37:32 +00:00
- metadata:
name: nextcloud-data
spec:
storageClassName: mayastor-3
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
2023-03-27 11:45:09 +00:00
template:
metadata:
labels:
app: customer-node
spec:
2023-03-28 21:37:32 +00:00
restartPolicy: Always
2023-03-29 08:18:20 +00:00
securityContext:
privileged: false
runAsNonRoot: true
allowPrivilegeEscalation: false
runAsUser: 33
runAsGroup: 33
2023-03-29 09:12:24 +00:00
fsGroup: 33
2023-03-27 11:45:09 +00:00
containers:
2023-03-28 21:37:32 +00:00
- name: customer
2023-03-29 07:53:15 +00:00
image: docker.sunet.se/drive/nextcloud-custom:25.0.3.3-4
2023-03-28 21:37:32 +00:00
volumeMounts:
- name: nextcloud-data
mountPath: /var/www/html/config
subPath: config
2023-03-29 08:36:15 +00:00
- name: default-config
2023-03-29 07:53:15 +00:00
mountPath: /etc/apache2/sites-enabled/000-default.conf
subPath: 000-default.conf
2023-03-29 08:36:15 +00:00
- name: apache2-config
mountPath: /etc/apache2/apache2.conf
2023-03-29 08:38:08 +00:00
subPath: apache2.conf
2023-03-29 08:56:03 +00:00
- name: envars
mountPath: /etc/apache2/envars
subPath: envars
2023-03-29 08:18:20 +00:00
- name: ports-config
mountPath: /etc/apache2/ports.conf
subPath: ports.conf
2023-03-29 09:12:24 +00:00
- name: log-volume
2023-03-29 09:13:49 +00:00
mountPath: /var/log/apache2
2023-03-29 09:12:24 +00:00
subPath: apache2
2023-03-29 09:34:01 +00:00
- name: conf-volume
mountPath: /etc/apache2/mods-enabled
subPath: mods-enabled
2023-03-29 09:40:58 +00:00
- name: run-volume
mountPath: /var/run/apache2
subPath: apache2
2023-03-29 10:55:47 +00:00
- name: hugepage
2023-03-29 11:53:04 +00:00
mountPath: /dev/hugepages
2023-03-29 07:37:33 +00:00
resources:
limits:
cpu: 1500m
2023-03-29 11:57:10 +00:00
hugepages-2Mi: 4Gi
2023-03-29 07:37:33 +00:00
memory: 2048Mi
requests:
cpu: 500m
2023-03-29 11:57:10 +00:00
hugepages-2Mi: 4Gi
2023-03-29 07:37:33 +00:00
memory: 256Mi
2023-03-29 07:24:08 +00:00
readinessProbe:
2023-03-29 08:18:20 +00:00
tcpSocket:
port: 8080
initialDelaySeconds: 180
periodSeconds: 60
2023-03-29 07:24:08 +00:00
livenessProbe:
2023-03-29 08:18:20 +00:00
tcpSocket:
port: 8080
initialDelaySeconds: 300
periodSeconds: 180
2023-03-28 21:37:32 +00:00
ports:
2023-03-29 07:53:15 +00:00
- containerPort: 8080
2023-03-29 07:12:38 +00:00
name: nextcloud-http
2023-03-29 10:03:51 +00:00
command: ["/bin/bash"]
2023-03-29 10:55:47 +00:00
args: ["-c", "cp /etc/apache2/mods-available/{php8.0.conf,php8.0.load}; apachectl -D FOREGROUND"]
2023-03-29 09:06:02 +00:00
#command: ["/bin/sh","-c", "apachectl -D FOREGROUND; tail -f /dev/null"]
2023-03-28 21:04:39 +00:00
initContainers:
2023-03-28 21:37:32 +00:00
- image: docker.sunet.se/sunet/docker-jinja:latest
name: init-config
2023-03-29 09:34:01 +00:00
securityContext:
privileged: true
2023-03-28 21:37:32 +00:00
volumeMounts:
- name: nextcloud-config-template
mountPath: /tmp/config.php.template
subPath: config.php
- name: nextcloud-data
mountPath: /var/www/html/config
subPath: config
2023-03-29 09:34:01 +00:00
- name: conf-volume
mountPath: /etc/apache2/mods-enabled
subPath: mods-enabled
2023-03-28 21:37:32 +00:00
env:
- name: GSS_MASTER_URL
value: "https://drive.test.sunet.se"
- name: GSS_JWT_KEY
valueFrom:
secretKeyRef:
name: gss-secret
key: "jwt_key"
- name: LOOKUP_SERVER
value: "https://lookup.drive.test.sunet.se"
- name: MAIL_DOMAIN
value: "drive.test.sunet.se"
- name: MAIL_FROM_ADDRESS
value: "noreply"
- name: MAIL_SMTPHOST
value: "smtp.sunet.se"
- name: MAIL_SMTPNAME
value: "noreply@drive.test.sunet.se"
- name: MAIL_SMTPPASSWORD
valueFrom:
secretKeyRef:
name: mail-secret
key: "smtp_password"
- name: MYSQL_DATABASE
value: "customer_nextcloud"
- name: MYSQL_USER
value: "customer_nextcloud"
- name: MYSQL_HOST
value: "proxysql.proxysql"
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: db-secret
key: "db_password"
- name: MYSQL_PORT
value: "6033"
- name: NEXTCLOUD_TRUSTED_DOMAINS
value: "customer.drive.test.sunet.se"
- name: NEXTCLOUD_ADMIN_USER
value: admin
- name: NEXTCLOUD_VERSION_STRING
value: "25.0.3.3"
- name: NEXTCLOUD_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: nc-secret
key: "nc_admin_password"
- name: NEXTCLOUD_PASSWORDSALT
valueFrom:
secretKeyRef:
name: nc-secret
key: "nc_passwordsalt"
- name: NEXTCLOUD_INSTANCEID
valueFrom:
secretKeyRef:
name: nc-secret
key: "nc_instanceid"
- name: NEXTCLOUD_SECRET
valueFrom:
secretKeyRef:
name: nc-secret
key: "nc_secret"
- name: OBJECTSTORE_S3_REGION
value: "us-east-1"
- name: OBJECTSTORE_S3_HOST
value: "s3.sto4.safedc.net"
- name: OBJECTSTORE_S3_BUCKET
value: "primary-customer-drive-test.sunet.se"
- name: OBJECTSTORE_S3_KEY
valueFrom:
secretKeyRef:
name: s3-secret
key: "s3_key"
- name: OBJECTSTORE_S3_SECRET
valueFrom:
secretKeyRef:
name: s3-secret
key: "s3_secret"
- name: OBJECTSTORE_S3_USEPATH_STYLE
value: "true"
- name: OBJECTSTORE_S3_AUTOCREATE
value: "true"
- name: OBJECTSTORE_S3_SSL
value: "true"
- name: REDIS_HOST
value: "redis.redis"
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-secret
key: "redis_password"
- name: SITE_NAME
value: "customer.drive.test.sunet.se"
2023-03-29 10:03:51 +00:00
command: ["/bin/bash", "-c", "cp /etc/apache2/mods-available/{ccess_compat.load,alias.conf,alias.load,auth_basic.load,authn_core.load,authn_file.load,authz_core.load,authz_host.load,authz_user.load,autoindex.conf,autoindex.load,deflate.conf,deflate.load,dir.conf,dir.load,env.load,filter.load,mime.conf,mime.load,mpm_prefork.conf,mpm_prefork.load,negotiation.conf,negotiation.load,reqtimeout.conf,reqtimeout.load,rewrite.load,setenvif.conf,setenvif.load,socache_shmcb.load,status.conf,status.load} /etc/apache2/mods-enabled/; /usr/bin/j2 -f env -o /var/www/html/config/config.php /tmp/config.php.template"]
2023-03-28 21:44:26 +00:00
volumes:
- name: nextcloud-config-template
configMap:
name: nextcloud-configmap
items:
- key: "config.php"
path: "config.php"
2023-03-29 08:36:15 +00:00
- name: apache2-config
configMap:
name: nextcloud-configmap
items:
- key: "apache2.conf"
path: "apache2.conf"
- name: default-config
2023-03-29 07:53:15 +00:00
configMap:
name: nextcloud-configmap
items:
- key: "000-default.conf"
path: "000-default.conf"
2023-03-29 08:56:03 +00:00
- name: envars
configMap:
name: nextcloud-configmap
items:
- key: "envars"
path: "envars"
2023-03-29 08:18:20 +00:00
- name: ports-config
configMap:
name: nextcloud-configmap
items:
- key: "ports.conf"
path: "ports.conf"
2023-03-29 09:40:58 +00:00
- name: run-volume
emptyDir:
sizeLimit: 500Mi
2023-03-29 09:12:24 +00:00
- name: log-volume
emptyDir:
sizeLimit: 500Mi
2023-03-29 09:34:01 +00:00
- name: conf-volume
emptyDir:
sizeLimit: 500Mi
2023-03-29 10:55:47 +00:00
- name: hugepage
emptyDir:
medium: HugePages