From: aravind.est Date: Tue, 17 Sep 2024 16:21:59 +0000 (+0100) Subject: Add warning message when the default storage class is not set X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=e337e805fd301f624a766e14c88fea873d041ed6;p=it%2Fdep.git Add warning message when the default storage class is not set Warning message added when the default storage class is not set. This prevents the kong installation as the dependent postgres expects the PV to be available. Issue-ID: NONRTRIC-1030 Change-Id: Ia11d7ab261095a875acec3fb690632a2f1f4e25a Signed-off-by: aravind.est --- diff --git a/bin/deploy-nonrtric b/bin/deploy-nonrtric index 6e5f74f8..6ce07a51 100755 --- a/bin/deploy-nonrtric +++ b/bin/deploy-nonrtric @@ -165,6 +165,17 @@ fi echo "Install Kong- $INSTALL_KONG" if [ "$INSTALL_KONG" = true ];then + DEFAULT_SC=$(kubectl get sc -o jsonpath='{.items[?(@.metadata.annotations.storageclass\.kubernetes\.io/is-default-class=="true")].metadata.name}') + if [ -z "$DEFAULT_SC" ];then + echo "----------------------------------- WARNING!!! -------------------------------------------------------" + echo "Default storage class is not set." + echo "Kong PV and PVC creation may fail if it unable to create/use a storage class." + echo "Storage class for the kong installation can be specified in nonrtric/helm/kongstorage/kongvalues.yaml" + echo "------------------------------------------------------------------------------------------------------" + else + echo "Default storage class is set to $DEFAULT_SC" + fi + echo "Install kongstorage through helm" helm install kongstorage -n "${NONRTRIC_NAMESPACE:-nonrtric}" ${HELM_NAME_OPT} "$ROOT_DIR/../nonrtric/helm/kongstorage" diff --git a/nonrtric/helm/kongstorage/kongvalues.yaml b/nonrtric/helm/kongstorage/kongvalues.yaml index 350cb033..c6fff53f 100644 --- a/nonrtric/helm/kongstorage/kongvalues.yaml +++ b/nonrtric/helm/kongstorage/kongvalues.yaml @@ -121,6 +121,10 @@ postgresql: primary: persistence: existingClaim: kongpvc + # If the default storage class is not set, + # This value should be set to create the PV + # storageClass: standard + # ----------------------------------------------------------------------------- # Miscellaneous parameters # -----------------------------------------------------------------------------