From f8c454897694dfbbe3ba6a241835bf2ffaca2646 Mon Sep 17 00:00:00 2001 From: "aravind.est" Date: Tue, 22 Apr 2025 12:07:07 +0100 Subject: [PATCH] Add NONRTRIC Kong storage PV configuration flag Creating PV for kongstorage may not be necessary in all the target environments. Kong storage PV should be created only when there is no default storage class is configured in the cluster Issue-ID: NONRTRIC-1020 Change-Id: I180fdb7c634293869b8b22f8036b00109557c511 Signed-off-by: aravind.est --- nonrtric/helm/kongstorage/templates/kongpv.yaml | 4 +++- nonrtric/helm/kongstorage/templates/kongpvc.yaml | 4 +++- nonrtric/helm/kongstorage/values.yaml | 7 +++++-- smo-install/helm-override/default/oran-override.yaml | 5 +++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/nonrtric/helm/kongstorage/templates/kongpv.yaml b/nonrtric/helm/kongstorage/templates/kongpv.yaml index 1015a24e..d96fcb17 100644 --- a/nonrtric/helm/kongstorage/templates/kongpv.yaml +++ b/nonrtric/helm/kongstorage/templates/kongpv.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START=============================================== -# Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved. +# Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ # limitations under the License. # ============LICENSE_END================================================= # +{{- if .Values.kongpv.enabled }} apiVersion: v1 kind: PersistentVolume metadata: @@ -28,3 +29,4 @@ spec: hostPath: path: "{{ .Values.kongpv.persistence.path }}" persistentVolumeReclaimPolicy: "{{ .Values.kongpv.persistence.volumeReclaimPolicy }}" +{{- end }} \ No newline at end of file diff --git a/nonrtric/helm/kongstorage/templates/kongpvc.yaml b/nonrtric/helm/kongstorage/templates/kongpvc.yaml index 67fef197..1a8762d8 100644 --- a/nonrtric/helm/kongstorage/templates/kongpvc.yaml +++ b/nonrtric/helm/kongstorage/templates/kongpvc.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START=============================================== -# Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved. +# Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,4 +24,6 @@ spec: resources: requests: storage: "{{ .Values.kongpvc.persistence.size }}" +{{- if .Values.kongpv.enabled }} volumeName: kongpv +{{- end }} diff --git a/nonrtric/helm/kongstorage/values.yaml b/nonrtric/helm/kongstorage/values.yaml index e022b858..f05dfa4b 100644 --- a/nonrtric/helm/kongstorage/values.yaml +++ b/nonrtric/helm/kongstorage/values.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START=============================================== -# Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved. +# Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,10 @@ # Default values for Kong PV and PVC kongpv: - enabled: true # Disabled for Minikube + # This enables/disables the PV creation for kong + # PV creation is necessary when there is no default storage class + # This should be set to false when there is a default storage class, Which lets the PVC provisions the PV dynamically. + enabled: true persistence: volumeReclaimPolicy: Delete accessMode: ReadWriteOnce diff --git a/smo-install/helm-override/default/oran-override.yaml b/smo-install/helm-override/default/oran-override.yaml index c724693e..949be9a5 100644 --- a/smo-install/helm-override/default/oran-override.yaml +++ b/smo-install/helm-override/default/oran-override.yaml @@ -81,6 +81,11 @@ kong: installCRDs: false admin: enabled: true + kongpv: + # This enables/disables the PV creation for kong + # PV creation is necessary when there is no default storage class + # This should be set to false when there is a default storage class, Which lets the PVC provisions the PV dynamically. + enabled: true controlpanel: ingress: -- 2.16.6