Skip to content

Commit 2dd7417

Browse files
pengzhoumlPeng Zhou
andauthored
MLE-17039 Refactor MarkLogic Cluster (#29)
* Init Fix * basic backend frontend and static page * update for sample * Fix Group Name bug * support pathBased Routing * fix tcp port for HAProxy * update pathBased Routing * updated network policy * update for pathBased Routing * update marklogic group sample * update haproxy based on review comments * add ssl support for HAProxy * fix based on comments * fix unit test * update helm for ea2 release --------- Co-authored-by: Peng Zhou <[email protected]>
1 parent 82b5817 commit 2dd7417

22 files changed

+13364
-6111
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ endif
5151
OPERATOR_SDK_VERSION ?= v1.34.2
5252

5353
# Image URL to use all building/pushing image targets
54-
IMG ?= ml-marklogic-operator-dev.bed-artifactory.bedford.progress.com/marklogic-kubernetes-operator:0.0.1
54+
IMG ?= ml-marklogic-operator-dev.bed-artifactory.bedford.progress.com/marklogic-kubernetes-operator:0.0.2
5555
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
5656
ENVTEST_K8S_VERSION = 1.28.3
5757

@@ -192,7 +192,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
192192
.PHONY: deploy
193193
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
194194
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
195-
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
195+
$(KUSTOMIZE) build config/default | $(KUBECTL) apply --server-side -f -
196196

197197
.PHONY: undeploy
198198
undeploy: ## Undeploy controller 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: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,16 @@ type NetworkPolicy struct {
7474
Ingress []networkingv1.NetworkPolicyIngressRule `json:"ingress,omitempty"`
7575
Egress []networkingv1.NetworkPolicyEgressRule `json:"egress,omitempty"`
7676
}
77-
type HAProxyConfig struct {
77+
type HAProxy struct {
7878
Enabled bool `json:"enabled,omitempty"`
79+
// +kubebuilder:default:="haproxytech/haproxy-alpine:3.1"
80+
Image string `json:"image"`
7981
// +kubebuilder:default:=1
8082
ReplicaCount int32 `json:"replicas,omitempty"`
8183
// +kubebuilder:default:=80
8284
FrontendPort int32 `json:"frontendPort,omitempty"`
8385
// +kubebuilder:default:={{name: "AppServices", type: "http", port: 8000, targetPort: 8000, path: "/console"}, {name: "Admin", type: "http", port: 8001, targetPort: 8001, path: "/adminUI"}, {name: "Manage", type: "http", port: 8002, targetPort: 8002, path: "/manage"}}
84-
DefaultAppServers []AppServers `json:"defaultAppServers,omitempty"`
85-
AdditionalAppServers []AppServers `json:"additionalAppServers,omitempty"`
86+
AppServers []AppServers `json:"appServers,omitempty"`
8687
// +kubebuilder:default:=true
8788
PathBasedRouting bool `json:"pathBasedRouting,omitempty"`
8889
RestartWhenUpgrade bool `json:"restartWhenUpgrade,omitempty"`
@@ -93,10 +94,12 @@ type HAProxyConfig struct {
9394
// +kubebuilder:default:={client: 600, connect: 600, server: 600}
9495
Timeout Timeout `json:"timeout,omitempty"`
9596
// +kubebuilder:default:={enabled: false, secretName: "", certFileName: ""}
96-
Tls TlsForHAProxy `json:"tls,omitempty"`
97+
Tls *TlsForHAProxy `json:"tls,omitempty"`
9798
// +kubebuilder:default:={enabled: false, port: 1024, auth: {enabled: false, username: "", password: ""}}
98-
Stats Stats `json:"stats,omitempty"`
99-
Resources corev1.ResourceList `json:"resources,omitempty"`
99+
Stats Stats `json:"stats,omitempty"`
100+
Resources corev1.ResourceList `json:"resources,omitempty"`
101+
Affinity *corev1.Affinity `json:"affinity,omitempty"`
102+
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
100103
}
101104

102105
type AppServers struct {

api/v1alpha1/marklogiccluster_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package v1alpha1
1919
import (
2020
appsv1 "k8s.io/api/apps/v1"
2121
corev1 "k8s.io/api/core/v1"
22-
networkingv1 "k8s.io/api/networking/v1"
2322
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2423
)
2524

@@ -47,7 +46,7 @@ type MarklogicClusterSpec struct {
4746
// +kubebuilder:validation:Enum=OnDelete;RollingUpdate
4847
// +kubebuilder:default:="OnDelete"
4948
UpdateStrategy appsv1.StatefulSetUpdateStrategyType `json:"updateStrategy,omitempty"`
50-
NetworkPolicy *networkingv1.NetworkPolicy `json:"networkPolicy,omitempty"`
49+
NetworkPolicy NetworkPolicy `json:"networkPolicy,omitempty"`
5150
PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`
5251
ContainerSecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
5352

@@ -62,7 +61,7 @@ type MarklogicClusterSpec struct {
6261
// +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"}
6362
LogCollection *LogCollection `json:"logCollection,omitempty"`
6463

65-
HAProxy HAProxyConfig `json:"haproxy,omitempty"`
64+
HAProxy HAProxy `json:"haproxy,omitempty"`
6665

6766
MarkLogicGroups []*MarklogicGroups `json:"markLogicGroups,omitempty"`
6867
}
@@ -81,6 +80,7 @@ type MarklogicGroups struct {
8180
PriorityClassName string `json:"priorityClassName,omitempty"`
8281
HugePages *HugePages `json:"hugePages,omitempty"`
8382
LogCollection *LogCollection `json:"logCollection,omitempty"`
83+
HAProxy *HAProxy `json:"haproxy,omitempty"`
8484
IsBootstrap bool `json:"isBootstrap,omitempty"`
8585
}
8686

api/v1alpha1/marklogicgroup_types.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,16 @@ type MarklogicGroupSpec struct {
7070
LogCollection *LogCollection `json:"logCollection,omitempty"`
7171

7272
// +kubebuilder:default:={name: "Default", enableXdqpSsl: true}
73-
GroupConfig GroupConfig `json:"groupConfig,omitempty"`
74-
License *License `json:"license,omitempty"`
75-
EnableConverters bool `json:"enableConverters,omitempty"`
73+
GroupConfig *GroupConfig `json:"groupConfig,omitempty"`
74+
License *License `json:"license,omitempty"`
75+
EnableConverters bool `json:"enableConverters,omitempty"`
7676

7777
BootstrapHost string `json:"bootstrapHost,omitempty"`
7878

7979
DoNotDelete *bool `json:"doNotDelete,omitempty"`
8080

81-
Service Service `json:"service,omitempty"`
82-
83-
HAProxyConfig HAProxyConfig `json:"haProxyConfig,omitempty"`
81+
Service Service `json:"service,omitempty"`
82+
PathBasedRouting bool `json:"pathBasedRouting,omitempty"`
8483
}
8584

8685
// InternalState defines the observed state of MarklogicGroup

api/v1alpha1/zz_generated.deepcopy.go

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

charts/marklogic-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ type: application
1313
# This is the chart version. This version number should be incremented each time you make changes
1414
# to the chart and its templates, including the app version.
1515
# Versions are expected to follow Semantic Versioning (https://semver.org/)
16-
version: 1.0.0-ea1
16+
version: 1.0.0-ea2
1717
# This is the version number of the application being deployed. This version number should be
1818
# incremented each time you make changes to the application. Versions are not expected to
1919
# follow Semantic Versioning. They should reflect the version the application is using.
2020
# It is recommended to use it with quotes.
21-
appVersion: 1.0.0-ea1
21+
appVersion: 1.0.0-ea2

0 commit comments

Comments
 (0)