Function test updates
[nonrtric.git] / test / simulator-group / dmaapmr / app.yaml
index 2b39d15..3dc83e8 100644 (file)
+#  ============LICENSE_START=======================================================
+#  Copyright (C) 2020-2023 Nordix Foundation
+#  ================================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#
+#  SPDX-License-Identifier: Apache-2.0
+#  ============LICENSE_END=========================================================
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: $MR_DMAAP_KUBE_APP_NAME
+  name: $MR_ZOOKEEPER_APP_NAME
   namespace: $KUBE_ONAP_NAMESPACE
   labels:
-    run: $MR_DMAAP_KUBE_APP_NAME
+    run: $MR_ZOOKEEPER_APP_NAME
     autotest: DMAAPMR
 spec:
-  replicas: 1
   selector:
     matchLabels:
-      run: $MR_DMAAP_KUBE_APP_NAME
+      run: $MR_ZOOKEEPER_APP_NAME
   template:
     metadata:
       labels:
-        run: $MR_DMAAP_KUBE_APP_NAME
+        run: $MR_ZOOKEEPER_APP_NAME
         autotest: DMAAPMR
     spec:
       containers:
-      - name: $MR_DMAAP_KUBE_APP_NAME
-        image: $ONAP_DMAAPMR_IMAGE
+      - name: $MR_ZOOKEEPER_APP_NAME
+        image: $ONAP_ZOOKEEPER_IMAGE
         imagePullPolicy: $KUBE_IMAGE_PULL_POLICY
         ports:
         - name: http
-          containerPort: $MR_INTERNAL_PORT
-        - name: https
-          containerPort: $MR_INTERNAL_SECURE_PORT
+          containerPort: $MR_ZOOKEEPER_PORT
         env:
-        - name: enableCadi
-          value: 'false'
-        volumeMounts:
-        - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
-          subPath: MsgRtrApi.properties
-          name: dmaapmr-msg-rtr-api
-        volumeMounts:
-        - mountPath: /appl/dmaapMR1/bundleconfig/etc/logback.xml
-          subPath: logback.xml
-          name: dmaapmr-log-back
+        - name: ZOOKEEPER_REPLICAS
+          value: '1'
+        - name: ZOOKEEPER_TICK_TIME
+          value: '2000'
+        - name: ZOOKEEPER_SYNC_LIMIT
+          value: '5'
+        - name: ZOOKEEPER_INIT_LIMIT
+          value: '10'
+        - name: ZOOKEEPER_MAX_CLIENT_CNXNS
+          value: '200'
+        - name: ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT
+          value: '3'
+        - name: ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL
+          value: '24'
+        - name: ZOOKEEPER_CLIENT_PORT
+          value: '$MR_ZOOKEEPER_PORT'
+        - name: KAFKA_OPTS
+          value: '-Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl'
+        - name: ZOOKEEPER_SERVER_ID
+          value: '1'
         volumeMounts:
-        - mountPath: /appl/dmaapMR1/etc/cadi.properties
-          subPath: cadi.properties
-          name: dmaapmr-cadi
+        - mountPath: /etc/zookeeper/secrets/jaas/zk_server_jaas.conf
+          subPath: zk_server_jaas.conf
+          name: dmaapmr-zk-server-jaas
       volumes:
       - configMap:
           defaultMode: 420
-          name: dmaapmr-msgrtrapi.properties
-        name: dmaapmr-msg-rtr-api
-      - configMap:
-          defaultMode: 420
-          name: dmaapmr-logback.xml
-        name: dmaapmr-log-back
-      - configMap:
-          defaultMode: 420
-          name: dmaapmr-cadi.properties
-        name: dmaapmr-cadi
+          name: dmaapmr-zk-server-jaas.conf
+        name: dmaapmr-zk-server-jaas
 ---
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: $MR_KAFKA_BWDS_NAME
+  name: $MR_KAFKA_APP_NAME
   namespace: $KUBE_ONAP_NAMESPACE
   labels:
-    run: $MR_KAFKA_BWDS_NAME
+    run: $MR_KAFKA_APP_NAME
     autotest: DMAAPMR
 spec:
   replicas: 1
   selector:
     matchLabels:
-      run: $MR_KAFKA_BWDS_NAME
+      run: $MR_KAFKA_APP_NAME
   template:
     metadata:
       labels:
-        run: $MR_KAFKA_BWDS_NAME
+        run: $MR_KAFKA_APP_NAME
         autotest: DMAAPMR
     spec:
       containers:
-      - name: $MR_KAFKA_BWDS_NAME
+      - name: $MR_KAFKA_APP_NAME
         image: $ONAP_KAFKA_IMAGE
         imagePullPolicy: $KUBE_IMAGE_PULL_POLICY
         ports:
         - name: http
-          containerPort: 9095
+          containerPort: $MR_KAFKA_PORT
+        - name: http-external
+          containerPort: $MR_KAFKA_KUBE_NODE_PORT
         env:
         - name: enableCadi
           value: 'false'
         - name: KAFKA_ZOOKEEPER_CONNECT
-          value: 'zookeeper.onap:2181'
+          value: '$MR_ZOOKEEPER_APP_NAME:$MR_ZOOKEEPER_PORT'
         - name: KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS
           value: '40000'
         - name: KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS
           value: '40000'
         - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
-          value: 'INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT'
+          value: 'INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
         - name: KAFKA_ADVERTISED_LISTENERS
-          value: 'INTERNAL_PLAINTEXT://kaka:9092'
-#        - name: KAFKA_ADVERTISED_LISTENERS
-#          value: 'INTERNAL_PLAINTEXT://localhost:9092'
+          value: 'INTERNAL_PLAINTEXT://$MR_KAFKA_SERVICE_PATH,PLAINTEXT_HOST://localhost:$MR_KAFKA_KUBE_NODE_PORT'
         - name: KAFKA_LISTENERS
-          value: 'EXTERNAL_PLAINTEXT://0.0.0.0:9095,INTERNAL_PLAINTEXT://0.0.0.0:9092'
+          value: 'INTERNAL_PLAINTEXT://0.0.0.0:$MR_KAFKA_PORT,PLAINTEXT_HOST://0.0.0.0:$MR_KAFKA_KUBE_NODE_PORT'
         - name: KAFKA_INTER_BROKER_LISTENER_NAME
           value: INTERNAL_PLAINTEXT
         - name: KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE
@@ -110,11 +126,14 @@ spec:
           value: '1'
         - name: KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS
           value: '1'
-
         volumeMounts:
         - mountPath: /etc/kafka/secrets/jaas/zk_client_jaas.conf
           subPath: zk_client_jaas.conf
           name: dmaapmr-zk-client-jaas
+      initContainers:
+      - name: init-kafka
+        image: busybox
+        command: ['sh', '-c', 'until nslookup $MR_ZOOKEEPER_APP_NAME.$KUBE_ONAP_NAMESPACE.svc.cluster.local; do echo waiting for $MR_ZOOKEEPER_APP_NAME; sleep 2; done;']
       volumes:
       - configMap:
           defaultMode: 420
@@ -124,58 +143,59 @@ spec:
 apiVersion: apps/v1
 kind: Deployment
 metadata:
-  name: $MR_ZOOKEEPER_APP_NAME
+  name: $MR_DMAAP_APP_NAME
   namespace: $KUBE_ONAP_NAMESPACE
   labels:
-    run: $MR_ZOOKEEPER_APP_NAME
+    run: $MR_DMAAP_APP_NAME
     autotest: DMAAPMR
 spec:
   replicas: 1
   selector:
     matchLabels:
-      run: $MR_ZOOKEEPER_APP_NAME
+      run: $MR_DMAAP_APP_NAME
   template:
     metadata:
       labels:
-        run: $MR_ZOOKEEPER_APP_NAME
+        run: $MR_DMAAP_APP_NAME
         autotest: DMAAPMR
     spec:
       containers:
-      - name: $MR_ZOOKEEPER_APP_NAME
-        image: $ONAP_ZOOKEEPER_IMAGE
+      - name: $MR_DMAAP_APP_NAME
+        image: $ONAP_DMAAPMR_IMAGE
         imagePullPolicy: $KUBE_IMAGE_PULL_POLICY
         ports:
         - name: http
-          containerPort: 2181
+          containerPort: $MR_INTERNAL_PORT
+        - name: https
+          containerPort: $MR_INTERNAL_SECURE_PORT
         env:
-        - name: ZOOKEEPER_REPLICAS
-          value: '1'
-        - name: ZOOKEEPER_TICK_TIME
-          value: '2000'
-        - name: ZOOKEEPER_SYNC_LIMIT
-          value: '5'
-        - name: ZOOKEEPER_INIT_LIMIT
-          value: '10'
-        - name: ZOOKEEPER_MAX_CLIENT_CNXNS
-          value: '200'
-        - name: ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT
-          value: '3'
-        - name: ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL
-          value: '24'
-        - name: ZOOKEEPER_CLIENT_PORT
-          value: '2181'
-        - name: KAFKA_OPTS
-          value: '-Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl'
-        - name: ZOOKEEPER_SERVER_ID
-          value: '1'
-        - name: ZOOKEEPER_SASL_ENABLED
+        - name: enableCadi
           value: 'false'
         volumeMounts:
-        - mountPath: /etc/zookeeper/secrets/jaas/zk_server_jaas.conf
-          subPath: zk_server_jaas.conf
-          name: dmaapmr-zk-server-jaas
+        - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
+          subPath: MsgRtrApi.properties
+          name: dmaapmr-msg-rtr-api
+        - mountPath: /appl/dmaapMR1/bundleconfig/etc/logback.xml
+          subPath: logback.xml
+          name: dmaapmr-log-back
+        - mountPath: /appl/dmaapMR1/etc/cadi.properties
+          subPath: cadi.properties
+          name: dmaapmr-cadi
+      initContainers:
+      - name: init-dmaap-mr
+        image: busybox
+        command: ['sh', '-c', 'until nslookup $MR_KAFKA_APP_NAME.$KUBE_ONAP_NAMESPACE.svc.cluster.local; do echo waiting for $MR_KAFKA_APP_NAME; sleep 2; done;']
       volumes:
       - configMap:
           defaultMode: 420
-          name: dmaapmr-zk-server-jaas.conf
-        name: dmaapmr-zk-server-jaas
\ No newline at end of file
+          name: dmaapmr-msgrtrapi.properties
+        name: dmaapmr-msg-rtr-api
+      - configMap:
+          defaultMode: 420
+          name: dmaapmr-logback.xml
+        name: dmaapmr-log-back
+      - configMap:
+          defaultMode: 420
+          name: dmaapmr-cadi.properties
+        name: dmaapmr-cadi
+