Skip to content
This repository was archived by the owner on Aug 19, 2024. It is now read-only.

Commit 9fad82f

Browse files
authored
fix: increase default size of the dynamic-plugins-root volume from 1Gi to 2Gi (#238)
* fix: increase default size of the dynamic-plugins-root volume from 1Gi to 2Gi This applies the same fix done in the Helm Chart [1]. As depicted in [2], the init container might fail with insufficient space error: ``` ======= Installing dynamic plugin ./dynamic-plugins/dist/backstage-plugin-scaffolder-backend-module-github-dynamic ==> Grabbing package archive through `npm pack` Traceback (most recent call last): File "/opt/app-root/src/install-dynamic-plugins.py", line 304, in <module> main() File "/opt/app-root/src/install-dynamic-plugins.py", line 230, in main raise InstallException(f'Error while installing plugin \{ package } with \'npm pack\' : ' + completed.stderr.decode('utf-8')) __main__.InstallException: Error while installing plugin /opt/app-root/src/dynamic-plugins/dist/backstage-plugin-scaffolder-backend-module-github-dynamic with 'npm pack' : npm notice npm notice New major version of npm available! 9.8.1 -> 10.4.0 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.4.0> npm notice Run `npm install -g npm@10.4.0` to update! npm notice npm ERR! code ENOSPC npm ERR! syscall open npm ERR! path /dynamic-plugins-root/backstage-plugin-scaffolder-backend-module-github-dynamic-0.2.0-next.3.tgz npm ERR! errno -28 npm ERR! nospc ENOSPC: no space left on device, open '/dynamic-plugins-root/backstage-plugin-scaffolder-backend-module-github-dynamic-0.2.0-next.3.tgz' npm ERR! nospc There appears to be insufficient space on your system to finish. npm ERR! nospc Clear up some disk space and try again. ``` [1] redhat-developer/rhdh-chart#5 [2] https://issues.redhat.com/browse/RHIDP-1332 * Add test
1 parent 47ed61c commit 9fad82f

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

bundle/manifests/backstage-default-config_v1_configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ data:
180180
- ReadWriteOnce
181181
resources:
182182
requests:
183-
storage: 1Gi
183+
storage: 2Gi
184184
name: dynamic-plugins-root
185185
- name: dynamic-plugins-npmrc
186186
secret:

config/manager/default-config/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ spec:
2121
- ReadWriteOnce
2222
resources:
2323
requests:
24-
storage: 1Gi
24+
storage: 2Gi
2525
name: dynamic-plugins-root
2626
- name: dynamic-plugins-npmrc
2727
secret:

controllers/backstage_controller_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
corev1 "k8s.io/api/core/v1"
2727
"k8s.io/apimachinery/pkg/api/errors"
2828
"k8s.io/apimachinery/pkg/api/meta"
29+
"k8s.io/apimachinery/pkg/api/resource"
2930
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3031
"k8s.io/apimachinery/pkg/types"
3132
"k8s.io/utils/pointer"
@@ -299,8 +300,17 @@ var _ = Describe("Backstage controller", func() {
299300
By("Checking the Volumes in the Backstage Deployment", func() {
300301
Expect(found.Spec.Template.Spec.Volumes).To(HaveLen(4))
301302

302-
_, ok := findVolume(found.Spec.Template.Spec.Volumes, "dynamic-plugins-root")
303+
dpRootVol, ok := findVolume(found.Spec.Template.Spec.Volumes, "dynamic-plugins-root")
303304
Expect(ok).To(BeTrue(), "No volume found with name: dynamic-plugins-root")
305+
Expect(dpRootVol.Ephemeral).ShouldNot(BeNil())
306+
Expect(dpRootVol.Ephemeral.VolumeClaimTemplate).ShouldNot(BeNil())
307+
storage := dpRootVol.Ephemeral.VolumeClaimTemplate.Spec.Resources.Requests.Storage()
308+
Expect(storage).ShouldNot(BeNil())
309+
q, pErr := resource.ParseQuantity("1Gi")
310+
Expect(pErr).ShouldNot(HaveOccurred())
311+
// https://issues.redhat.com/browse/RHIDP-1332: storage size should be > 1Gi
312+
Expect(storage.Cmp(q)).To(Equal(1),
313+
"storage size for dynamic-plugins-root volume is currently %v, but it should be more than %v", storage, q)
304314

305315
_, ok = findVolume(found.Spec.Template.Spec.Volumes, "dynamic-plugins-npmrc")
306316
Expect(ok).To(BeTrue(), "No volume found with name: dynamic-plugins-npmrc")

0 commit comments

Comments
 (0)