Skip to content

Commit c79540d

Browse files
committed
RHINENG-22325: configure topic for Inventory Views
1 parent 506bc9a commit c79540d

5 files changed

Lines changed: 28 additions & 6 deletions

File tree

base/utils/config.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ type coreConfig struct {
6666
RemediationUpdateTopic string
6767
NotificationsTopic string
6868
TemplateTopic string
69+
InventoryViewsTopic string
6970

7071
// services
7172
VmaasAddress string
@@ -149,6 +150,11 @@ func initDBFromEnv() {
149150
}
150151

151152
func initKafkaFromEnv() {
153+
overrideKafkaAddress := Getenv("KAFKA_ADDRESS", "")
154+
if overrideKafkaAddress != "" {
155+
CoreCfg.KafkaAddress = overrideKafkaAddress
156+
CoreCfg.KafkaServers = []string{overrideKafkaAddress}
157+
}
152158
CoreCfg.KafkaSslCert = Getenv("KAFKA_SSL_CERT", CoreCfg.KafkaSslCert)
153159
CoreCfg.KafkaSslSkipVerify = GetBoolEnvOrDefault("KAFKA_SSL_SKIP_VERIFY", false)
154160
CoreCfg.KafkaUsername = Getenv("KAFKA_USERNAME", CoreCfg.KafkaUsername)
@@ -167,6 +173,7 @@ func initTopicsFromEnv() {
167173
CoreCfg.RemediationUpdateTopic = Getenv("REMEDIATIONS_UPDATE_TOPIC", "")
168174
CoreCfg.NotificationsTopic = Getenv("NOTIFICATIONS_TOPIC", "")
169175
CoreCfg.TemplateTopic = Getenv("TEMPLATE_TOPIC", "")
176+
CoreCfg.InventoryViewsTopic = Getenv("INVENTORY_VIEWS_TOPIC", "")
170177
}
171178

172179
func initServicesFromEnv() {
@@ -248,6 +255,7 @@ func initKafkaFromClowder() {
248255
translateTopic(&CoreCfg.RemediationUpdateTopic)
249256
translateTopic(&CoreCfg.NotificationsTopic)
250257
translateTopic(&CoreCfg.TemplateTopic)
258+
translateTopic(&CoreCfg.InventoryViewsTopic)
251259
}
252260
}
253261

@@ -399,6 +407,7 @@ func printKafkaParams() {
399407
fmt.Printf("REMEDIATIONS_UPDATE_TOPIC=%s\n", CoreCfg.RemediationUpdateTopic)
400408
fmt.Printf("NOTIFICATIONS_TOPIC=%s\n", CoreCfg.NotificationsTopic)
401409
fmt.Printf("TEMPLATE_TOPIC=%s\n", CoreCfg.TemplateTopic)
410+
fmt.Printf("INVENTORY_VIEWS_TOPIC=%s\n", CoreCfg.InventoryViewsTopic)
402411
}
403412

404413
func printServicesParams() {

conf/common.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ NOTIFICATIONS_TOPIC=platform.notifications.ingress
1717
PAYLOAD_TRACKER_TOPIC=platform.payload-status
1818
REMEDIATIONS_UPDATE_TOPIC=platform.remediation-updates.patch
1919
TEMPLATE_TOPIC=platform.content-sources.template
20+
INVENTORY_VIEWS_TOPIC=platform.inventory.host-apps
2021

2122
# If vmaas is running locally, its available here
2223
#VMAAS_ADDRESS=http://vmaas_webapp:8080

conf/local.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ DB_SSLROOTCERT=dev/database/secrets/pgca.crt
1616
VMAAS_ADDRESS=http://localhost:9001
1717
CANDLEPIN_ADDRESS=http://localhost:9001/candlepin
1818

19-
#KAFKA_ADDRESS=localhost:29092
19+
KAFKA_ADDRESS=localhost:9092
2020
KAFKA_GROUP=patchman
2121
KAFKA_SSL_CERT=dev/kafka/secrets/ca.crt
2222
PAYLOAD_TRACKER_TOPIC=platform.payload-status
2323
EVENTS_TOPIC=platform.inventory.events
2424
EVAL_TOPIC=patchman.evaluator.user-evaluation
2525
TEMPLATE_TOPIC=platform.content-sources.template
26+
INVENTORY_VIEWS_TOPIC=platform.inventory.host-apps
2627

2728
RBAC_ADDRESS=http://localhost:9001
2829

deploy/clowdapp.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ objects:
205205
- {name: PAYLOAD_TRACKER_TOPIC, value: platform.payload-status}
206206
- {name: REMEDIATIONS_UPDATE_TOPIC, value: 'platform.remediation-updates.patch'}
207207
- {name: NOTIFICATIONS_TOPIC, value: 'platform.notifications.ingress'}
208+
- {name: INVENTORY_VIEWS_TOPIC, value: '${INVENTORY_VIEWS_TOPIC}'}
208209
- {name: SSL_CERT_DIR, value: '${SSL_CERT_DIR}'}
209210
- {name: GOGC, value: '${GOGC}'} # set garbage collection limit for go 1.18
210211
- {name: ENABLE_PROFILER, value: '${ENABLE_PROFILER_EVALUATOR_UPLOAD}'}
@@ -251,6 +252,7 @@ objects:
251252
- {name: PAYLOAD_TRACKER_TOPIC, value: platform.payload-status}
252253
- {name: REMEDIATIONS_UPDATE_TOPIC, value: 'platform.remediation-updates.patch'}
253254
- {name: NOTIFICATIONS_TOPIC, value: 'platform.notifications.ingress'}
255+
- {name: INVENTORY_VIEWS_TOPIC, value: '${INVENTORY_VIEWS_TOPIC}'}
254256
- {name: SSL_CERT_DIR, value: '${SSL_CERT_DIR}'}
255257
- {name: GOGC, value: '${GOGC}'} # set garbage collection limit for go 1.18
256258
- {name: ENABLE_PROFILER, value: '${ENABLE_PROFILER_EVALUATOR_RECALC}'}
@@ -297,6 +299,7 @@ objects:
297299
- {name: PAYLOAD_TRACKER_TOPIC, value: platform.payload-status}
298300
- {name: REMEDIATIONS_UPDATE_TOPIC, value: 'platform.remediation-updates.patch'}
299301
- {name: NOTIFICATIONS_TOPIC, value: 'platform.notifications.ingress'}
302+
- {name: INVENTORY_VIEWS_TOPIC, value: '${INVENTORY_VIEWS_TOPIC}'}
300303
- {name: SSL_CERT_DIR, value: '${SSL_CERT_DIR}'}
301304
- {name: GOGC, value: '${GOGC}'} # set garbage collection limit for go 1.18
302305
- {name: ENABLE_PROFILER, value: '${ENABLE_PROFILER_EVALUATOR_USER_EVALUATION}'}
@@ -518,6 +521,7 @@ objects:
518521

519522
kafkaTopics:
520523
- {replicas: 3, partitions: 10, topicName: platform.inventory.events}
524+
- {replicas: 3, partitions: 10, topicName: platform.inventory.host-apps}
521525
- {replicas: 3, partitions: 10, topicName: patchman.evaluator.upload}
522526
- {replicas: 3, partitions: 10, topicName: patchman.evaluator.recalc}
523527
- {replicas: 3, partitions: 8, topicName: platform.payload-status}
@@ -702,6 +706,7 @@ parameters:
702706
- {name: GOGC, value: '100'}
703707
- {name: GOMEMLIMIT_EVALUATOR, value: '2700MiB'} # set to 90% of the default memory limit (don't forget `B`)
704708
- {name: CONSOLEDOT_HOSTNAME, value: localhost}
709+
- {name: INVENTORY_VIEWS_TOPIC, value: 'platform.inventory.host-apps'}
705710

706711
# Evaluator - upload
707712
- {name: REPLICAS_EVALUATOR_UPLOAD, value: '1'}

dev/kafka/setup.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
sleep 5
55

66
# create topics with multiple partitions for scaling
7-
for topic in "platform.inventory.events" "patchman.evaluator.upload" \
8-
"patchman.evaluator.recalc" "platform.remediation-updates.patch" "platform.notifications.ingress" \
9-
"platform.payload-status" "test" \
10-
"platform.content-sources.template" \
11-
"patchman.evaluator.user-evaluation"
7+
for topic in \
8+
"patchman.evaluator.recalc" \
9+
"patchman.evaluator.upload" \
10+
"patchman.evaluator.user-evaluation" \
11+
"platform.content-sources.template" \
12+
"platform.inventory.events" \
13+
"platform.inventory.host-apps" \
14+
"platform.notifications.ingress" \
15+
"platform.payload-status" \
16+
"platform.remediation-updates.patch" \
17+
"test"
1218
do
1319
until /opt/kafka/bin/kafka-topics.sh --create --if-not-exists --topic $topic \
1420
--partitions 1 --bootstrap-server kafka:9092 --replication-factor 1; do

0 commit comments

Comments
 (0)