cockroachdb / cockroachdb/cockroach-operator

Allow users to specify a suffix for `--advertise-host` argument

Open
#888 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
318
Forks
104
Avg merge
1d 6h
Merged PRs (30d)
1

Description

As found [here](https://github.com/cockroachdb/cockroach-operator/blob/c133bd007e0ee9e6a0bc25f408943c5200188b71/pkg/resource/statefulset.go#L361-L362) the `--advertise-host` argument is built based on the pod name, and the namespace. In our instance our nodes exist in different Kubernetes clusters, but have the same podnames and namespace. What makes our nodes uniquely identifiable is their FQDN (what cluster they're in).

I know it's not supported but would it make sense to have an option to specify a suffix for these names?

So the code would look something like
```go
suffix := ""
if b.Spec().AdvertiseSuffix != nil {
suffix = fmt.Sprintf(".%s", *b.Spec().AdvertiseSuffix)
}

...
fmt.Sprintf("--advertise-host=$(POD_NAME).%s.%s",
b.Cluster.DiscoveryServiceName(), b.Cluster.Namespace(), suffix)
```

Or something of the sort.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.