Merge "[PORTAL] Disable Portal"
authorFiachra Corcoran <fiachra.corcoran@est.tech>
Wed, 6 Apr 2022 16:40:27 +0000 (16:40 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 6 Apr 2022 16:40:27 +0000 (16:40 +0000)
kubernetes/common/postgres/templates/_deployment.tpl
kubernetes/common/repositoryGenerator/templates/_repository.tpl
kubernetes/dcaegen2-services/common/dcaegen2-services-common/templates/_deployment.tpl
kubernetes/helm/plugins/deploy/deploy.sh
kubernetes/modeling/components/modeling-etsicatalog/values.yaml
kubernetes/strimzi/templates/strimzi-kafka.yaml

index 341b4c8..1051aaf 100644 (file)
@@ -33,6 +33,8 @@ metadata:
     name: "{{ index $dot.Values "container" "name" $pgMode }}"
 spec:
   replicas: 1
+  strategy:
+    type: Recreate
   selector:
     matchLabels:
       app: {{ include "common.name" $dot }}-{{ $pgMode }}
index f57d390..1b99285 100644 (file)
     mail: email (optional)
   You can also set the same things for dockerHub, elastic and googleK8s if
   needed.
+  if not needed, set global.repositoryCred.user to empty value.
 */}}
 {{- define "repositoryGenerator.secret" -}}
   {{- $dot := default . .dot -}}
   {{- if $subchartDot.Values.global.repositoryCred }}
   {{-   $repo := $subchartDot.Values.global.repository }}
   {{-   $cred := $subchartDot.Values.global.repositoryCred }}
-  {{-   $mail := default "@" $cred.mail }}
-  {{-   $auth := printf "%s:%s" $cred.user $cred.password | b64enc }}
-  {{-   $repoCreds = printf "\"%s\": {\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}" $repo $cred.user $cred.password $mail $auth }}
+  {{-   if $cred.user }}
+  {{-     $mail := default "@" $cred.mail }}
+  {{-     $auth := printf "%s:%s" $cred.user $cred.password | b64enc }}
+  {{-     $repoCreds = printf "\"%s\": {\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}" $repo $cred.user $cred.password $mail $auth }}
+  {{-   end }}
   {{- end }}
   {{- if $subchartDot.Values.global.dockerHubRepositoryCred }}
   {{-   $dhRepo := $subchartDot.Values.global.dockerHubRepository }}
index 5a45fa1..fbaaedf 100644 (file)
@@ -366,12 +366,12 @@ spec:
         - name: POLICY_SYNC_PDP_USER
           valueFrom:
             secretKeyRef:
-              name: {{ $policyRls }}-policy-xacml-pdp-api-creds
+              name: {{ $policyRls }}-policy-xacml-pdp-restserver-creds
               key: login
         - name: POLICY_SYNC_PDP_PASS
           valueFrom:
             secretKeyRef:
-              name: {{ $policyRls }}-policy-xacml-pdp-api-creds
+              name: {{ $policyRls }}-policy-xacml-pdp-restserver-creds
               key: password
         - name: POLICY_SYNC_PDP_URL
           value : http{{ if (include "common.needTLS" .) }}s{{ end }}://policy-xacml-pdp:6969
index f32281d..51438ad 100755 (executable)
@@ -100,6 +100,40 @@ check_for_dep() {
     sleep 15
 }
 
+deploy_strimzi() {
+  #Deploy the srtimzi-kafka chart in advance. Dependent charts require the entity-operator
+  #for management of the strimzi crds
+  deploy_subchart
+  echo "waiting for ${RELEASE}-strimzi-entity-operator to be deployed"
+  check_for_dep ${RELEASE}-strimzi-entity-operator
+}
+
+deploy_subchart() {
+  if [ -z "$SUBCHART_RELEASE" ] || [ "$SUBCHART_RELEASE" = "$subchart" ]; then
+        LOG_FILE=$LOG_DIR/"${RELEASE}-${subchart}".log
+        :> $LOG_FILE
+
+        helm upgrade -i "${RELEASE}-${subchart}" $CACHE_SUBCHART_DIR/$subchart \
+         $DEPLOY_FLAGS -f $GLOBAL_OVERRIDES -f $SUBCHART_OVERRIDES \
+         > $LOG_FILE 2>&1
+
+        if [ "$VERBOSE" = "true" ]; then
+          cat $LOG_FILE
+        else
+          echo "release \"${RELEASE}-${subchart}\" deployed"
+        fi
+        # Add annotation last-applied-configuration if set-last-applied flag is set
+        if [ "$SET_LAST_APPLIED" = "true" ]; then
+          helm get manifest "${RELEASE}-${subchart}" \
+          | kubectl apply set-last-applied --create-annotation -n onap -f - \
+          > $LOG_FILE.log 2>&1
+        fi
+      fi
+      if [ "$DELAY" = "true" ]; then
+        echo sleep 3m
+        sleep 180
+      fi
+}
 
 deploy() {
   # validate params
@@ -234,53 +268,49 @@ deploy() {
   #So cache the results to prevent repeated execution.
   ALL_HELM_RELEASES=$(helm ls -q)
 
-  #Deploy the srtimzi-kafka chart in advance. Dependent charts require the entity-operator
-  #for management of the strimzi crds
-  helm upgrade -i "${RELEASE}-strimzi" $CACHE_SUBCHART_DIR/strimzi
-  echo "waiting for ${RELEASE}-strimzi-entity-operator to be deployed"
-  check_for_dep ${RELEASE}-strimzi-entity-operator
-
-  for subchart in * ; do
-    SUBCHART_OVERRIDES=$CACHE_SUBCHART_DIR/$subchart/subchart-overrides.yaml
-
-    SUBCHART_ENABLED=0
-    if [ -f $SUBCHART_OVERRIDES ]; then
-      SUBCHART_ENABLED=$(cat $SUBCHART_OVERRIDES | grep -c "^enabled: true")
-    fi
+    for subchart in strimzi cassandra mariadb-galera postgres ; do
+      SUBCHART_OVERRIDES=$CACHE_SUBCHART_DIR/$subchart/subchart-overrides.yaml
 
-    if [ $SUBCHART_ENABLED -eq 1 ]; then
-      if [ -z "$SUBCHART_RELEASE" ] || [ "$SUBCHART_RELEASE" = "$subchart" ]; then
-        LOG_FILE=$LOG_DIR/"${RELEASE}-${subchart}".log
-        :> $LOG_FILE
+      SUBCHART_ENABLED=0
+      if [ -f $SUBCHART_OVERRIDES ]; then
+        SUBCHART_ENABLED=$(cat $SUBCHART_OVERRIDES | grep -c "^enabled: true")
+      fi
+      if [ "${subchart}" = "strimzi" ] && [ $SUBCHART_ENABLED -eq 1 ]; then
+        deploy_strimzi
+      fi
+      # Deploy them at first
+      if [ $SUBCHART_ENABLED -eq 1 ]; then
+        deploy_subchart
+      else
+        array=($(echo "$ALL_HELM_RELEASES" | grep "${RELEASE}-${subchart}"))
+        n=${#array[*]}
+        for i in $(seq $(($n-1)) -1 0); do
+          helm del "${array[i]}"
+        done
+      fi
+    done
 
-        helm upgrade -i "${RELEASE}-${subchart}" $CACHE_SUBCHART_DIR/$subchart \
-         $DEPLOY_FLAGS -f $GLOBAL_OVERRIDES -f $SUBCHART_OVERRIDES \
-         > $LOG_FILE 2>&1
+    for subchart in * ; do
+      SUBCHART_OVERRIDES=$CACHE_SUBCHART_DIR/$subchart/subchart-overrides.yaml
 
-        if [ "$VERBOSE" = "true" ]; then
-          cat $LOG_FILE
-        else
-          echo "release \"${RELEASE}-${subchart}\" deployed"
-        fi
-        # Add annotation last-applied-configuration if set-last-applied flag is set
-        if [ "$SET_LAST_APPLIED" = "true" ]; then
-          helm get manifest "${RELEASE}-${subchart}" \
-          | kubectl apply set-last-applied --create-annotation -n onap -f - \
-          > $LOG_FILE.log 2>&1
-        fi
+      SUBCHART_ENABLED=0
+      if [ -f $SUBCHART_OVERRIDES ]; then
+        SUBCHART_ENABLED=$(cat $SUBCHART_OVERRIDES | grep -c "^enabled: true")
       fi
-      if [ "$DELAY" = "true" ]; then
-        echo sleep 3m
-        sleep 180
+      if [ "${subchart}" = "strimzi" ] || [ "${subchart}" = "cassandra" ] || [ "${subchart}" = "mariadb-galera" ] || [ "${subchart}" = "postgres" ]; then
+        SUBCHART_ENABLED=0
       fi
-    else
-      array=($(echo "$ALL_HELM_RELEASES" | grep "${RELEASE}-${subchart}"))
-      n=${#array[*]}
-      for i in $(seq $(($n-1)) -1 0); do
-        helm del "${array[i]}"
-      done
-    fi
-  done
+      # Deploy the others
+      if [ $SUBCHART_ENABLED -eq 1 ]; then
+        deploy_subchart
+      else
+        array=($(echo "$ALL_HELM_RELEASES" | grep "${RELEASE}-${subchart}"))
+        n=${#array[*]}
+        for i in $(seq $(($n-1)) -1 0); do
+          helm del "${array[i]}"
+        done
+      fi
+    done
 
   # report on success/failures of installs/upgrades
   helm ls --all-namespaces | grep -i FAILED | grep $RELEASE
index b4d8837..1b1bb38 100644 (file)
@@ -102,7 +102,7 @@ config:
 # application image
 flavor: small
 
-image: onap/modeling/etsicatalog:1.0.11
+image: onap/modeling/etsicatalog:1.0.13
 pullPolicy: Always
 
 #Istio sidecar injection policy
index 4ca53a2..cfd2ef1 100644 (file)
@@ -68,7 +68,7 @@ spec:
       - id: 0
         type: persistent-claim
         size: {{ .Values.persistenceKafka.size }}
-        deleteClaim: false
+        deleteClaim: true
         class: {{ include "common.storageClass" (dict "dot" . "suffix" "kafka" "persistenceInfos" .Values.persistenceKafka) }}
   zookeeper:
     template:
@@ -82,7 +82,7 @@ spec:
     storage:
       type: persistent-claim
       size: {{ .Values.persistenceZk.size }}
-      deleteClaim: false
+      deleteClaim: true
       class: {{ include "common.storageClass" (dict "dot" . "suffix" "zk" "persistenceInfos" .Values.persistenceZk) }}
   entityOperator:
     topicOperator: {}