Skip to content

Commit

Permalink
Prepare for release v0.16.0 (#578)
Browse files Browse the repository at this point in the history
ProductLine: KubeDB

Release: v2021.01.14

Release-tracker: kubedb/CHANGELOG#29
Signed-off-by: 1gtm <1gtm@appscode.com>
  • Loading branch information
1gtm committed Jan 14, 2021
1 parent 4e216d5 commit 82be6c3
Show file tree
Hide file tree
Showing 24 changed files with 340 additions and 331 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -19,7 +19,7 @@ require (
kmodules.xyz/custom-resources v0.0.0-20201124062543-bd8d35c21b0c
kmodules.xyz/monitoring-agent-api v0.0.0-20201105074044-be7a1044891a
kmodules.xyz/objectstore-api v0.0.0-20201105133858-cbb2af88d50a
kubedb.dev/apimachinery v0.16.0-rc.0.0.20210106185329-7a3dd5ee0094
kubedb.dev/apimachinery v0.16.0
stash.appscode.dev/apimachinery v0.11.8
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -1398,8 +1398,8 @@ kmodules.xyz/openshift v0.0.0-20201105073146-0da509a7d39f/go.mod h1:vFwB/f5rVH5Q
kmodules.xyz/prober v0.0.0-20201105074402-a243b3a27fd8 h1:UJb5lHQVFKbmlgmRLq5IWJGtz3JqYYbyVG+dNdjC9Cc=
kmodules.xyz/prober v0.0.0-20201105074402-a243b3a27fd8/go.mod h1:2eN8X5Wq7/AAgE5AWMAX8T0lE51HZiYEldG2RQuouX4=
kmodules.xyz/webhook-runtime v0.0.0-20201105073856-2dc7382b88c6/go.mod h1:xLgewoOzwR5ZrVOHQ2SR0P4E7tgCyBWbYlUawEXgeF4=
kubedb.dev/apimachinery v0.16.0-rc.0.0.20210106185329-7a3dd5ee0094 h1:nLZ5i2Z1gTDQdU5ScjiBtb+wZon5nDyy9jXm0uVoDUQ=
kubedb.dev/apimachinery v0.16.0-rc.0.0.20210106185329-7a3dd5ee0094/go.mod h1:jfH9wMWLd+rgDagKSFegJ1OJE8FU3V3rc+0dBCdi1sk=
kubedb.dev/apimachinery v0.16.0 h1:nUNepbAHOZ1llU0PtXemSGHNUIPFcbCdoc8xh3fDudA=
kubedb.dev/apimachinery v0.16.0/go.mod h1:jfH9wMWLd+rgDagKSFegJ1OJE8FU3V3rc+0dBCdi1sk=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
Expand Down
46 changes: 39 additions & 7 deletions vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/constants.go
Expand Up @@ -68,9 +68,9 @@ const (
ElasticsearchTransportPort = 9300
ElasticsearchTransportPortName = "transport"
ElasticsearchMetricsPort = 9600
ElasticsearchIngestNodePrefix = "ingest"
ElasticsearchDataNodePrefix = "data"
ElasticsearchMasterNodePrefix = "master"
ElasticsearchIngestNodeSuffix = "ingest"
ElasticsearchDataNodeSuffix = "data"
ElasticsearchMasterNodeSuffix = "master"
ElasticsearchNodeRoleMaster = kubedb.GroupName + "/" + "role-master"
ElasticsearchNodeRoleIngest = kubedb.GroupName + "/" + "role-ingest"
ElasticsearchNodeRoleData = kubedb.GroupName + "/" + "role-data"
Expand Down Expand Up @@ -112,15 +112,47 @@ const (
MongoDBDatabasePortName = "db"
MongoDBPrimaryServicePortName = "primary"
MongoDBDatabasePort = 27017
MongoDBKeyFileSecretSuffix = "key"
MongoDBKeyFileSecretSuffix = "-key"
MongoDBRootUsername = "root"
MongoDBCustomConfigFile = "mongod.conf"
NodeTypeMongos = "mongos"
NodeTypeShard = "shard"
NodeTypeConfig = "configsvr"

ConfigDirectoryPath = "/data/configdb"
InitialConfigDirectoryPath = "/configdb-readonly"
MongoDBWorkDirectoryName = "workdir"
MongoDBWorkDirectoryPath = "/work-dir"

MongoDBCertDirectoryName = "certdir"

MongoDBDataDirectoryName = "datadir"
MongoDBDataDirectoryPath = "/data/db"

MongoDBInitInstallContainerName = "copy-config"
MongoDBInitBootstrapContainerName = "bootstrap"

MongoDBConfigDirectoryName = "configdir"
MongoDBConfigDirectoryPath = "/data/configdb"
MongoDBInitialConfigDirectoryPath = "/configdb-readonly"

MongoDBInitScriptDirectoryName = "init-scripts"
MongoDBInitScriptDirectoryPath = "/init-scripts"

MongoDBClientCertDirectoryName = "client-cert"
MongoDBClientCertDirectoryPath = "/client-cert"

MongoDBServerCertDirectoryName = "server-cert"
MongoDBServerCertDirectoryPath = "/server-cert"

MongoDBInitialKeyDirectoryName = "keydir"
MongoDBInitialKeyDirectoryPath = "/keydir-readonly"

MongoDBContainerName = ResourceSingularMongoDB

MongoDBDefaultVolumeClaimTemplateName = MongoDBDataDirectoryName

MongodbUser = "root"
MongoDBKeyForKeyFile = "key.txt"
MongoDBAuthSecretSuffix = "-auth"

// =========================== MySQL Constants ============================
MySQLMetricsExporterConfigSecretSuffix = "metrics-exporter-config"
Expand Down Expand Up @@ -255,7 +287,7 @@ const (
)

var (
defaultResourceLimits = core.ResourceList{
DefaultResourceLimits = core.ResourceList{
core.ResourceCPU: resource.MustParse(".500"),
core.ResourceMemory: resource.MustParse("1024Mi"),
}
Expand Down
Expand Up @@ -183,24 +183,24 @@ func (e *Elasticsearch) CombinedStatefulSetName() string {
}

func (e *Elasticsearch) MasterStatefulSetName() string {
if e.Spec.Topology.Master.Prefix != "" {
return fmt.Sprintf("%s-%s", e.Spec.Topology.Master.Prefix, e.OffshootName())
if e.Spec.Topology.Master.Suffix != "" {
return meta_util.NameWithSuffix(e.OffshootName(), e.Spec.Topology.Master.Suffix)
}
return fmt.Sprintf("%s-%s", ElasticsearchMasterNodePrefix, e.OffshootName())
return meta_util.NameWithSuffix(e.OffshootName(), ElasticsearchMasterNodeSuffix)
}

func (e *Elasticsearch) DataStatefulSetName() string {
if e.Spec.Topology.Data.Prefix != "" {
return fmt.Sprintf("%s-%s", e.Spec.Topology.Data.Prefix, e.OffshootName())
if e.Spec.Topology.Data.Suffix != "" {
return meta_util.NameWithSuffix(e.OffshootName(), e.Spec.Topology.Data.Suffix)
}
return fmt.Sprintf("%s-%s", ElasticsearchDataNodePrefix, e.OffshootName())
return meta_util.NameWithSuffix(e.OffshootName(), ElasticsearchDataNodeSuffix)
}

func (e *Elasticsearch) IngestStatefulSetName() string {
if e.Spec.Topology.Ingest.Prefix != "" {
return fmt.Sprintf("%s-%s", e.Spec.Topology.Ingest.Prefix, e.OffshootName())
if e.Spec.Topology.Ingest.Suffix != "" {
return meta_util.NameWithSuffix(e.OffshootName(), e.Spec.Topology.Ingest.Suffix)
}
return fmt.Sprintf("%s-%s", ElasticsearchIngestNodePrefix, e.OffshootName())
return meta_util.NameWithSuffix(e.OffshootName(), ElasticsearchIngestNodeSuffix)
}

type elasticsearchApp struct {
Expand Down Expand Up @@ -296,24 +296,24 @@ func (e *Elasticsearch) SetDefaults(esVersion *v1alpha1.ElasticsearchVersion, to
if e.Spec.Topology != nil {

// Default to "ingest"
if e.Spec.Topology.Ingest.Prefix == "" {
e.Spec.Topology.Ingest.Prefix = ElasticsearchIngestNodePrefix
if e.Spec.Topology.Ingest.Suffix == "" {
e.Spec.Topology.Ingest.Suffix = ElasticsearchIngestNodeSuffix
}
setDefaultResourceLimits(&e.Spec.Topology.Ingest.Resources, defaultResourceLimits, defaultResourceLimits)
SetDefaultResourceLimits(&e.Spec.Topology.Ingest.Resources, DefaultResourceLimits)

// Default to "data"
if e.Spec.Topology.Data.Prefix == "" {
e.Spec.Topology.Data.Prefix = ElasticsearchDataNodePrefix
if e.Spec.Topology.Data.Suffix == "" {
e.Spec.Topology.Data.Suffix = ElasticsearchDataNodeSuffix
}
setDefaultResourceLimits(&e.Spec.Topology.Data.Resources, defaultResourceLimits, defaultResourceLimits)
SetDefaultResourceLimits(&e.Spec.Topology.Data.Resources, DefaultResourceLimits)

// Default to "master"
if e.Spec.Topology.Master.Prefix == "" {
e.Spec.Topology.Master.Prefix = ElasticsearchMasterNodePrefix
if e.Spec.Topology.Master.Suffix == "" {
e.Spec.Topology.Master.Suffix = ElasticsearchMasterNodeSuffix
}
setDefaultResourceLimits(&e.Spec.Topology.Master.Resources, defaultResourceLimits, defaultResourceLimits)
SetDefaultResourceLimits(&e.Spec.Topology.Master.Resources, DefaultResourceLimits)
} else {
setDefaultResourceLimits(&e.Spec.PodTemplate.Spec.Resources, defaultResourceLimits, defaultResourceLimits)
SetDefaultResourceLimits(&e.Spec.PodTemplate.Spec.Resources, DefaultResourceLimits)
}

// set default kernel settings
Expand Down
Expand Up @@ -150,7 +150,7 @@ type ElasticsearchClusterTopology struct {
type ElasticsearchNode struct {
// Replicas represents number of replica for this specific type of node
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`
Prefix string `json:"prefix,omitempty" protobuf:"bytes,2,opt,name=prefix"`
Suffix string `json:"suffix,omitempty" protobuf:"bytes,2,opt,name=suffix"`
// Storage to specify how storage shall be used.
Storage *core.PersistentVolumeClaimSpec `json:"storage,omitempty" protobuf:"bytes,3,opt,name=storage"`
// Compute Resources required by the sidecar container.
Expand Down
Expand Up @@ -155,7 +155,7 @@ func (e *Etcd) SetDefaults() {
}

e.Spec.Monitor.SetDefaults()
setDefaultResourceLimits(&e.Spec.PodTemplate.Spec.Resources, defaultResourceLimits, defaultResourceLimits)
SetDefaultResourceLimits(&e.Spec.PodTemplate.Spec.Resources, DefaultResourceLimits)
}

func (e *EtcdSpec) GetPersistentSecrets() []string {
Expand Down

0 comments on commit 82be6c3

Please sign in to comment.