Skip to content

Support Kafka SASL/TLS in non-Clowder (on-prem) mode#47

Closed
ELK4N4 wants to merge 1 commit intoinsights-onprem:mainfrom
ELK4N4:feature/kafka-sasl-tls-support
Closed

Support Kafka SASL/TLS in non-Clowder (on-prem) mode#47
ELK4N4 wants to merge 1 commit intoinsights-onprem:mainfrom
ELK4N4:feature/kafka-sasl-tls-support

Conversation

@ELK4N4
Copy link

@ELK4N4 ELK4N4 commented Mar 3, 2026

Summary

  • Add mapstructure tags to Kafka security config fields so viper maps environment variables (KAFKA_SASL_USERNAME, KAFKA_SASL_PASSWORD, KAFKA_SASL_MECHANISM, KAFKA_SECURITY_PROTOCOL, KAFKA_SSL_CA_LOCATION) to the Config struct
  • Populate these via viper.SetDefault in the non-Clowder init branch
  • Update Clowder branch to use matching mapstructure key names for consistency

Context

The cost-onprem Helm chart (insights-onprem/cost-onprem-chart#118) injects these environment variables into ROS pods, but the non-Clowder config path previously ignored them. The consumer and producer code already supports SASL/TLS when KafkaSASLMechanism is non-empty — only the config wiring was missing.

Test plan

  • Verify Kafka consumer/producer connect with PLAINTEXT (default, no env vars set)
  • Verify Kafka consumer/producer connect with SASL_SSL when env vars are set
  • Verify existing Clowder mode is unaffected (mapstructure key rename)

Made with Cursor

Add mapstructure tags to Kafka security fields so viper maps
environment variables to config struct fields:
- KAFKA_SASL_USERNAME, KAFKA_SASL_PASSWORD, KAFKA_SASL_MECHANISM,
  KAFKA_SECURITY_PROTOCOL, KAFKA_SSL_CA_LOCATION

Populate these via viper.SetDefault in the non-Clowder init branch.
Update Clowder branch to use matching key names for consistency.

No changes needed in consumer.go or producer.go — they already
use SASL/TLS when cfg.KafkaSASLMechanism is non-empty.

Made-with: Cursor
@masayag
Copy link

masayag commented Mar 3, 2026

@ELK4N4 pls raise the PR against https://github.com/RedHatInsights/ros-ocp-backend

@ELK4N4 ELK4N4 closed this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants