diff --git a/apps/nextcloud/base/service.yaml b/apps/nextcloud/base/app service.yaml similarity index 100% rename from apps/nextcloud/base/service.yaml rename to apps/nextcloud/base/app service.yaml diff --git a/apps/nextcloud/base/deployment.yaml b/apps/nextcloud/base/app.yaml similarity index 84% rename from apps/nextcloud/base/deployment.yaml rename to apps/nextcloud/base/app.yaml index ccdb5dd..c2eabb6 100644 --- a/apps/nextcloud/base/deployment.yaml +++ b/apps/nextcloud/base/app.yaml @@ -46,16 +46,13 @@ spec: - name: MYSQL_USER value: nextcloud - name: REDIS_HOST - value: 127.0.0.1 + value: redis - name: MYSQL_PASSWORD valueFrom: secretKeyRef: name: nextcloud-secret key: MYSQL_PASSWORD - resources: - limits: - cpu: "0.3" - memory: "1G" + resources: {} ports: - name: mariadb containerPort: 3306 @@ -64,23 +61,13 @@ spec: - mountPath: /var/lib/mysql name: nextcloud-pvc subPath: 99f37b73-8f14-44b2-9211-af5de21de749/db-storage - - image: redis:alpine - name: redis - resources: - limits: - cpu: "0.1" - memory: "250M" - ports: - - name: redis - containerPort: 6379 - protocol: TCP - image: nextcloud name: nextcloud env: - name: MYSQL_DATABASE value: nextcloud - name: MYSQL_HOST - value: 127.0.0.1:3306 + value: maridb:3306 - name: MYSQL_USER value: nextcloud - name: PHP_MEMORY_LIMIT @@ -88,7 +75,7 @@ spec: - name: PHP_UPLOAD_LIMIT value: 100G - name: REDIS_HOST - value: 127.0.0.1 + value: redis - name: MYSQL_PASSWORD valueFrom: secretKeyRef: @@ -98,10 +85,7 @@ spec: - name: nextcloud containerPort: 80 protocol: TCP - resources: - limits: - cpu: "0.5" - memory: "2G" + resources: {} volumeMounts: - mountPath: /var/www/html name: nextcloud-pvc @@ -118,6 +102,4 @@ spec: server: 192.168.178.4 path: /mnt/storage/service/nextcloud/data readOnly: false - - - \ No newline at end of file + \ No newline at end of file diff --git a/apps/nextcloud/base/database service.yaml b/apps/nextcloud/base/database service.yaml new file mode 100644 index 0000000..c5ab1fb --- /dev/null +++ b/apps/nextcloud/base/database service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: mariadb +spec: + ports: + - name: mariadb + port: 3306 + targetPort: mariadb + selector: + app: mariadb diff --git a/apps/nextcloud/base/database.yaml b/apps/nextcloud/base/database.yaml new file mode 100644 index 0000000..d0a737c --- /dev/null +++ b/apps/nextcloud/base/database.yaml @@ -0,0 +1,63 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: mariadb + name: mariadb +spec: + replicas: 1 + revisionHistoryLimit: 1 + selector: + matchLabels: + app: mariadb + strategy: + type: Recreate + template: + metadata: + labels: + app: mariadb + spec: + containers: + - image: mariadb + name: mariadb + args: + - --transaction-isolation=READ-COMMITTED + - --binlog-format=ROW + - --innodb-file-per-table=1 + - --skip-innodb-read-only-compressed + env: + - name: MARIADB_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: nextcloud-secret + key: MARIADB_ROOT_PASSWORD + - name: MYSQL_DATABASE + value: nextcloud + - name: MYSQL_USER + value: nextcloud + - name: REDIS_HOST + value: 127.0.0.1 + - name: MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: nextcloud-secret + key: MYSQL_PASSWORD + resources: + limits: + cpu: "0.3" + memory: "1G" + ports: + - name: mariadb + containerPort: 3306 + protocol: TCP + volumeMounts: + - mountPath: /var/lib/mysql + name: nextcloud-pvc + subPath: 99f37b73-8f14-44b2-9211-af5de21de749/db-storage + + restartPolicy: Always + volumes: + - name: nextcloud-pvc + persistentVolumeClaim: + claimName: nextcloud-pvc + \ No newline at end of file diff --git a/apps/nextcloud/base/redis service.yaml b/apps/nextcloud/base/redis service.yaml new file mode 100644 index 0000000..0755237 --- /dev/null +++ b/apps/nextcloud/base/redis service.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis +spec: + ports: + - name: redis + port: 6379 + targetPort: redis + selector: + app: redis diff --git a/apps/nextcloud/base/redis.yaml b/apps/nextcloud/base/redis.yaml new file mode 100644 index 0000000..766c2b5 --- /dev/null +++ b/apps/nextcloud/base/redis.yaml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: redis + name: redis +spec: + replicas: 1 + revisionHistoryLimit: 1 + selector: + matchLabels: + app: redis + strategy: + type: Recreate + template: + metadata: + labels: + app: redis + spec: + containers: + - image: redis:alpine + name: redis + resources: + limits: {} + ports: + - name: redis + containerPort: 6379 + protocol: TCP + + restartPolicy: Always + \ No newline at end of file