Skip to content

Add hostAliases support for CrdbCluster pods#1147

Open
eXist-FraGGer wants to merge 1 commit intocockroachdb:masterfrom
eXist-FraGGer:master
Open

Add hostAliases support for CrdbCluster pods#1147
eXist-FraGGer wants to merge 1 commit intocockroachdb:masterfrom
eXist-FraGGer:master

Conversation

@eXist-FraGGer
Copy link
Copy Markdown

@eXist-FraGGer eXist-FraGGer commented Feb 27, 2026

CrdbCluster did not expose a way to configure pod-level hostAliases, so users could not inject custom /etc/hosts entries for CockroachDB pods via the operator API..

Checklist

  • adds spec.hostAliases to CrdbCluster API
  • propagates hostAliases to StatefulSet pod template
  • updates deepcopy for the new field
  • extends CRD schemas in config/crd/bases and install/crds.yaml
  • adds CSV spec descriptor for hostAliases
  • updates example templates with hostAliases snippet
  • adds StatefulSetBuilder golden test coverage for hostAliases

Use case:
Deployed in minikube istio+cockroach+keycloak and configure hosted local domain zone (e.g. pdnsutil zone).
The issue is to setup oauth2 at cockroach via keycloak (Own OIDC Provider):

You can not use internal address .svc.cluster.local because redirect url at browser will not resolve internal kubernetes address.
So you are using hosted local zone e.g. keycloak.dev.local, but it will be resolved to 127.0.0.1 - this is wrong and this is why we must have hostAliases to configure hostname keycloak.dev.local to istio ingress gateway cluster IP.

@cockroachlabs-cla-agent
Copy link
Copy Markdown

cockroachlabs-cla-agent bot commented Feb 27, 2026

CLA assistant check
All committers have signed the CLA.

@eXist-FraGGer
Copy link
Copy Markdown
Author

@udnay, @prafull11 Hello guys, let's review and discuss as it is very critical configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant