Skip to content

Commit

Permalink
Prepare for release v0.2.0-rc.1 (#121)
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 0190584 commit 57a5122
Show file tree
Hide file tree
Showing 127 changed files with 12,335 additions and 7,849 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
k8s.io/klog/v2 v2.130.1
kmodules.xyz/client-go v0.30.9
kmodules.xyz/custom-resources v0.30.0
kubedb.dev/apimachinery v0.47.0-rc.0
kubedb.dev/apimachinery v0.47.0-rc.1
sigs.k8s.io/controller-runtime v0.18.4
xorm.io/xorm v1.3.6
)
Expand Down Expand Up @@ -131,11 +131,11 @@ require (
k8s.io/apiextensions-apiserver v0.30.2 // indirect
k8s.io/client-go v0.30.2 // indirect
k8s.io/component-base 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/utils v0.0.0-20240502163921-fe8a2dddb1d0 // indirect
kmodules.xyz/apiversion v0.2.0 // indirect
kmodules.xyz/monitoring-agent-api v0.29.0 // indirect
kmodules.xyz/offshoot-api v0.29.4 // indirect
kmodules.xyz/offshoot-api v0.30.0 // indirect
kubeops.dev/petset v0.0.6 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/token v1.1.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -759,8 +759,8 @@ k8s.io/component-base v0.30.2 h1:pqGBczYoW1sno8q9ObExUqrYSKhtE5rW3y6gX88GZII=
k8s.io/component-base v0.30.2/go.mod h1:yQLkQDrkK8J6NtP+MGJOws+/PPeEXNpwFixsUI7h/OE=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
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/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak=
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk=
Expand All @@ -771,10 +771,10 @@ kmodules.xyz/custom-resources v0.30.0 h1:vR3CbseHMLwR4GvtcJJuRuwIV8voKqFqNii27rM
kmodules.xyz/custom-resources v0.30.0/go.mod h1:ZsTuI2mLG2s3byre7bHmpxJ9w0HDqAkRTL1+izGFI24=
kmodules.xyz/monitoring-agent-api v0.29.0 h1:gpFl6OZrlMLb/ySMHdREI9EwGtnJ91oZBn9H1UFRwB4=
kmodules.xyz/monitoring-agent-api v0.29.0/go.mod h1:iNbvaMTgVFOI5q2LJtGK91j4Dmjv4ZRiRdasGmWLKQI=
kmodules.xyz/offshoot-api v0.29.4 h1:WQV2BIUIoVKKiqZNmZ4gAy367jEdwBhEl3dFCLZM1qA=
kmodules.xyz/offshoot-api v0.29.4/go.mod h1:e+NQ0s4gW/YTPWBWEfdISZcmk+tlTq8IjvP5SLdqvko=
kubedb.dev/apimachinery v0.47.0-rc.0 h1:JWHjo4XJ44nrZy+rBzlK73yuXKnDviOu7VEwicQzKRA=
kubedb.dev/apimachinery v0.47.0-rc.0/go.mod h1:2mEFBi2aURLGNbMefYC7xUalF/JWK7a1RA0zWNDCdw8=
kmodules.xyz/offshoot-api v0.30.0 h1:dq9F93pu4Q8rL9oTcCk+vGGy8vpS7RNt0GSwx7Bvhec=
kmodules.xyz/offshoot-api v0.30.0/go.mod h1:o9VoA3ImZMDBp3lpLb8+kc2d/KBxioRwCpaKDfLIyDw=
kubedb.dev/apimachinery v0.47.0-rc.1 h1:5DXoahPbJ1n1Fowa+lv3xobTWRLzDDKGhJaNiWjV/tk=
kubedb.dev/apimachinery v0.47.0-rc.1/go.mod h1:AUV5sXVwo77ctiYyrFWsSrhkuvy5fru5baiX7xF6LBA=
kubeops.dev/petset v0.0.6 h1:0IbvxD9fadZfH+3iMZWzN6ZHsO0vX458JlioamwyPKQ=
kubeops.dev/petset v0.0.6/go.mod h1:A15vh0r979NsvL65DTIZKWsa/NoX9VapHBAEw1ZsdYI=
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
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 @@ -27,9 +27,6 @@ const (
ResourcePluralClickHouseVersion = "clickhouseversions"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// ClickHouseVersion defines a ClickHouse database version.

// +genclient
Expand Down Expand Up @@ -69,6 +66,9 @@ type ClickHouseVersionSpec struct {
// SecurityContext is for the additional config for the DB container
// +optional
SecurityContext SecurityContext `json:"securityContext"`

// +optional
UI []ChartInfo `json:"ui,omitempty"`
}

// ClickHouseVersionDatabase is the ClickHouse Database image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ type DruidVersionSpec struct {
// SecurityContext is for the additional security information for the Druid container
// +optional
SecurityContext SecurityContext `json:"securityContext"`
// +optional
UI []ChartInfo `json:"ui,omitempty"`
}

// DruidVersionDatabase is the Druid Database image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ type ElasticsearchVersionSpec struct {
UpdateConstraints UpdateConstraints `json:"updateConstraints,omitempty"`
// +optional
GitSyncer GitSyncer `json:"gitSyncer,omitempty"`
// +optional
UI []ChartInfo `json:"ui,omitempty"`
}

// ElasticsearchVersionDatabase is the Elasticsearch Database image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ type FerretDBVersionSpec struct {
// SecurityContext is for the additional security information for the FerretDB container
// +optional
SecurityContext SecurityContext `json:"securityContext"`

// +optional
UI []ChartInfo `json:"ui,omitempty"`
}

// FerretDBVersionDatabase is the FerretDB Database image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ type KafkaVersionSpec struct {
// SecurityContext is for the additional config for the DB container
// +optional
SecurityContext SecurityContext `json:"securityContext"`
// +optional
UI []ChartInfo `json:"ui,omitempty"`
}

// KafkaVersionDatabase is the Kafka Database image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ type MariaDBVersionSpec struct {
SecurityContext SecurityContext `json:"securityContext"`
// Archiver defines the walg & stash-addon related specifications
Archiver ArchiverSpec `json:"archiver,omitempty"`
// +optional
UI []ChartInfo `json:"ui,omitempty"`
}

// MariaDBVersionDatabase is the mariadb image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ type MemcachedVersionSpec struct {
// SecurityContext is for the additional config for the DB container
// +optional
SecurityContext SecurityContext `json:"securityContext"`
// +optional
UI []ChartInfo `json:"ui,omitempty"`
}

// MemcachedVersionDatabase is the Memcached Database image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ type MongoDBVersionSpec struct {
SecurityContext MongoDBSecurityContext `json:"securityContext"`
// Archiver defines the walg & kube-stash-addon related specifications
Archiver ArchiverSpec `json:"archiver,omitempty"`
// +optional
UI []ChartInfo `json:"ui,omitempty"`
}

// MongoDBVersionDatabase is the MongoDB Database image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ type MSSQLServerVersionSpec struct {
SecurityContext SecurityContext `json:"securityContext"`
// update constraints
UpdateConstraints UpdateConstraints `json:"updateConstraints,omitempty"`
// +optional
UI []ChartInfo `json:"ui,omitempty"`
}

// MSSQLServerDatabase is the MSSQLServer Database image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ type MySQLVersionSpec struct {
// SecurityContext is for the additional config for the DB container
// +optional
SecurityContext SecurityContext `json:"securityContext"`

// Archiver defines the walg & kube-stash-addon related specifications
Archiver ArchiverSpec `json:"archiver,omitempty"`
// +optional
UI []ChartInfo `json:"ui,omitempty"`
}

// MySQLVersionDatabase is the MySQL Database image
Expand Down
Loading

0 comments on commit 57a5122

Please sign in to comment.