redpanda
redpanda copied to clipboard
bootstrap overwrites ports specified in redpanda.yaml
Version & Environment
22.2.x
What went wrong?
Steps to reproduce
- Edit
redpanda.yamlsuch thatredpanda.kafka_apiuses a nonstandard port (e.g., 9093) - Run
rpm redpanda config bootstrap --id 0 --self <ip> - Look at
redpanda.yaml, the Kafka API port will be set to the default (9092)
Relevant code: https://github.com/redpanda-data/redpanda/blob/319976aa32ad6b38616e239da83227d494e79e78/src/go/rpk/pkg/cli/cmd/redpanda/config.go#L138
I think bootstrap should just refuse to run if the file is already populated -- if the user gets here they're probably confused (they already have a config file, why are they running the command to create one?) and we should give them feedback to tell them "hey, this command doesn't do what you thought"
That's a good point, agree
This has a slightly tricky interaction with rpk redpanda config init; bumping this to 23.1 likely
Unfortunately, it seems like we have many defined flows of people first setting a few configuration values, and then bootstrapping the rest: https://github.com/redpanda-data/openmessaging-benchmark/blob/1c9b850ef2f278bef6b6ffcedeb48492abfdbbf9/driver-redpanda/deploy/deploy.yaml#L189-L212 https://github.com/redpanda-data/openmessaging-benchmark/blob/03de634041178d457267db45915f36fe6d1c16ec/driver-redpanda/deploy/certification/configure.base.sh.j2#L5-L27 https://github.com/redpanda-data/deployment-automation/blob/8579fdde423714696881c07dc1ee331652c31ffd/ansible/playbooks/start-redpanda.yml#L29-L39
Although it doesn't look like our documentation recommends this flow, I don't think we can change bootstrap to bail if non-defaults already exist.