Skip to content

Commit 591e5af

Browse files
pengzhoumlPeng Zhou
andauthored
MLE-11460 Single Group Creation (#5)
* MLE-11460 Single Group Creation * update configMap * use secret to store user credentials * update default value * add default values * remove podManagementPolicy * refactor the way to load script to configMap * reconcile probes * reconcile groups * add Unit Tests * remove licences * change repo name --------- Co-authored-by: Peng Zhou <peng.zhou@progress.com>
1 parent 37e2e19 commit 591e5af

19 files changed

+1379
-959
lines changed

api/v1alpha1/common_types.go

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,17 @@ import (
44
corev1 "k8s.io/api/core/v1"
55
)
66

7-
type Probe struct {
8-
// +kubebuilder:validation:Minimum=1
9-
// +kubebuilder:default=1
7+
type ContainerProbe struct {
8+
Enabled bool `json:"enabled,omitempty"`
9+
// +kubebuilder:validation:Minimum=0
1010
InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"`
11-
// +kubebuilder:validation:Minimum=1
12-
// +kubebuilder:default=1
11+
// +kubebuilder:validation:Minimum=0
1312
TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`
14-
// +kubebuilder:validation:Minimum=1
15-
// +kubebuilder:default=10
13+
// +kubebuilder:validation:Minimum=0
1614
PeriodSeconds int32 `json:"periodSeconds,omitempty"`
17-
// +kubebuilder:validation:Minimum=1
18-
// +kubebuilder:default=1
15+
// +kubebuilder:validation:Minimum=0
1916
SuccessThreshold int32 `json:"successThreshold,omitempty"`
20-
// +kubebuilder:validation:Minimum=1
21-
// +kubebuilder:default=3
17+
// +kubebuilder:validation:Minimum=0
2218
FailureThreshold int32 `json:"failureThreshold,omitempty"`
2319
}
2420

@@ -33,3 +29,9 @@ type VolumeMountWrapper struct {
3329
Volume []corev1.Volume `json:"volume,omitempty"`
3430
MountPath []corev1.VolumeMount `json:"mountPath,omitempty"`
3531
}
32+
33+
type AdminAuth struct {
34+
AdminUsername *string `json:"adminUsername,omitempty"`
35+
AdminPassword *string `json:"adminPassword,omitempty"`
36+
WalletPassword *string `json:"walletPassword,omitempty"`
37+
}

api/v1alpha1/marklogicgroup_types.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,19 @@ type MarklogicGroupSpec struct {
3434
// +kubebuilder:default:="cluster.local"
3535
ClusterDomain string `json:"clusterDomain,omitempty"`
3636

37-
Image string `json:"image"`
37+
// +kubebuilder:default:="marklogicdb/marklogic-db:11.2.0-ubi"
38+
Image string `json:"image"`
39+
// +kubebuilder:default:="IfNotPresent"
3840
ImagePullPolicy string `json:"imagePullPolicy,omitempty"`
3941
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
4042

43+
Auth *AdminAuth `json:"auth,omitempty"`
4144
Storage *Storage `json:"storage,omitempty"`
4245
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
4346
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`
4447
// +kubebuilder:validation:Enum=OnDelete;RollingUpdate
4548
// +kubebuilder:default:="OnDelete"
4649
UpdateStrategy string `json:"updateStrategy,omitempty"`
47-
PodManagementPolicy *string `json:"podManagementPolicy,omitempty"`
4850
NetworkPolicy *networkingv1.NetworkPolicy `json:"networkPolicy,omitempty"`
4951
PodSecurityContext *corev1.PodSecurityContext `json:"securityContext,omitempty"`
5052
ContainerSecurityContext *corev1.SecurityContext `json:"containerSecurityContext,omitempty"`
@@ -54,11 +56,13 @@ type MarklogicGroupSpec struct {
5456
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
5557
PriorityClassName string `json:"priorityClassName,omitempty"`
5658

57-
LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"`
58-
ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"`
59-
StartupProbe *corev1.Probe `json:"startupProbe,omitempty"`
59+
// +kubebuilder:default:={enabled: true, initialDelaySeconds: 30, timeoutSeconds: 5, periodSeconds: 30, successThreshold: 1, failureThreshold: 3}
60+
LivenessProbe ContainerProbe `json:"livenessProbe,omitempty"`
61+
// +kubebuilder:default:={enabled: false, initialDelaySeconds: 10, timeoutSeconds: 5, periodSeconds: 30, successThreshold: 1, failureThreshold: 3}
62+
ReadinessProbe ContainerProbe `json:"readinessProbe,omitempty"`
6063

61-
GroupConfig GroupConfig `json:"groupConfigs,omitempty"`
64+
// +kubebuilder:default:={name: "Default", enableXdqpSsl: true}
65+
GroupConfig GroupConfig `json:"groupConfig,omitempty"`
6266
License *License `json:"license,omitempty"`
6367
EnableConverters bool `json:"enableConverters,omitempty"`
6468

api/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)