Exposed external kafka port in test env
Port 30098 is exposed for docker on localhost
Port 30099 is exposed as nodeport for kube
Issue-ID: NONRTRIC-618
Signed-off-by: BjornMagnussonXA <bjorn.magnusson@est.tech>
Change-Id: I3b8c8f54691ba7d262bd0efa698ba09df1c883e0
diff --git a/test/simulator-group/dmaapmr/app.yaml b/test/simulator-group/dmaapmr/app.yaml
index 01c9014..1a9d40a 100644
--- a/test/simulator-group/dmaapmr/app.yaml
+++ b/test/simulator-group/dmaapmr/app.yaml
@@ -80,6 +80,8 @@
ports:
- name: http
containerPort: $MR_KAFKA_PORT
+ - name: http-external
+ containerPort: $MR_KAFKA_KUBE_NODE_PORT
env:
- name: enableCadi
value: 'false'
@@ -90,11 +92,11 @@
- 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://$MR_KAFKA_SERVICE_PATH'
+ value: 'INTERNAL_PLAINTEXT://$MR_KAFKA_SERVICE_PATH,PLAINTEXT_HOST://localhost:$MR_KAFKA_KUBE_NODE_PORT'
- name: KAFKA_LISTENERS
- value: 'INTERNAL_PLAINTEXT://0.0.0.0:$MR_KAFKA_PORT'
+ 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
diff --git a/test/simulator-group/dmaapmr/docker-compose.yml b/test/simulator-group/dmaapmr/docker-compose.yml
index c2c1fba..492fab1 100644
--- a/test/simulator-group/dmaapmr/docker-compose.yml
+++ b/test/simulator-group/dmaapmr/docker-compose.yml
@@ -50,14 +50,15 @@
container_name: $MR_KAFKA_APP_NAME
ports:
- "$MR_KAFKA_PORT:$MR_KAFKA_PORT"
+ - "$MR_KAFKA_DOCKER_LOCALHOST_PORT:$MR_KAFKA_DOCKER_LOCALHOST_PORT"
environment:
enableCadi: 'false'
KAFKA_ZOOKEEPER_CONNECT: $MR_ZOOKEEPER_APP_NAME:$MR_ZOOKEEPER_PORT
KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000
KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT
- KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://$MR_KAFKA_SERVICE_PATH
- KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:$MR_KAFKA_PORT
+ KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
+ KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://$MR_KAFKA_SERVICE_PATH,PLAINTEXT_HOST://localhost:$MR_KAFKA_DOCKER_LOCALHOST_PORT
+ KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:$MR_KAFKA_PORT,PLAINTEXT_HOST://0.0.0.0:$MR_KAFKA_DOCKER_LOCALHOST_PORT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT
KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false'
KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf
diff --git a/test/simulator-group/dmaapmr/svc.yaml b/test/simulator-group/dmaapmr/svc.yaml
index 446c59d..913b13e 100644
--- a/test/simulator-group/dmaapmr/svc.yaml
+++ b/test/simulator-group/dmaapmr/svc.yaml
@@ -25,12 +25,17 @@
run: $MR_KAFKA_APP_NAME
autotest: DMAAPMR
spec:
- type: ClusterIP
+ type: NodePort
ports:
- port: $MR_KAFKA_PORT
targetPort: $MR_KAFKA_PORT
protocol: TCP
name: http
+ - port: $MR_KAFKA_KUBE_NODE_PORT
+ targetPort: $MR_KAFKA_KUBE_NODE_PORT
+ protocol: TCP
+ name: http-external
+ nodePort: $MR_KAFKA_KUBE_NODE_PORT
selector:
run: $MR_KAFKA_APP_NAME
---