Skip to content

Commit

Permalink
Prepare for release v0.47.0-rc.1 (#772)
Browse files Browse the repository at this point in the history
ProductLine: KubeDB

Release: v2024.7.11-rc.1

Release-tracker: kubedb/CHANGELOG#92

Signed-off-by: 1gtm <[email protected]>
  • Loading branch information
1gtm authored Jul 11, 2024
1 parent b4118de commit a0aab82
Show file tree
Hide file tree
Showing 148 changed files with 29,175 additions and 11,907 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ require (
kmodules.xyz/client-go v0.30.9
kmodules.xyz/custom-resources v0.30.0
kmodules.xyz/monitoring-agent-api v0.29.0
kubedb.dev/apimachinery v0.47.0-rc.0
kubedb.dev/db-client-go v0.2.0-rc.0
kubedb.dev/apimachinery v0.47.0-rc.1
kubedb.dev/db-client-go v0.2.0-rc.1
sigs.k8s.io/controller-runtime v0.18.4
sigs.k8s.io/yaml v1.4.0
stash.appscode.dev/apimachinery v0.34.0
Expand Down Expand Up @@ -135,14 +135,14 @@ require (
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.30.2 // indirect
k8s.io/kube-aggregator v0.30.2 // indirect
k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b // indirect
k8s.io/kube-openapi v0.0.0-20240703190633-0aa61b46e8c2 // indirect
k8s.io/metrics v0.30.2 // indirect
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect
kmodules.xyz/apiversion v0.2.0 // indirect
kmodules.xyz/objectstore-api v0.29.1 // indirect
kmodules.xyz/offshoot-api v0.29.4 // indirect
kmodules.xyz/offshoot-api v0.30.0 // indirect
kmodules.xyz/prober v0.29.0 // indirect
kmodules.xyz/resource-metadata v0.18.9 // indirect
kmodules.xyz/resource-metadata v0.18.10 // indirect
kubeops.dev/petset v0.0.6 // indirect
kubeops.dev/sidekick v0.0.7 // indirect
kubestash.dev/apimachinery v0.10.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,8 @@ k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-aggregator v0.30.2 h1:0+yk/ED6foCprY8VmkDPUhngjaAPKsNTXB/UrtvbIz0=
k8s.io/kube-aggregator v0.30.2/go.mod h1:EhqCfDdxysNWXk1wRL9SEHAdo1DKl6EULQagztkBcXE=
k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b h1:Q9xmGWBvOGd8UJyccgpYlLosk/JlfP3xQLNkQlHJeXw=
k8s.io/kube-openapi v0.0.0-20240620174524-b456828f718b/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc=
k8s.io/kube-openapi v0.0.0-20240703190633-0aa61b46e8c2 h1:T5TEV4a+pEjc+j9Xui3MGGeoDLIN6uzZrx8NYotFMgQ=
k8s.io/kube-openapi v0.0.0-20240703190633-0aa61b46e8c2/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc=
k8s.io/kubectl v0.29.0 h1:Oqi48gXjikDhrBF67AYuZRTcJV4lg2l42GmvsP7FmYI=
k8s.io/kubectl v0.29.0/go.mod h1:0jMjGWIcMIQzmUaMgAzhSELv5WtHo2a8pq67DtviAJs=
k8s.io/metrics v0.30.2 h1:zj4kIPTCfEbY0RHEogpA7QtlItU7xaO11+Gz1zVDxlc=
Expand All @@ -719,16 +719,16 @@ kmodules.xyz/monitoring-agent-api v0.29.0 h1:gpFl6OZrlMLb/ySMHdREI9EwGtnJ91oZBn9
kmodules.xyz/monitoring-agent-api v0.29.0/go.mod h1:iNbvaMTgVFOI5q2LJtGK91j4Dmjv4ZRiRdasGmWLKQI=
kmodules.xyz/objectstore-api v0.29.1 h1:uUsjf8KU0w4LYowSEOnl0AbHT3hsHIu1wNLHqGe1o6s=
kmodules.xyz/objectstore-api v0.29.1/go.mod h1:xG+5awH1SXYKxwN/+k1FEQvzixd5tgNqEN/1LEiB2FE=
kmodules.xyz/offshoot-api v0.29.4 h1:WQV2BIUIoVKKiqZNmZ4gAy367jEdwBhEl3dFCLZM1qA=
kmodules.xyz/offshoot-api v0.29.4/go.mod h1:e+NQ0s4gW/YTPWBWEfdISZcmk+tlTq8IjvP5SLdqvko=
kmodules.xyz/offshoot-api v0.30.0 h1:dq9F93pu4Q8rL9oTcCk+vGGy8vpS7RNt0GSwx7Bvhec=
kmodules.xyz/offshoot-api v0.30.0/go.mod h1:o9VoA3ImZMDBp3lpLb8+kc2d/KBxioRwCpaKDfLIyDw=
kmodules.xyz/prober v0.29.0 h1:Ex7m4F9rH7uWNNJlLgP63ROOM+nUATJkC2L5OQ7nwMg=
kmodules.xyz/prober v0.29.0/go.mod h1:UtK+HKyI1lFLEKX+HFLyOCVju6TO93zv3kwGpzqmKOo=
kmodules.xyz/resource-metadata v0.18.9 h1:W/39Blg0hCvZYl0rReDIPiOMQuMN//pKVqRjhWAUrKo=
kmodules.xyz/resource-metadata v0.18.9/go.mod h1:qqieeMPdwJIEyAVkGcgh7h9PZbZTLw4KNEkkqEh5EyA=
kubedb.dev/apimachinery v0.47.0-rc.0 h1:JWHjo4XJ44nrZy+rBzlK73yuXKnDviOu7VEwicQzKRA=
kubedb.dev/apimachinery v0.47.0-rc.0/go.mod h1:2mEFBi2aURLGNbMefYC7xUalF/JWK7a1RA0zWNDCdw8=
kubedb.dev/db-client-go v0.2.0-rc.0 h1:ItPPIxWXZ2QMmBr6Cux3+CqlbAkrrkaYaxtHoolNDFg=
kubedb.dev/db-client-go v0.2.0-rc.0/go.mod h1:auTBptZjJPK13nYVJ3WwReCJElZEx7VvXkRqBz2dA8I=
kmodules.xyz/resource-metadata v0.18.10 h1:B0DAMsJJBuSOGCKzptZvB8AWcbxzDdUm+3CIE7g9ftE=
kmodules.xyz/resource-metadata v0.18.10/go.mod h1:PXyZXif1b1QRpe0Pwr92OeOveptZricB0jLssCjsYTc=
kubedb.dev/apimachinery v0.47.0-rc.1 h1:5DXoahPbJ1n1Fowa+lv3xobTWRLzDDKGhJaNiWjV/tk=
kubedb.dev/apimachinery v0.47.0-rc.1/go.mod h1:AUV5sXVwo77ctiYyrFWsSrhkuvy5fru5baiX7xF6LBA=
kubedb.dev/db-client-go v0.2.0-rc.1 h1:EonjzXR56vlDQYAYXTiyr1/ntxdOx5ClpCZ7Vs5eUhU=
kubedb.dev/db-client-go v0.2.0-rc.1/go.mod h1:yvkeoYGXCt119xogPO30sj2J3PYLOh/e32NyLv+ZWDc=
kubeops.dev/petset v0.0.6 h1:0IbvxD9fadZfH+3iMZWzN6ZHsO0vX458JlioamwyPKQ=
kubeops.dev/petset v0.0.6/go.mod h1:A15vh0r979NsvL65DTIZKWsa/NoX9VapHBAEw1ZsdYI=
kubeops.dev/sidekick v0.0.7 h1:+rs9AXPsiHjq5pJpzmj+Cen7frPfdi5dK1A57eNh7GM=
Expand Down
50 changes: 50 additions & 0 deletions vendor/kmodules.xyz/offshoot-api/util/container.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
Copyright AppsCode Inc. and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package util

import (
core_util "kmodules.xyz/client-go/core/v1"
ofstv2 "kmodules.xyz/offshoot-api/api/v2"

core "k8s.io/api/core/v1"
)

// EnsureContainerExists ensures that given container either exits by default or
// it will create the container, then insert it to the podTemplate and return a pointer of that container
func EnsureContainerExists(podTemplate *ofstv2.PodTemplateSpec, containerName string) *core.Container {
container := core_util.GetContainerByName(podTemplate.Spec.Containers, containerName)
if container == nil {
container = &core.Container{
Name: containerName,
}
}
podTemplate.Spec.Containers = core_util.UpsertContainer(podTemplate.Spec.Containers, *container)
return core_util.GetContainerByName(podTemplate.Spec.Containers, containerName)
}

// EnsureInitContainerExists ensures that given initContainer either exits by default or
// it will create the initContainer, then insert it to the podTemplate and return a pointer of that initContainer
func EnsureInitContainerExists(podTemplate *ofstv2.PodTemplateSpec, containerName string) *core.Container {
container := core_util.GetContainerByName(podTemplate.Spec.InitContainers, containerName)
if container == nil {
container = &core.Container{
Name: containerName,
}
}
podTemplate.Spec.InitContainers = core_util.UpsertContainer(podTemplate.Spec.InitContainers, *container)
return core_util.GetContainerByName(podTemplate.Spec.InitContainers, containerName)
}
130 changes: 130 additions & 0 deletions vendor/kmodules.xyz/offshoot-api/util/runtime_settings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/*
Copyright AppsCode Inc. and Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package util

import (
"fmt"

core_util "kmodules.xyz/client-go/core/v1"
ofst "kmodules.xyz/offshoot-api/api/v1"

core "k8s.io/api/core/v1"
)

const (
NiceAdjustment = "NICE_ADJUSTMENT"
IONiceClass = "IONICE_CLASS"
IONiceClassData = "IONICE_CLASS_DATA"
)

func ApplyContainerRuntimeSettings(container core.Container, settings ofst.ContainerRuntimeSettings) core.Container {
if len(settings.Resources.Limits) > 0 {
container.Resources.Limits = settings.Resources.Limits
}
if len(settings.Resources.Limits) > 0 {
container.Resources.Requests = settings.Resources.Requests
}
if settings.LivenessProbe != nil {
container.LivenessProbe = settings.LivenessProbe
}
if settings.ReadinessProbe != nil {
container.ReadinessProbe = settings.ReadinessProbe
}
if settings.Lifecycle != nil {
container.Lifecycle = settings.Lifecycle
}
if settings.SecurityContext != nil {
container.SecurityContext = settings.SecurityContext
}
if len(settings.EnvFrom) > 0 {
container.EnvFrom = append(container.EnvFrom, settings.EnvFrom...)
}
if len(settings.Env) > 0 {
container.Env = core_util.UpsertEnvVars(container.Env, settings.Env...)
}
// set nice, ionice settings as env
if settings.Nice != nil && settings.Nice.Adjustment != nil {
container.Env = core_util.UpsertEnvVars(container.Env, core.EnvVar{
Name: NiceAdjustment,
Value: fmt.Sprint(*settings.Nice.Adjustment),
})
}
if settings.IONice != nil {
if settings.IONice.Class != nil {
container.Env = core_util.UpsertEnvVars(container.Env, core.EnvVar{
Name: IONiceClass,
Value: fmt.Sprint(*settings.IONice.Class),
})
}
if settings.IONice.ClassData != nil {
container.Env = core_util.UpsertEnvVars(container.Env, core.EnvVar{
Name: IONiceClassData,
Value: fmt.Sprint(*settings.IONice.ClassData),
})
}
}
return container
}

func ApplyPodRuntimeSettings(podSpec core.PodSpec, settings ofst.PodRuntimeSettings) core.PodSpec {
if settings.NodeSelector != nil && len(settings.NodeSelector) > 0 {
podSpec.NodeSelector = settings.NodeSelector
}
if settings.ServiceAccountName != "" {
podSpec.ServiceAccountName = settings.ServiceAccountName
}
if settings.AutomountServiceAccountToken != nil {
podSpec.AutomountServiceAccountToken = settings.AutomountServiceAccountToken
}
if settings.NodeName != "" {
podSpec.NodeName = settings.NodeName
}
if settings.SecurityContext != nil {
podSpec.SecurityContext = settings.SecurityContext
}
if len(settings.ImagePullSecrets) > 0 {
podSpec.ImagePullSecrets = core_util.MergeLocalObjectReferences(podSpec.ImagePullSecrets, settings.ImagePullSecrets)
}
if settings.Affinity != nil {
podSpec.Affinity = settings.Affinity
}
if settings.SchedulerName != "" {
podSpec.SchedulerName = settings.SchedulerName
}
if len(settings.Tolerations) > 0 {
podSpec.Tolerations = settings.Tolerations
}
if settings.PriorityClassName != "" {
podSpec.PriorityClassName = settings.PriorityClassName
}
if settings.Priority != nil {
podSpec.Priority = settings.Priority
}
if len(settings.ReadinessGates) > 0 {
podSpec.ReadinessGates = settings.ReadinessGates
}
if settings.RuntimeClassName != nil {
podSpec.RuntimeClassName = settings.RuntimeClassName
}
if settings.EnableServiceLinks != nil {
podSpec.EnableServiceLinks = settings.EnableServiceLinks
}
if settings.TopologySpreadConstraints != nil {
podSpec.TopologySpreadConstraints = settings.TopologySpreadConstraints
}
return podSpec
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,58 @@ spec:
description: 'Capacity represents the total resources of a node.
More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity'
type: object
controlPlane:
properties:
allocatable:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: Allocatable represents the resources of a node
that are available for scheduling. Defaults to Capacity.
type: object
capacity:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Capacity represents the total resources of a
node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity'
type: object
count:
type: integer
type: object
count:
type: integer
workers:
properties:
allocatable:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: Allocatable represents the resources of a node
that are available for scheduling. Defaults to Capacity.
type: object
capacity:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Capacity represents the total resources of a
node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity'
type: object
count:
type: integer
type: object
type: object
version:
description: 'Info contains versioning information. TODO: Add []string
Expand Down
Loading

0 comments on commit a0aab82

Please sign in to comment.