diff options
Diffstat (limited to 'kubernetes/pomba/charts/pomba-contextaggregator')
6 files changed, 83 insertions, 23 deletions
diff --git a/kubernetes/pomba/charts/pomba-contextaggregator/resources/bin/pre_start.sh b/kubernetes/pomba/charts/pomba-contextaggregator/resources/bin/pre_start.sh new file mode 100644 index 0000000000..3ef1434f20 --- /dev/null +++ b/kubernetes/pomba/charts/pomba-contextaggregator/resources/bin/pre_start.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Get the list of topic from curl ressult +dmaap_mr_host=message-router +dmaap_mr_port=3904 +temp_output_file=".tmpoutput" +curl -X GET http://$dmaap_mr_host:$dmaap_mr_port/topics > $temp_output_file + +# Test topic POA-AUDIT-INIT, POA-AUDIT-RESULT, POA-RULE-VALIDATION +TOPICS="POA-AUDIT-INIT POA-RULE-VALIDATION POA-AUDIT-RESULT" +for i_topic in $TOPICS +do + echo "Looping ... topic: $i_topic" + if grep -iFq "$i_topic" $temp_output_file + then + # code if found + echo "$i_topic found." + else + # code if not found + echo "$i_topic NOT found." + curl -X POST -H "content-type: application/json" --data "Empty post to create topic" http://$dmaap_mr_host:$dmaap_mr_port/events/$i_topic + fi +done + +# remove the temp file +rm -f $temp_output_file diff --git a/kubernetes/pomba/charts/pomba-contextaggregator/resources/config/builders/aai.properties b/kubernetes/pomba/charts/pomba-contextaggregator/resources/config/builders/aai.properties index 7a119f9267..eab3864168 100755 --- a/kubernetes/pomba/charts/pomba-contextaggregator/resources/config/builders/aai.properties +++ b/kubernetes/pomba/charts/pomba-contextaggregator/resources/config/builders/aai.properties @@ -23,6 +23,6 @@ key.store.password=70c87528c88dcd9f9c2558d30e817868 key.store.type=PKCS12 key.manager.factory.algorithm=SunX509 security.protocol=TLS -connection.timeout.ms=15000 -read.timeout.ms=10000 +connection.timeout.ms=60000 +read.timeout.ms=60000 base.uri=/aaicontextbuilder/service/context diff --git a/kubernetes/pomba/charts/pomba-contextaggregator/resources/config/builders/sdc.properties b/kubernetes/pomba/charts/pomba-contextaggregator/resources/config/builders/sdc.properties index 80167d2257..9a27a6c8c8 100755 --- a/kubernetes/pomba/charts/pomba-contextaggregator/resources/config/builders/sdc.properties +++ b/kubernetes/pomba/charts/pomba-contextaggregator/resources/config/builders/sdc.properties @@ -22,6 +22,6 @@ key.store.password=70c87528c88dcd9f9c2558d30e817868 key.store.type=PKCS12 key.manager.factory.algorithm=SunX509 security.protocol=TLS -connection.timeout.ms=15000 -read.timeout.ms=10000 +connection.timeout.ms=60000 +read.timeout.ms=60000 base.uri=/sdccontextbuilder/service/context diff --git a/kubernetes/pomba/charts/pomba-contextaggregator/templates/configmap.yaml b/kubernetes/pomba/charts/pomba-contextaggregator/templates/configmap.yaml index 767b2407be..d5ce98e6f2 100755 --- a/kubernetes/pomba/charts/pomba-contextaggregator/templates/configmap.yaml +++ b/kubernetes/pomba/charts/pomba-contextaggregator/templates/configmap.yaml @@ -27,3 +27,11 @@ metadata: namespace: {{ include "common.namespace" . }} data: {{ tpl (.Files.Glob "resources/config/builders/*").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-pre-start-configmap + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/bin/*").AsConfig . | indent 2 }}
\ No newline at end of file diff --git a/kubernetes/pomba/charts/pomba-contextaggregator/templates/deployment.yaml b/kubernetes/pomba/charts/pomba-contextaggregator/templates/deployment.yaml index 44268db46e..52a28d012c 100755 --- a/kubernetes/pomba/charts/pomba-contextaggregator/templates/deployment.yaml +++ b/kubernetes/pomba/charts/pomba-contextaggregator/templates/deployment.yaml @@ -30,6 +30,21 @@ spec: app: {{ include "common.name" . }} release: {{ .Release.Name }} spec: + initContainers: + - command: + - /root/ready.py + args: + - --container-name + - message-router + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + name: {{ include "common.name" . }}-readiness containers: - name: {{ include "common.name" . }} image: "{{ include "common.repository" . }}/{{ .Values.image }}" @@ -63,6 +78,10 @@ spec: - mountPath: /opt/app/config/builders name: {{ include "common.fullname" . }}-config-builders readOnly: true + - mountPath: /opt/app/bin/pre_start.sh + name: {{ include "common.fullname" . }}-pre-start + subPath: pre_start.sh + readOnly: false resources: {{ include "common.resources" . | indent 12 }} {{- if .Values.nodeSelector }} @@ -83,5 +102,9 @@ spec: - name: {{ include "common.fullname" . }}-config-builders configMap: name: {{ include "common.fullname" . }}-configmap-builders + - name: {{ include "common.fullname" . }}-pre-start + configMap: + name: {{ include "common.fullname" . }}-pre-start-configmap + defaultMode: 0777 imagePullSecrets: - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/pomba/charts/pomba-contextaggregator/values.yaml b/kubernetes/pomba/charts/pomba-contextaggregator/values.yaml index 9535a7ebd5..9c9a6ff185 100755 --- a/kubernetes/pomba/charts/pomba-contextaggregator/values.yaml +++ b/kubernetes/pomba/charts/pomba-contextaggregator/values.yaml @@ -18,12 +18,14 @@ global: nodePortPrefix: 302 repository: nexus3.onap.org:10001 + readinessRepository: oomk8s + readinessImage: readiness-check:2.0.0 ################################################################# # Application configuration defaults. ################################################################# # application image -image: onap/pomba-context-aggregator:latest +image: onap/pomba-context-aggregator:1.3.2 pullPolicy: Always # flag to enable debugging - application support required @@ -83,21 +85,22 @@ service: ingress: enabled: false -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # - # Example: - # Configure resource requests and limits - # ref: http://kubernetes.io/docs/user-guide/compute-resources/ - # Minimum memory for development is 2 CPU cores and 4GB memory - # Minimum memory for production is 4 CPU cores and 8GB memory -#resources: -# limits: -# cpu: 2 -# memory: 4Gi -# requests: -# cpu: 2 -# memory: 4Gi +# Resource Limit flavor -By Default using small +flavor: small +# Segregation for Different environment (Small and Large) +resources: + small: + limits: + cpu: 1 + memory: 800Mi + requests: + cpu: 10m + memory: 400Mi + large: + limits: + cpu: 2 + memory: 1600Mi + requests: + cpu: 20m + memory: 800Mi + unlimited: {} |