Skip to content

Conversation

@odoucet
Copy link

@odoucet odoucet commented Dec 22, 2025

This PR solves #6 (comment)

The operator hardcoded cluster.local as the DNS suffix, breaking deployments in Kubernetes clusters using custom domains (e.g., kube.prod, k8s.mycorp.local). This caused DNS resolution failures in Sentinel and Valkey HA configurations.

Changes:

  • API (api/v1alpha1/types.go): Added optional ClusterDomain field to ValkeySpec with DNS-compliant validation pattern and default value cluster.local

  • Binding logic (pkg/operator/binding.go): Replaced hardcoded DNS suffix with valkey.Spec.ClusterDomain in service hostname construction for both sentinel and non-sentinel modes

  • Helm integration (pkg/operator/data/parameters.yaml): Passed clusterDomain parameter to Bitnami chart and updated TLS certificate DNS SANs to use configurable domain

  • Documentation: Added usage example and field description to README

Usage:

apiVersion: cache.cs.sap.com/v1alpha1
kind: Valkey
metadata:
  name: valkey-prod
spec:
  clusterDomain: kube.prod
  replicas: 3
  sentinel:
    enabled: true

Generates DNS names: valkey-prod.namespace.svc.kube.prod instead of cluster.local

Backward compatible—existing deployments continue using cluster.local by default.

Disclaimer : This PR was largely written with Copilot/Claude 4.5

@cla-assistant
Copy link

cla-assistant bot commented Dec 22, 2025

CLA assistant check
All committers have signed the CLA.

@odoucet
Copy link
Author

odoucet commented Dec 23, 2025

I've signed the CLA but it doesnt update.

@odoucet odoucet marked this pull request as draft January 6, 2026 14:03
…nvironments (#1)

* Initial plan

* Add configurable cluster domain support to API and binding

* Add custom cluster domain test and documentation

* Add example configuration for custom cluster domain
@odoucet odoucet marked this pull request as ready for review January 6, 2026 14:06
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