Skip to content

Commit 76c5422

Browse files
authored
Merge branch 'master' into fix/mk-smoke-tests
2 parents 269db5c + 345fbdf commit 76c5422

File tree

57 files changed

+2483
-49
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2483
-49
lines changed

.evergreen-tasks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,3 +1235,8 @@ tasks:
12351235
tags: [ "patch-run" ]
12361236
commands:
12371237
- func: e2e_test
1238+
1239+
- name: e2e_search_community_basic
1240+
tags: ["patch-run"]
1241+
commands:
1242+
- func: "e2e_test"

.evergreen.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ task_groups:
618618
<<: *setup_and_teardown_task
619619
tasks:
620620
- e2e_community_replicaset_scale
621+
- e2e_search_community_basic
621622

622623
# This is the task group that contains all the tests run in the e2e_mdb_kind_ubuntu_cloudqa build variant
623624
- name: e2e_mdb_kind_cloudqa_task_group
@@ -1187,7 +1188,7 @@ buildvariants:
11871188
# where <distro> is any of ubuntu|ubi
11881189
# where <om_version> denotes the OM version tested (e.g. om50, om60, cloudqa) - used only for MDB tests
11891190

1190-
## MongoDBCommunity build variant
1191+
# MongoDBCommunity build variant
11911192
- name: e2e_mdb_community
11921193
display_name: e2e_mdb_community
11931194
tags: [ "e2e_test_suite"]

RELEASE_NOTES.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
[//]: # (Consider renaming or removing the header for next release, otherwise it appears as duplicate in the published release, e.g: https://github.com/mongodb/mongodb-enterprise-kubernetes/releases/tag/1.22.0 )
22
<!-- Next Release -->
33

4-
# MCK 1.0 Release Notes
4+
# MCK 1.1.0 Release Notes
5+
6+
## New Features
7+
8+
* **MongoDBSearch (Community Private Preview)**: Added support for deploying MongoDB Search (Community Private Preview Edition) that enables full-text and vector search capabilities for MongoDBCommunity deployments.
9+
* Added new MongoDB CRD which is watched by default by the operator.
10+
* For more information please see: `TBD LINK TO DOC MARKDOWN`
11+
* Private Preview phase comes with some limitations:
12+
* minimum MongoDB Community version: 8.0.
13+
* TLS must be disabled in MongoDB (communication between mongot and mongod is in plaintext for now).
14+
15+
<!-- Past Releases -->
16+
17+
# MCK 1.0.0 Release Notes
518

619
Exciting news for MongoDB on Kubernetes\! We're happy to announce the first release of MongoDB Controllers for Kubernetes (MCK), a unified open-source operator merging our support of MongoDB Community and Enterprise in Kubernetes.
720

api/v1/search/doc.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package search
2+
3+
// +k8s:deepcopy-gen=package
4+
// +versionName=v1

api/v1/search/groupversion_info.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Package v1 contains API Schema definitions for the mongodb v1 API group
2+
// +kubebuilder:object:generate=true
3+
// +groupName=mongodb.com
4+
package search
5+
6+
import (
7+
"k8s.io/apimachinery/pkg/runtime/schema"
8+
"sigs.k8s.io/controller-runtime/pkg/scheme"
9+
)
10+
11+
var (
12+
// GroupVersion is group version used to register these objects
13+
GroupVersion = schema.GroupVersion{Group: "mongodb.com", Version: "v1"}
14+
15+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme
16+
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
17+
18+
// AddToScheme adds the types in this group-version to the given scheme.
19+
AddToScheme = SchemeBuilder.AddToScheme
20+
)

api/v1/search/mongodbsearch_types.go

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
package search
2+
3+
import (
4+
"k8s.io/apimachinery/pkg/runtime/schema"
5+
"k8s.io/apimachinery/pkg/types"
6+
7+
corev1 "k8s.io/api/core/v1"
8+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
9+
10+
v1 "github.com/mongodb/mongodb-kubernetes/api/v1"
11+
"github.com/mongodb/mongodb-kubernetes/api/v1/status"
12+
userv1 "github.com/mongodb/mongodb-kubernetes/api/v1/user"
13+
"github.com/mongodb/mongodb-kubernetes/mongodb-community-operator/api/v1/common"
14+
)
15+
16+
const (
17+
MongotDefaultPort = 27027
18+
MongotDefaultMetricsPort = 9946
19+
)
20+
21+
func init() {
22+
v1.SchemeBuilder.Register(&MongoDBSearch{}, &MongoDBSearchList{})
23+
}
24+
25+
type MongoDBSearchSpec struct {
26+
// +optional
27+
Version string `json:"version"`
28+
// +optional
29+
Source *MongoDBSource `json:"source"`
30+
// +optional
31+
StatefulSetConfiguration *common.StatefulSetConfiguration `json:"statefulSet,omitempty"`
32+
// +optional
33+
Persistence *common.Persistence `json:"persistence,omitempty"`
34+
// +optional
35+
ResourceRequirements *corev1.ResourceRequirements `json:"resourceRequirements,omitempty"`
36+
}
37+
38+
type MongoDBSource struct {
39+
// +optional
40+
MongoDBResourceRef *userv1.MongoDBResourceRef `json:"mongodbResourceRef,omitempty"`
41+
}
42+
43+
type MongoDBSearchStatus struct {
44+
status.Common `json:",inline"`
45+
Version string `json:"version,omitempty"`
46+
Warnings []status.Warning `json:"warnings,omitempty"`
47+
}
48+
49+
// +k8s:deepcopy-gen=true
50+
// +kubebuilder:object:root=true
51+
// +k8s:openapi-gen=true
52+
// +kubebuilder:subresource:status
53+
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Current state of the MongoDB deployment."
54+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="The time since the MongoDB resource was created."
55+
// +kubebuilder:resource:path=mongodbsearch,scope=Namespaced,shortName=mdbs
56+
type MongoDBSearch struct {
57+
metav1.TypeMeta `json:",inline"`
58+
metav1.ObjectMeta `json:"metadata,omitempty"`
59+
60+
Spec MongoDBSearchSpec `json:"spec"`
61+
// +optional
62+
Status MongoDBSearchStatus `json:"status,omitempty"`
63+
}
64+
65+
// +k8s:deepcopy-gen=true
66+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
67+
type MongoDBSearchList struct {
68+
metav1.TypeMeta `json:",inline"`
69+
metav1.ListMeta `json:"metadata"`
70+
Items []MongoDBSearch `json:"items"`
71+
}
72+
73+
func (s *MongoDBSearch) GetCommonStatus(options ...status.Option) *status.Common {
74+
return &s.Status.Common
75+
}
76+
77+
func (s *MongoDBSearch) GetStatus(...status.Option) interface{} {
78+
return s.Status
79+
}
80+
81+
func (s *MongoDBSearch) GetStatusPath(...status.Option) string {
82+
return "/status"
83+
}
84+
85+
func (s *MongoDBSearch) SetWarnings(warnings []status.Warning, _ ...status.Option) {
86+
s.Status.Warnings = warnings
87+
}
88+
89+
func (s *MongoDBSearch) UpdateStatus(phase status.Phase, statusOptions ...status.Option) {
90+
s.Status.UpdateCommonFields(phase, s.GetGeneration(), statusOptions...)
91+
if option, exists := status.GetOption(statusOptions, status.WarningsOption{}); exists {
92+
s.Status.Warnings = append(s.Status.Warnings, option.(status.WarningsOption).Warnings...)
93+
}
94+
}
95+
96+
func (s *MongoDBSearch) NamespacedName() types.NamespacedName {
97+
return types.NamespacedName{Name: s.Name, Namespace: s.Namespace}
98+
}
99+
100+
func (s *MongoDBSearch) SearchServiceNamespacedName() types.NamespacedName {
101+
return types.NamespacedName{Name: s.Name + "-search-svc", Namespace: s.Namespace}
102+
}
103+
104+
func (s *MongoDBSearch) MongotConfigConfigMapNamespacedName() types.NamespacedName {
105+
return types.NamespacedName{Name: s.Name + "-search-config", Namespace: s.Namespace}
106+
}
107+
108+
func (s *MongoDBSearch) StatefulSetNamespacedName() types.NamespacedName {
109+
return types.NamespacedName{Name: s.Name + "-search", Namespace: s.Namespace}
110+
}
111+
112+
func (s *MongoDBSearch) GetOwnerReferences() []metav1.OwnerReference {
113+
ownerReference := *metav1.NewControllerRef(s, schema.GroupVersionKind{
114+
Group: GroupVersion.Group,
115+
Version: GroupVersion.Version,
116+
Kind: s.Kind,
117+
})
118+
return []metav1.OwnerReference{ownerReference}
119+
}
120+
121+
func (s *MongoDBSearch) GetMongoDBResourceRef() userv1.MongoDBResourceRef {
122+
mdbResourceRef := userv1.MongoDBResourceRef{Namespace: s.Namespace, Name: s.Name}
123+
if s.Spec.Source != nil && s.Spec.Source.MongoDBResourceRef != nil && s.Spec.Source.MongoDBResourceRef.Name != "" {
124+
mdbResourceRef.Name = s.Spec.Source.MongoDBResourceRef.Name
125+
}
126+
127+
return mdbResourceRef
128+
}
129+
130+
func (s *MongoDBSearch) GetMongotPort() int32 {
131+
return MongotDefaultPort
132+
}
133+
134+
func (s *MongoDBSearch) GetMongotMetricsPort() int32 {
135+
return MongotDefaultMetricsPort
136+
}

api/v1/search/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)