Skip to content

Commit 3c7982b

Browse files
authored
Prepare for release v0.11.0 (#186)
ProductLine: KubeDB Release: v2025.6.30 Release-tracker: kubedb/CHANGELOG#114 Signed-off-by: 1gtm <1gtm@appscode.com>
1 parent cd33436 commit 3c7982b

19 files changed

+466
-21
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ require (
3737
k8s.io/klog/v2 v2.130.1
3838
kmodules.xyz/client-go v0.32.6
3939
kmodules.xyz/custom-resources v0.32.0
40-
kubedb.dev/apimachinery v0.55.1-0.20250630051705-117e2306d4e2
40+
kubedb.dev/apimachinery v0.56.0
4141
sigs.k8s.io/controller-runtime v0.20.4
4242
xorm.io/xorm v1.3.9
4343
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,8 @@ kmodules.xyz/monitoring-agent-api v0.32.0 h1:cMQbWvbTc4JWeLI/zYE0HLefsdFYBzqvATL
546546
kmodules.xyz/monitoring-agent-api v0.32.0/go.mod h1:zgRKiJcuK7FOHy0Y1TsONRbJfgnPCs8t4Zh/6Afr+yU=
547547
kmodules.xyz/offshoot-api v0.32.0 h1:gogc5scSZe2JoXtZof72UGRl3Tit0kFaFRMkLLT1D8o=
548548
kmodules.xyz/offshoot-api v0.32.0/go.mod h1:tled7OxYZ3SkUJcrVFVVYyd+zXjsRSEm1R6Q3k4gcx0=
549-
kubedb.dev/apimachinery v0.55.1-0.20250630051705-117e2306d4e2 h1:8qKjiiVduUTH14u5iu5Emg4sCf79NOo1ykOnXgbzWZU=
550-
kubedb.dev/apimachinery v0.55.1-0.20250630051705-117e2306d4e2/go.mod h1:iiqMOpMi8H4SZkD3vw5BS3V0t2UmIde4RnotjJ7VeNE=
549+
kubedb.dev/apimachinery v0.56.0 h1:3vOdnv03sQiDJ17w25gsu+1acAUB5PLq/1oBhEsLuno=
550+
kubedb.dev/apimachinery v0.56.0/go.mod h1:Iw40Vbo63tNqgQA5pTue0WHBvPaxWsJy6MEWfZmACQw=
551551
kubeops.dev/petset v0.0.10 h1:sNaqmHrD9bW7pcrWnwPoiQrKvdRwRX0BaRQc5QA78Bg=
552552
kubeops.dev/petset v0.0.10/go.mod h1:uHL83kggwmtSxdlIfxNbY2isV22iYV6YjADv0y+Z7YA=
553553
kubeops.dev/sidekick v0.0.11 h1:OydXdIH6cYSiWxKIWvrywk95WhhHSERkc7RNPOmTekc=

vendor/kubedb.dev/apimachinery/apis/kubedb/v1/openapi_generated.go

Lines changed: 71 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_types.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,35 @@ type RedisClusterSpec struct {
155155

156156
// Number of replica(s) per shard. If not specified, defaults to 2.
157157
Replicas *int32 `json:"replicas,omitempty"`
158+
159+
// Announce is used to announce the redis cluster endpoints.
160+
// It is used to set
161+
// cluster-announce-ip, cluster-announce-port, cluster-announce-bus-port, cluster-announce-tls-port
162+
// +optional
163+
Announce *Announce `json:"announce,omitempty"`
164+
}
165+
166+
// +kubebuilder:validation:Enum=ip;hostname
167+
type PreferredEndpointType string
168+
169+
const (
170+
PreferredEndpointTypeIP PreferredEndpointType = "ip"
171+
PreferredEndpointTypeHostname PreferredEndpointType = "hostname"
172+
)
173+
174+
type Announce struct {
175+
// +kubebuilder:default=hostname
176+
Type PreferredEndpointType `json:"type,omitempty"`
177+
// This field is used to set cluster-announce information for redis cluster of each shard.
178+
Shards []Shards `json:"shards,omitempty"`
179+
}
180+
181+
type Shards struct {
182+
// Endpoints contains the cluster-announce information for all the replicas in a shard.
183+
// This will be used to set cluster-announce-ip/hostname, cluster-announce-port/cluster-announce-tls-port
184+
// and cluster-announce-bus-port
185+
// format cluster-announce (host:port@busport)
186+
Endpoints []string `json:"endpoints,omitempty"`
158187
}
159188

160189
type RedisSentinelRef struct {

vendor/kubedb.dev/apimachinery/apis/kubedb/v1/zz_generated.deepcopy.go

Lines changed: 49 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/clickhouse_helpers.go

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ func (c *ClickHouse) OffshootLabels() map[string]string {
105105
return c.offshootLabels(c.OffshootSelectors(), nil)
106106
}
107107

108+
func (c *ClickHouse) OffshootDBLabels() map[string]string {
109+
return c.offshootLabels(c.OffshootDBSelectors(), nil)
110+
}
111+
108112
func (c *ClickHouse) ServiceLabels(alias ServiceAlias, extraLabels ...map[string]string) map[string]string {
109113
svcTemplate := GetServiceTemplate(c.Spec.ServiceTemplates, alias)
110114
return c.offshootLabels(meta_util.OverwriteKeys(c.OffshootSelectors(), extraLabels...), svcTemplate.Labels)
@@ -114,10 +118,6 @@ func (c *ClickHouse) OffshootKeeperLabels() map[string]string {
114118
return c.offshootKeeperLabels(c.OffshootKeeperSelectors(), nil)
115119
}
116120

117-
func (c *ClickHouse) OffshootClusterLabels(petSetName string) map[string]string {
118-
return c.offshootLabels(c.OffshootClusterSelectors(petSetName), nil)
119-
}
120-
121121
func (c *ClickHouse) offshootLabels(selector, override map[string]string) map[string]string {
122122
selector[meta_util.ComponentLabelKey] = kubedb.ComponentDatabase
123123
return meta_util.FilterKeys(kubedb.GroupName, selector, meta_util.OverwriteKeys(nil, c.Labels, override))
@@ -140,19 +140,20 @@ func (c *ClickHouse) OffshootSelectors(extraSelectors ...map[string]string) map[
140140

141141
func (c *ClickHouse) OffshootKeeperSelectors(extraSelectors ...map[string]string) map[string]string {
142142
selector := map[string]string{
143+
meta_util.ComponentLabelKey: kubedb.ComponentCoOrdinator,
143144
meta_util.NameLabelKey: c.ResourceFQN(),
144145
meta_util.InstanceLabelKey: c.Name,
145146
meta_util.ManagedByLabelKey: kubedb.GroupName,
146147
}
147148
return meta_util.OverwriteKeys(selector, extraSelectors...)
148149
}
149150

150-
func (c *ClickHouse) OffshootClusterSelectors(petSetName string, extraSelectors ...map[string]string) map[string]string {
151+
func (c *ClickHouse) OffshootDBSelectors(extraSelectors ...map[string]string) map[string]string {
151152
selector := map[string]string{
153+
meta_util.ComponentLabelKey: kubedb.ComponentDatabase,
152154
meta_util.NameLabelKey: c.ResourceFQN(),
153155
meta_util.InstanceLabelKey: c.Name,
154156
meta_util.ManagedByLabelKey: kubedb.GroupName,
155-
meta_util.PartOfLabelKey: petSetName,
156157
}
157158
return meta_util.OverwriteKeys(selector, extraSelectors...)
158159
}
@@ -233,11 +234,11 @@ func (c *ClickHouse) PodLabels(extraLabels ...map[string]string) map[string]stri
233234
}
234235

235236
func (c *ClickHouse) KeeperPodLabels(extraLabels ...map[string]string) map[string]string {
236-
return c.offshootLabels(meta_util.OverwriteKeys(c.OffshootKeeperSelectors(), extraLabels...), c.Spec.ClusterTopology.ClickHouseKeeper.Spec.PodTemplate.Labels)
237+
return c.offshootKeeperLabels(meta_util.OverwriteKeys(c.OffshootKeeperSelectors(), extraLabels...), c.Spec.ClusterTopology.ClickHouseKeeper.Spec.PodTemplate.Labels)
237238
}
238239

239-
func (c *ClickHouse) ClusterPodLabels(petSetName string, labels map[string]string, extraLabels ...map[string]string) map[string]string {
240-
return c.offshootLabels(meta_util.OverwriteKeys(c.OffshootClusterSelectors(petSetName), extraLabels...), labels)
240+
func (c *ClickHouse) DBPodLabels(labels map[string]string, extraLabels ...map[string]string) map[string]string {
241+
return c.offshootLabels(meta_util.OverwriteKeys(c.OffshootDBSelectors(), extraLabels...), labels)
241242
}
242243

243244
func (c *ClickHouse) GetConnectionScheme() string {
@@ -331,16 +332,20 @@ func (c *ClickHouse) SetDefaults(kc client.Client) {
331332
klog.Errorf("can't get the clickhouse version object %s for %s \n", err.Error(), c.Spec.Version)
332333
return
333334
}
334-
335-
if c.Spec.TLS != nil && c.Spec.TLS.ClientCACertificateRefs != nil {
336-
for i, secret := range c.Spec.TLS.ClientCACertificateRefs {
337-
if secret.Key == "" {
338-
c.Spec.TLS.ClientCACertificateRefs[i].Key = kubedb.CACert
339-
}
340-
if secret.Optional == nil {
341-
c.Spec.TLS.ClientCACertificateRefs[i].Optional = ptr.To(false)
335+
if c.Spec.TLS != nil {
336+
if c.Spec.TLS.ClientCACertificateRefs != nil {
337+
for i, secret := range c.Spec.TLS.ClientCACertificateRefs {
338+
if secret.Key == "" {
339+
c.Spec.TLS.ClientCACertificateRefs[i].Key = kubedb.CACert
340+
}
341+
if secret.Optional == nil {
342+
c.Spec.TLS.ClientCACertificateRefs[i].Optional = ptr.To(false)
343+
}
342344
}
343345
}
346+
if c.Spec.SSLVerificationMode == "" {
347+
c.Spec.SSLVerificationMode = SSLVerificationModeRelaxed
348+
}
344349
}
345350

346351
if c.Spec.ClusterTopology != nil {

0 commit comments

Comments
 (0)