Fix configmaps

This commit is contained in:
Micke Nordin 2023-04-03 15:23:47 +02:00
parent 12a3bbe73b
commit 75f1a7fd5c
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257
4 changed files with 36 additions and 49 deletions

View file

@ -6,3 +6,4 @@ resources:
- redis-deployment.yml - redis-deployment.yml
- redis-service.yml - redis-service.yml
- s3-service.yml - s3-service.yml
- script-configmap.yml

View file

@ -488,12 +488,3 @@ data:
), ),
); );
nc-upgrade.sh: |
#!/bin/bash
sed "s/config_is_read_only\(.\) => true,/config_is_read_only\1 => false,/" /var/www/html/config/config.php > /var/www/html/config/config.php.tmp
mv /var/www/html/config/config.php.tmp /var/www/html/config/config.php
php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ upgrade
php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ maintenance:repair
php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ maintenance:mode --off
sed "s/config_is_read_only\(.\) => false,/config_is_read_only\1 => true,/" /var/www/html/config/config.php > /var/www/html/config/config.php.tmp
mv /var/www/html/config/config.php.tmp /var/www/html/config/config.php

View file

@ -34,13 +34,23 @@ spec:
- name: nextcloud-data - name: nextcloud-data
mountPath: /var/www/html/config/ mountPath: /var/www/html/config/
subPath: config subPath: config
- name: default-config - name: nextcloud-configmap
mountPath: /etc/apache2/sites-enabled/000-default.conf mountPath: /etc/apache2/sites-enabled/000-default.conf
subPath: 000-default.conf subPath: 000-default.conf
- name: hugepage - name: hugepage
mountPath: /dev/hugepages mountPath: /dev/hugepages
- name: nc-upgrade - name: script-configmap
mountPath: /usr/local/bin mountPath: /usr/local/bin/nc-upgrade
subPath: nc-upgrade
- name: nextcloud-configmap
mountPath: /etc/php/8.0/apache2/php.ini
subPath: apache.php.ini
- name: nextcloud-configmap
mountPath: /etc/php/8.0/mods-available/apcu.ini
subPath: apcu.ini
- name: nextcloud-configmap
mountPath: /etc/php/8.0/cli/php.ini
subPath: cli.php.ini
resources: resources:
limits: limits:
cpu: 1500m cpu: 1500m
@ -79,15 +89,6 @@ spec:
- name: nextcloud-data - name: nextcloud-data
mountPath: /var/www/html/config mountPath: /var/www/html/config
subPath: config subPath: config
- name: apache-php-config
mountPath: /etc/php/8.0/
subPath: apache2/php.ini
- name: apcu-php-config
mountPath: /etc/php/8.0/
subPath: mods-available/apcu.ini
- name: cli-php-config
mountPath: /etc/php/8.0/
subPath: cli/php.ini
env: env:
- name: GSS_MASTER_URL - name: GSS_MASTER_URL
value: "https://drive.test.sunet.se" value: "https://drive.test.sunet.se"
@ -178,47 +179,27 @@ spec:
value: "customer.drive.test.sunet.se" value: "customer.drive.test.sunet.se"
command: ["/bin/bash", "-c", "/usr/bin/j2 -f env -o /var/www/html/config/config.php /tmp/config.php.template"] command: ["/bin/bash", "-c", "/usr/bin/j2 -f env -o /var/www/html/config/config.php /tmp/config.php.template"]
volumes: volumes:
- name: nextcloud-config-template - name: nc-upgrade
configMap:
name: script-configmap
items:
- key: "nc-upgrade.sh"
path: "nc-upgrade"
defaultMode: 0744
- name: nextcloud-config
configMap: configMap:
name: nextcloud-configmap name: nextcloud-configmap
items: items:
- key: "config.php" - key: "config.php"
path: "config.php" path: "config.php"
- name: nc-upgrade
configMap:
name: nextcloud-configmap
items:
- key: "nc-upgrade.sh"
path: "nc-upgrade"
defaultMode: 0744
- name: default-config
configMap:
name: nextcloud-configmap
items:
- key: "000-default.conf" - key: "000-default.conf"
path: "000-default.conf" path: "000-default.conf"
- name: cli-php-config
configMap:
name: nextcloud-configmap
items:
- key: "cli.php.ini" - key: "cli.php.ini"
path: "cli.php.ini" path: "cli.php.ini"
- name: apcu-php-config
configMap:
name: nextcloud-configmap
items:
- key: "apcu.ini" - key: "apcu.ini"
path: "apcu.ini" path: "apcu.ini"
- name: apache-php-config
configMap:
name: nextcloud-configmap
items:
- key: "apache.php.ini" - key: "apache.php.ini"
path: "apache.php.ini" path: "apache.php.ini"
- name: cli-php-config
configMap:
name: nextcloud-configmap
items:
- key: "cli.php.ini" - key: "cli.php.ini"
path: "cli.php.ini" path: "cli.php.ini"
- name: hugepage - name: hugepage

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: script-configmap
data:
nc-upgrade.sh: |
#!/bin/bash
sed "s/config_is_read_only\(.\) => true,/config_is_read_only\1 => false,/" /var/www/html/config/config.php > /var/www/html/config/config.php.tmp
mv /var/www/html/config/config.php.tmp /var/www/html/config/config.php
php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ upgrade
php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ maintenance:repair
php -d apc.enable_cli=1 -d memory_limit=-1 /var/www/html/occ maintenance:mode --off
sed "s/config_is_read_only\(.\) => false,/config_is_read_only\1 => true,/" /var/www/html/config/config.php > /var/www/html/config/config.php.tmp
mv /var/www/html/config/config.php.tmp /var/www/html/config/config.php