Skip to content

Commit

Permalink
Remove --http-port and --port from the cockroach operator
Browse files Browse the repository at this point in the history
  • Loading branch information
prafull01 committed Oct 25, 2024
1 parent 1549702 commit ff902fd
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test/pkg:
# takes a bit of time.
.PHONY: test/verify
test/verify:
bazel test //hack/...
bazel test --test_timeout=1200 //hack/...

.PHONY: test/lint
test/lint:
Expand Down
4 changes: 2 additions & 2 deletions apis/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ type CrdbClusterSpec struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Cockroach Database Image"
// +optional
Image *PodImage `json:"image,omitempty"`
// (Optional) The database port (`--port` CLI parameter when starting the service)
// (Optional) The database port (`--listen-addr` CLI parameter when starting the service)
// Default: 26258
// +optional
GRPCPort *int32 `json:"grpcPort,omitempty"`
// (Optional) The web UI port (`--http-port` CLI parameter when starting the service)
// (Optional) The web UI port (`--http-addr` CLI parameter when starting the service)
// Default: 8080
// +optional
HTTPPort *int32 `json:"httpPort,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1086,12 +1086,12 @@ spec:
type: boolean
type: object
grpcPort:
description: '(Optional) The database port (`--port` CLI parameter
description: '(Optional) The database port (`--listen-addr` CLI parameter
when starting the service) Default: 26258'
format: int32
type: integer
httpPort:
description: '(Optional) The web UI port (`--http-port` CLI parameter
description: '(Optional) The web UI port (`--http-addr` CLI parameter
when starting the service) Default: 8080'
format: int32
type: integer
Expand Down
4 changes: 2 additions & 2 deletions hack/build/repos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5336,8 +5336,8 @@ def _go_dependencies():
build_file_generation = "on",
build_file_proto_mode = "disable",
importpath = "gopkg.in/yaml.v3",
sum = "h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=",
version = "v3.0.0-20210107192922-496545a6307b",
sum = "h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=",
version = "v3.0.0",
)
go_repository(
name = "io_etcd_go_bbolt",
Expand Down
4 changes: 2 additions & 2 deletions install/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1084,12 +1084,12 @@ spec:
type: boolean
type: object
grpcPort:
description: '(Optional) The database port (`--port` CLI parameter
description: '(Optional) The database port (`--listen-addr` CLI parameter
when starting the service) Default: 26258'
format: int32
type: integer
httpPort:
description: '(Optional) The web UI port (`--http-port` CLI parameter
description: '(Optional) The web UI port (`--http-addr` CLI parameter
when starting the service) Default: 8080'
format: int32
type: integer
Expand Down
2 changes: 1 addition & 1 deletion pkg/resource/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func (b StatefulSetBuilder) dbArgs() []string {
fmt.Sprintf("--advertise-host=$(POD_NAME).%s.%s",
b.Cluster.DiscoveryServiceName(), b.Cluster.Namespace()),
b.Cluster.SecureMode(),
"--http-port=" + fmt.Sprint(*b.Spec().HTTPPort),
"--http-addr=:" + fmt.Sprint(*b.Spec().HTTPPort),
"--sql-addr=:" + fmt.Sprint(*b.Spec().SQLPort),
"--listen-addr=:" + fmt.Sprint(*b.Spec().GRPCPort),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
- /bin/bash
- -ecx
- 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
--certs-dir=/cockroach/cockroach-certs/ --http-port=8080 --sql-addr=:26257
--certs-dir=/cockroach/cockroach-certs/ --http-addr=:8080 --sql-addr=:26257
--listen-addr=:26258 --log="{sinks: {stderr: {channels: [OPS, HEALTH], redact:
true}}}" --cache $(expr $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr
$MEMORY_LIMIT_MIB / 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
- /bin/bash
- -ecx
- 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
--insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
--insecure --http-addr=:8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
{stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache $(expr $MEMORY_LIMIT_MIB
/ 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258'
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
- /bin/bash
- -ecx
- 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
--certs-dir=/cockroach/cockroach-certs/ --http-port=8080 --sql-addr=:26257
--certs-dir=/cockroach/cockroach-certs/ --http-addr=:8080 --sql-addr=:26257
--listen-addr=:26258 --log="{sinks: {stderr: {channels: [OPS, HEALTH], redact:
true}}}" --cache $(expr $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr
$MEMORY_LIMIT_MIB / 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- /bin/bash
- -ecx
- 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
--insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
--insecure --http-addr=:8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
{stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB
--temp-dir=/tmp --join=test-cluster-0.test-cluster.test-ns:26258'
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
- /bin/bash
- -ecx
- 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
--insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
--insecure --http-addr=:8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
{stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB
--join=test-cluster-1.new-test-cluster.new-test-ns:26258'
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
- /bin/bash
- -ecx
- exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
--insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --logtostderr=INFO
--insecure --http-addr=:8080 --sql-addr=:26257 --listen-addr=:26258 --logtostderr=INFO
--cache $(expr $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB
/ 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258
env:
Expand Down
4 changes: 2 additions & 2 deletions pkg/scale/drainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (d *CockroachNodeDrainer) makeDrainStatusChecker(id uint) func(ctx context.

func (d *CockroachNodeDrainer) executeDrainCmd(ctx context.Context, id uint, gRPCPort int32) error {
cmd := []string{
"./cockroach", "node", "decommission", fmt.Sprintf("%d", id), "--wait=none", fmt.Sprintf("--port=%d", gRPCPort),
"./cockroach", "node", "decommission", fmt.Sprintf("%d", id), "--wait=none", fmt.Sprintf("--host=:%d", gRPCPort),
}

if d.Secure {
Expand All @@ -215,7 +215,7 @@ func (d *CockroachNodeDrainer) executeDrainCmd(ctx context.Context, id uint, gRP
// a node which will transition it from `decommissioning` to `decommissioned`. This should be executed
// after it's confirmed that there are 0 replicas on the node.
func (d *CockroachNodeDrainer) markNodeAsDecommissioned(ctx context.Context, id uint, gRPCPort int32) error {
cmd := []string{"./cockroach", "node", "decommission", fmt.Sprintf("%d", id), fmt.Sprintf("--port=%d", gRPCPort)}
cmd := []string{"./cockroach", "node", "decommission", fmt.Sprintf("%d", id), fmt.Sprintf("--host=:%d", gRPCPort)}

if d.Secure {
cmd = append(cmd, "--certs-dir=cockroach-certs")
Expand Down

0 comments on commit ff902fd

Please sign in to comment.