Skip to content
Snippets Groups Projects
Commit 70677712 authored by Waleed Akbar's avatar Waleed Akbar
Browse files

changes to manage Kafka enviornment variable efficiently

- KFK_SERVER_PORT and KFK_REDOPLY added into my_deploy.sh file.
- refines kafka env variables import
parent bdcb5c01
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!255Resolve "KPI Management Enhancements"
......@@ -181,3 +181,8 @@ export GRAF_EXT_PORT_HTTP="3000"
# Set the namespace where Apache Kafka will be deployed.
export KFK_NAMESPACE="kafka"
# Set the port Apache Kafka server will be exposed to.
export KFK_SERVER_PORT="9092"
# Set the flag to YES for redeploying of Apache Kafka
export KFK_REDEPLOY=""
......@@ -23,11 +23,11 @@ LOGGER = logging.getLogger(__name__)
class KafkaConfig(Enum):
KFK_SERVER_ADDRESS_TEMPLATE = 'kafka-service.{:s}.svc.cluster.local:{:s}'
KFK_NAMESPACE = get_setting('KFK_NAMESPACE')
KFK_PORT = get_setting('KFK_SERVER_PORT')
# SERVER_ADDRESS = "127.0.0.1:9092"
KFK_NAMESPACE = get_setting('KFK_NAMESPACE')
KFK_PORT = get_setting('KFK_SERVER_PORT')
# SERVER_ADDRESS = "127.0.0.1:9092"
SERVER_ADDRESS = KFK_SERVER_ADDRESS_TEMPLATE.format(KFK_NAMESPACE, KFK_PORT)
ADMIN_CLIENT = AdminClient({'bootstrap.servers': SERVER_ADDRESS })
ADMIN_CLIENT = AdminClient({'bootstrap.servers': SERVER_ADDRESS })
class KafkaTopic(Enum):
REQUEST = 'topic_request'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment