Skip to content

Commit 82b5817

Browse files
authored
Init MultiGroup Change (#27)
1 parent 4abf18d commit 82b5817

20 files changed

+7409
-3978
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ endif
183183

184184
.PHONY: install
185185
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
186-
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
186+
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply --server-side -f -
187187

188188
.PHONY: uninstall
189189
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.

api/v1alpha1/common_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ type ContainerProbe struct {
2222

2323
// Storage is the inteface to add pvc and pv support in marklogic
2424
type Storage struct {
25-
Size string `json:"size,omitempty"`
26-
VolumeMount VolumeMountWrapper `json:"volumeMount,omitempty"`
25+
Size string `json:"size,omitempty"`
26+
VolumeMount VolumeMountWrapper `json:"volumeMount,omitempty"`
27+
StorageClass string `json:"storageClass,omitempty"`
2728
}
2829

2930
type HugePages struct {
@@ -73,7 +74,6 @@ type NetworkPolicy struct {
7374
Ingress []networkingv1.NetworkPolicyIngressRule `json:"ingress,omitempty"`
7475
Egress []networkingv1.NetworkPolicyEgressRule `json:"egress,omitempty"`
7576
}
76-
7777
type HAProxyConfig struct {
7878
Enabled bool `json:"enabled,omitempty"`
7979
// +kubebuilder:default:=1

api/v1alpha1/marklogiccluster_types.go

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ limitations under the License.
1717
package v1alpha1
1818

1919
import (
20+
appsv1 "k8s.io/api/apps/v1"
21+
corev1 "k8s.io/api/core/v1"
22+
networkingv1 "k8s.io/api/networking/v1"
2023
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2124
)
2225

@@ -28,13 +31,57 @@ type MarklogicClusterSpec struct {
2831
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
2932
// Important: Run "make" to regenerate code after modifying this file
3033

31-
// Foo is an example field of MarklogicCluster. Edit marklogiccluster_types.go to remove/update
34+
// +kubebuilder:default:="cluster.local"
35+
ClusterDomain string `json:"clusterDomain,omitempty"`
36+
37+
// +kubebuilder:default:="progressofficial/marklogic-db:11.3.0-ubi-rootless"
38+
Image string `json:"image"`
39+
// +kubebuilder:default:="IfNotPresent"
40+
ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
41+
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
42+
43+
Auth *AdminAuth `json:"auth,omitempty"`
44+
Storage *Storage `json:"storage,omitempty"`
45+
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
46+
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
47+
// +kubebuilder:validation:Enum=OnDelete;RollingUpdate
48+
// +kubebuilder:default:="OnDelete"
49+
UpdateStrategy appsv1.StatefulSetUpdateStrategyType `json:"updateStrategy,omitempty"`
50+
NetworkPolicy *networkingv1.NetworkPolicy `json:"networkPolicy,omitempty"`
51+
PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`
52+
ContainerSecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
53+
54+
Affinity *corev1.Affinity `json:"affinity,omitempty"`
55+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
56+
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
57+
PriorityClassName string `json:"priorityClassName,omitempty"`
58+
License *License `json:"license,omitempty"`
59+
EnableConverters bool `json:"enableConverters,omitempty"`
60+
// +kubebuilder:default:={enabled: false, mountPath: "/dev/hugepages"}
61+
HugePages *HugePages `json:"hugePages,omitempty"`
62+
// +kubebuilder:default:={enabled: false, image: "fluent/fluent-bit:3.1.1", resources: {requests: {cpu: "100m", memory: "200Mi"}, limits: {cpu: "200m", memory: "500Mi"}}, files: {errorLogs: true, accessLogs: true, requestLogs: true}, outputs: "stdout"}
63+
LogCollection *LogCollection `json:"logCollection,omitempty"`
64+
65+
HAProxy HAProxyConfig `json:"haproxy,omitempty"`
66+
3267
MarkLogicGroups []*MarklogicGroups `json:"markLogicGroups,omitempty"`
3368
}
3469

3570
type MarklogicGroups struct {
36-
*MarklogicGroupSpec `json:"spec,omitempty"`
37-
IsBootstrap bool `json:"isBootstrap,omitempty"`
71+
Replicas *int32 `json:"replicas,omitempty"`
72+
Name string `json:"name,omitempty"`
73+
Image string `json:"image,omitempty"`
74+
ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
75+
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
76+
Storage *Storage `json:"storage,omitempty"`
77+
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
78+
Affinity *corev1.Affinity `json:"affinity,omitempty"`
79+
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
80+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
81+
PriorityClassName string `json:"priorityClassName,omitempty"`
82+
HugePages *HugePages `json:"hugePages,omitempty"`
83+
LogCollection *LogCollection `json:"logCollection,omitempty"`
84+
IsBootstrap bool `json:"isBootstrap,omitempty"`
3885
}
3986

4087
// MarklogicClusterStatus defines the observed state of MarklogicCluster

api/v1alpha1/zz_generated.deepcopy.go

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

cmd/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ func main() {
132132
os.Exit(1)
133133
}
134134
if err = (&controller.MarklogicClusterReconciler{
135-
Client: mgr.GetClient(),
136-
Scheme: mgr.GetScheme(),
135+
Client: mgr.GetClient(),
136+
Scheme: mgr.GetScheme(),
137+
Log: ctrl.Log.WithName("controllers").WithName("MarklogicCluster"),
138+
Recorder: mgr.GetEventRecorderFor("marklogiccluster-controller"),
137139
}).SetupWithManager(mgr); err != nil {
138140
setupLog.Error(err, "unable to create controller", "controller", "MarklogicCluster")
139141
os.Exit(1)

0 commit comments

Comments
 (0)