Skip to content

Commit a3078de

Browse files
committed
Remove --http-port and --port from the cockroach operator
1 parent ddb2b44 commit a3078de

22 files changed

+34
-23
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test/pkg:
5959
# takes a bit of time.
6060
.PHONY: test/verify
6161
test/verify:
62-
bazel test //hack/...
62+
bazel test --test_timeout=1200 //hack/...
6363

6464
.PHONY: test/lint
6565
test/lint:

apis/v1alpha1/cluster_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ type CrdbClusterSpec struct {
4040
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Cockroach Database Image"
4141
// +optional
4242
Image *PodImage `json:"image,omitempty"`
43-
// (Optional) The database port (`--port` CLI parameter when starting the service)
43+
// (Optional) The database port (`--listen-addr` CLI parameter when starting the service)
4444
// Default: 26258
4545
// +optional
4646
GRPCPort *int32 `json:"grpcPort,omitempty"`
47-
// (Optional) The web UI port (`--http-port` CLI parameter when starting the service)
47+
// (Optional) The web UI port (`--http-addr` CLI parameter when starting the service)
4848
// Default: 8080
4949
// +optional
5050
HTTPPort *int32 `json:"httpPort,omitempty"`

config/crd/bases/crdb.cockroachlabs.com_crdbclusters.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,12 +1086,12 @@ spec:
10861086
type: boolean
10871087
type: object
10881088
grpcPort:
1089-
description: '(Optional) The database port (`--port` CLI parameter
1089+
description: '(Optional) The database port (`--listen-addr` CLI parameter
10901090
when starting the service) Default: 26258'
10911091
format: int32
10921092
type: integer
10931093
httpPort:
1094-
description: '(Optional) The web UI port (`--http-port` CLI parameter
1094+
description: '(Optional) The web UI port (`--http-addr` CLI parameter
10951095
when starting the service) Default: 8080'
10961096
format: int32
10971097
type: integer

config/manager/patches/image.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,3 +328,5 @@ spec:
328328
value: cockroachdb/cockroach:v24.2.2
329329
- name: RELATED_IMAGE_COCKROACH_v24_2_3
330330
value: cockroachdb/cockroach:v24.2.3
331+
- name: RELATED_IMAGE_COCKROACH_v24_2_4
332+
value: cockroachdb/cockroach:v24.2.4

config/manifests/bases/cockroach-operator.clusterserviceversion.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,8 @@ spec:
501501
name: RELATED_IMAGE_COCKROACH_v24_2_2
502502
- image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:acc083f7dde1fbc557d858d03fc26b68b2056997fc1a457e4695650214d5b303
503503
name: RELATED_IMAGE_COCKROACH_v24_2_3
504+
- image: registry.connect.redhat.com/cockroachdb/cockroach@sha256:226d7f1c3f0d70ac6532ad9490bebcdef44a40959b6aa7c11b0f2d1383a46217
505+
name: RELATED_IMAGE_COCKROACH_v24_2_4
504506
- image: RH_COCKROACH_OP_IMAGE_PLACEHOLDER
505507
name: RELATED_IMAGE_COCKROACH_OPERATOR
506508
version: 0.0.0

config/manifests/patches/deployment_patch.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,6 @@ spec:
337337
value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:08cec123813304ab03bd66d72a09949667a874a42320bedafda391ebcdb2e56c
338338
- name: RELATED_IMAGE_COCKROACH_v24_2_3
339339
value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:acc083f7dde1fbc557d858d03fc26b68b2056997fc1a457e4695650214d5b303
340+
- name: RELATED_IMAGE_COCKROACH_v24_2_4
341+
value: registry.connect.redhat.com/cockroachdb/cockroach@sha256:226d7f1c3f0d70ac6532ad9490bebcdef44a40959b6aa7c11b0f2d1383a46217
340342
image: RH_COCKROACH_OP_IMAGE_PLACEHOLDER

config/samples/crdb-tls-example.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ kind: CrdbCluster
1919
metadata:
2020
name: crdb-tls-example
2121
spec:
22-
cockroachDBVersion: v24.2.3
22+
cockroachDBVersion: v24.2.4
2323
dataStore:
2424
pvc:
2525
spec:

crdb-versions.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,3 +475,6 @@ CrdbVersions:
475475
- image: cockroachdb/cockroach:v24.2.3
476476
redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:acc083f7dde1fbc557d858d03fc26b68b2056997fc1a457e4695650214d5b303
477477
tag: v24.2.3
478+
- image: cockroachdb/cockroach:v24.2.4
479+
redhatImage: registry.connect.redhat.com/cockroachdb/cockroach@sha256:226d7f1c3f0d70ac6532ad9490bebcdef44a40959b6aa7c11b0f2d1383a46217
480+
tag: v24.2.4

examples/client-secure-operator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
serviceAccountName: cockroachdb-sa
2424
containers:
2525
- name: cockroachdb-client-secure
26-
image: cockroachdb/cockroach:v24.2.3
26+
image: cockroachdb/cockroach:v24.2.4
2727
imagePullPolicy: IfNotPresent
2828
volumeMounts:
2929
- name: client-certs

examples/example.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ spec:
4040
memory: 8Gi
4141
tlsEnabled: true
4242
# You can set either a version of the db or a specific image name
43-
# cockroachDBVersion: v24.2.3
43+
# cockroachDBVersion: v24.2.4
4444
image:
45-
name: cockroachdb/cockroach:v24.2.3
45+
name: cockroachdb/cockroach:v24.2.4
4646
# nodes refers to the number of crdb pods that are created
4747
# via the statefulset
4848
nodes: 3

examples/smoketest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ spec:
3939
memory: 300Mi
4040
tlsEnabled: true
4141
image:
42-
name: cockroachdb/cockroach:v24.2.3
42+
name: cockroachdb/cockroach:v24.2.4
4343
nodes: 3

hack/build/repos.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5336,8 +5336,8 @@ def _go_dependencies():
53365336
build_file_generation = "on",
53375337
build_file_proto_mode = "disable",
53385338
importpath = "gopkg.in/yaml.v3",
5339-
sum = "h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=",
5340-
version = "v3.0.0-20210107192922-496545a6307b",
5339+
sum = "h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=",
5340+
version = "v3.0.0",
53415341
)
53425342
go_repository(
53435343
name = "io_etcd_go_bbolt",

install/crds.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,12 +1084,12 @@ spec:
10841084
type: boolean
10851085
type: object
10861086
grpcPort:
1087-
description: '(Optional) The database port (`--port` CLI parameter
1087+
description: '(Optional) The database port (`--listen-addr` CLI parameter
10881088
when starting the service) Default: 26258'
10891089
format: int32
10901090
type: integer
10911091
httpPort:
1092-
description: '(Optional) The web UI port (`--http-port` CLI parameter
1092+
description: '(Optional) The web UI port (`--http-addr` CLI parameter
10931093
when starting the service) Default: 8080'
10941094
format: int32
10951095
type: integer

install/operator.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,8 @@ spec:
686686
value: cockroachdb/cockroach:v24.2.2
687687
- name: RELATED_IMAGE_COCKROACH_v24_2_3
688688
value: cockroachdb/cockroach:v24.2.3
689+
- name: RELATED_IMAGE_COCKROACH_v24_2_4
690+
value: cockroachdb/cockroach:v24.2.4
689691
- name: OPERATOR_NAME
690692
value: cockroachdb
691693
- name: POD_NAME

pkg/resource/statefulset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ func (b StatefulSetBuilder) dbArgs() []string {
362362
fmt.Sprintf("--advertise-host=$(POD_NAME).%s.%s",
363363
b.Cluster.DiscoveryServiceName(), b.Cluster.Namespace()),
364364
b.Cluster.SecureMode(),
365-
"--http-port=" + fmt.Sprint(*b.Spec().HTTPPort),
365+
"--http-addr=:" + fmt.Sprint(*b.Spec().HTTPPort),
366366
"--sql-addr=:" + fmt.Sprint(*b.Spec().SQLPort),
367367
"--listen-addr=:" + fmt.Sprint(*b.Spec().GRPCPort),
368368
}

pkg/resource/testdata/TestStatefulSetBuilder/automount_sa.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
- /bin/bash
3232
- -ecx
3333
- 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
34-
--certs-dir=/cockroach/cockroach-certs/ --http-port=8080 --sql-addr=:26257
34+
--certs-dir=/cockroach/cockroach-certs/ --http-addr=:8080 --sql-addr=:26257
3535
--listen-addr=:26258 --log="{sinks: {stderr: {channels: [OPS, HEALTH], redact:
3636
true}}}" --cache $(expr $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr
3737
$MEMORY_LIMIT_MIB / 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258'

pkg/resource/testdata/TestStatefulSetBuilder/default_insecure_statefulset.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
- /bin/bash
3030
- -ecx
3131
- 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
32-
--insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
32+
--insecure --http-addr=:8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
3333
{stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache $(expr $MEMORY_LIMIT_MIB
3434
/ 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB / 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258'
3535
env:

pkg/resource/testdata/TestStatefulSetBuilder/default_secure.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
- /bin/bash
3232
- -ecx
3333
- 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
34-
--certs-dir=/cockroach/cockroach-certs/ --http-port=8080 --sql-addr=:26257
34+
--certs-dir=/cockroach/cockroach-certs/ --http-addr=:8080 --sql-addr=:26257
3535
--listen-addr=:26258 --log="{sinks: {stderr: {channels: [OPS, HEALTH], redact:
3636
true}}}" --cache $(expr $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr
3737
$MEMORY_LIMIT_MIB / 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258'

pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
- /bin/bash
4545
- -ecx
4646
- 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
47-
--insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
47+
--insecure --http-addr=:8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
4848
{stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB
4949
--temp-dir=/tmp --join=test-cluster-0.test-cluster.test-ns:26258'
5050
env:

pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_cli_args_with_join.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
- /bin/bash
4545
- -ecx
4646
- 'exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
47-
--insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
47+
--insecure --http-addr=:8080 --sql-addr=:26257 --listen-addr=:26258 --log="{sinks:
4848
{stderr: {channels: [OPS, HEALTH], redact: true}}}" --cache=30% --max-sql-memory=2GB
4949
--join=test-cluster-1.new-test-cluster.new-test-ns:26258'
5050
env:

pkg/resource/testdata/TestStatefulSetBuilder/insecure_statefulset_with_resources.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
- /bin/bash
3030
- -ecx
3131
- exec /cockroach/cockroach.sh start --advertise-host=$(POD_NAME).test-cluster.test-ns
32-
--insecure --http-port=8080 --sql-addr=:26257 --listen-addr=:26258 --logtostderr=INFO
32+
--insecure --http-addr=:8080 --sql-addr=:26257 --listen-addr=:26258 --logtostderr=INFO
3333
--cache $(expr $MEMORY_LIMIT_MIB / 4)MiB --max-sql-memory $(expr $MEMORY_LIMIT_MIB
3434
/ 4)MiB --join=test-cluster-0.test-cluster.test-ns:26258
3535
env:

pkg/scale/drainer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func (d *CockroachNodeDrainer) makeDrainStatusChecker(id uint) func(ctx context.
195195

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

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

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

0 commit comments

Comments
 (0)