diff --git a/customers/base/kustomization.yaml b/customers/base/kustomization.yaml index a86d006..0871204 100644 --- a/customers/base/kustomization.yaml +++ b/customers/base/kustomization.yaml @@ -6,3 +6,4 @@ resources: - redis-deployment.yml - redis-service.yml - s3-service.yml + - script-configmap.yml diff --git a/customers/base/nextcloud-configmap.yml b/customers/base/nextcloud-configmap.yml index 08e7aed..2b25262 100644 --- a/customers/base/nextcloud-configmap.yml +++ b/customers/base/nextcloud-configmap.yml @@ -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 diff --git a/customers/base/nextcloud-deployment.yml b/customers/base/nextcloud-deployment.yml index 0ceb2ac..7d3eb22 100644 --- a/customers/base/nextcloud-deployment.yml +++ b/customers/base/nextcloud-deployment.yml @@ -34,13 +34,23 @@ spec: - name: nextcloud-data mountPath: /var/www/html/config/ subPath: config - - name: default-config + - name: nextcloud-configmap mountPath: /etc/apache2/sites-enabled/000-default.conf subPath: 000-default.conf - name: hugepage mountPath: /dev/hugepages - - name: nc-upgrade - mountPath: /usr/local/bin + - name: script-configmap + 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: limits: cpu: 1500m @@ -79,15 +89,6 @@ spec: - name: nextcloud-data mountPath: /var/www/html/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: - name: GSS_MASTER_URL value: "https://drive.test.sunet.se" @@ -178,47 +179,27 @@ spec: 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"] 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: name: nextcloud-configmap items: - key: "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" path: "000-default.conf" - - name: cli-php-config - configMap: - name: nextcloud-configmap - items: - key: "cli.php.ini" path: "cli.php.ini" - - name: apcu-php-config - configMap: - name: nextcloud-configmap - items: - key: "apcu.ini" path: "apcu.ini" - - name: apache-php-config - configMap: - name: nextcloud-configmap - items: - key: "apache.php.ini" path: "apache.php.ini" - - name: cli-php-config - configMap: - name: nextcloud-configmap - items: - key: "cli.php.ini" path: "cli.php.ini" - name: hugepage diff --git a/customers/base/script-configmap.yml b/customers/base/script-configmap.yml new file mode 100644 index 0000000..25fd911 --- /dev/null +++ b/customers/base/script-configmap.yml @@ -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