This pull request introduces several changes to enhance the configuration and functionality of the AutoMQ operator. The key changes include adding a new NodePort field, integrating a new API endpoint to fetch node IPs, and updating the Kafka monitor script to use the new API endpoint.
Configuration Enhancements:
api/v1beta1/automq_types.go: Added a new NodePort field to the AutoMQSpec struct. ([api/v1beta1/automq_types.goR160-R161](diffhunk://#diff-8fb9499d797e9e6073eb594990a409c444112ce192f26acc4cb88e16bbc8c537R160-R161))
config/crd/bases/infra.cuisongliu.github.com_automqs.yaml: Updated the CRD to include the new NodePort field. ([config/crd/bases/infra.cuisongliu.github.com_automqs.yamlR600-R603](diffhunk://#diff-e3ffe2350b5eeb12838983f35561eb4882fe76f83687a6f0781f7f64b230f21fR600-R603))
API Integration:
cmd/main.go:
Imported necessary packages for the new API endpoint. ([cmd/main.goR21-R31](diffhunk://#diff-c444f711e9191b53952edb65bfd8c644419fc7695c62611dc0fb304b4fb197d6R21-R31))
Added environment variable checks and set up a new API endpoint using Gin to fetch node IPs. ([cmd/main.goR117-R159](diffhunk://#diff-c444f711e9191b53952edb65bfd8c644419fc7695c62611dc0fb304b4fb197d6R117-R159))
Modified the manager start function to use the new context. ([cmd/main.goL126-R170](diffhunk://#diff-c444f711e9191b53952edb65bfd8c644419fc7695c62611dc0fb304b4fb197d6L126-R170))
Script Updates:
defaults/up.sh: Updated the kafka_monitor_ip function to use the new API endpoint to retrieve node IPs and set the advertised.listeners property accordingly. ([defaults/up.shL189-R208](diffhunk://#diff-347cf2881e546936a79b979408aa53592a1abc1d110cabd2ac6ddde58232e4d8L189-R208))
This pull request introduces several changes to enhance the configuration and functionality of the AutoMQ operator. The key changes include adding a new
NodePort
field, integrating a new API endpoint to fetch node IPs, and updating the Kafka monitor script to use the new API endpoint.Configuration Enhancements:
api/v1beta1/automq_types.go
: Added a newNodePort
field to theAutoMQSpec
struct. ([api/v1beta1/automq_types.goR160-R161](diffhunk://#diff-8fb9499d797e9e6073eb594990a409c444112ce192f26acc4cb88e16bbc8c537R160-R161)
)config/crd/bases/infra.cuisongliu.github.com_automqs.yaml
: Updated the CRD to include the newNodePort
field. ([config/crd/bases/infra.cuisongliu.github.com_automqs.yamlR600-R603](diffhunk://#diff-e3ffe2350b5eeb12838983f35561eb4882fe76f83687a6f0781f7f64b230f21fR600-R603)
)API Integration:
cmd/main.go
:[cmd/main.goR21-R31](diffhunk://#diff-c444f711e9191b53952edb65bfd8c644419fc7695c62611dc0fb304b4fb197d6R21-R31)
)[cmd/main.goR117-R159](diffhunk://#diff-c444f711e9191b53952edb65bfd8c644419fc7695c62611dc0fb304b4fb197d6R117-R159)
)[cmd/main.goL126-R170](diffhunk://#diff-c444f711e9191b53952edb65bfd8c644419fc7695c62611dc0fb304b4fb197d6L126-R170)
)Script Updates:
defaults/up.sh
: Updated thekafka_monitor_ip
function to use the new API endpoint to retrieve node IPs and set theadvertised.listeners
property accordingly. ([defaults/up.shL189-R208](diffhunk://#diff-347cf2881e546936a79b979408aa53592a1abc1d110cabd2ac6ddde58232e4d8L189-R208)
)