Skip to content

Commit

Permalink
rpk: Fix --any-port configuration for console
Browse files Browse the repository at this point in the history
We were using the incorrect port when
configuring the addresses in the Console
configuration file, it made using the
--any-port not possible with Redpanda Console.
  • Loading branch information
r-vasquez committed Jun 24, 2024
1 parent f62f934 commit 49f2160
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/go/rpk/pkg/cli/container/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,11 @@ Start a three-broker cluster:
Start a single-broker cluster, selecting random ports for every listener:
rpk container start --any-port
Start a three-broker cluster, selecting the seed kafka and console port only:
Start a three-broker cluster, selecting the seed Kafka and Redpanda Console
ports only:
rpk container start --kafka-ports 9092 --console-port 8080
Start a three-broker cluster, selecting every admin API port:
Start a three-broker cluster, selecting the Admin API port for each broker:
rpk container start --admin-ports 9644,9645,9646
`,
FParseErrWhitelist: cobra.FParseErrWhitelist{
Expand Down Expand Up @@ -322,9 +323,9 @@ func startCluster(
seedID,
nodeAddr(seedKafkaPort),
}
kafkaAddr := []string{fmt.Sprintf("%v:%d", seedState.ContainerIP, seedKafkaPort)}
srAddr := []string{fmt.Sprintf("http://rp-node-%d:%d", seedID, seedSchemaRegPort)}
adminAddr := []string{fmt.Sprintf("http://rp-node-%d:%d", seedID, seedAdminPort)}
kafkaAddr := []string{fmt.Sprintf("%v:%d", seedState.ContainerIP, config.DefaultKafkaPort)}
srAddr := []string{fmt.Sprintf("http://rp-node-%d:%d", seedID, config.DefaultSchemaRegPort)}
adminAddr := []string{fmt.Sprintf("http://rp-node-%d:%d", seedID, config.DefaultAdminPort)}

nodes := []node{seedNode}

Expand Down Expand Up @@ -374,9 +375,9 @@ func startCluster(
id: id,
addr: nodeAddr(state.HostKafkaPort),
})
kafkaAddr = append(kafkaAddr, fmt.Sprintf("%v:%d", state.ContainerIP, kafkaPort))
srAddr = append(srAddr, fmt.Sprintf("http://rp-node-%d:%d", id, schemaRegPort))
adminAddr = append(adminAddr, fmt.Sprintf("http://rp-node-%d:%d", id, adminPort))
kafkaAddr = append(kafkaAddr, fmt.Sprintf("%v:%d", state.ContainerIP, config.DefaultKafkaPort))
srAddr = append(srAddr, fmt.Sprintf("http://rp-node-%d:%d", id, config.DefaultSchemaRegPort))
adminAddr = append(adminAddr, fmt.Sprintf("http://rp-node-%d:%d", id, config.DefaultAdminPort))
mu.Unlock()
return nil
})
Expand Down

0 comments on commit 49f2160

Please sign in to comment.