Skip to content

Commit

Permalink
pulsarv3: update default values, default to 3.0.7, enabled for new in…
Browse files Browse the repository at this point in the history
…stance (#214)

Signed-off-by: haorenfsa <[email protected]>
  • Loading branch information
haorenfsa authored Jan 23, 2025
1 parent 26f348b commit 5f3e10b
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 28 deletions.
4 changes: 3 additions & 1 deletion apis/milvus.io/v1beta1/dependencies_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ type MilvusEtcd struct {
type InClusterConfig struct {
// +kubebuilder:validation:Optional
// +kubebuilder:pruning:PreserveUnknownFields
// +nullable
Values Values `json:"values,omitempty"`

// ChartVersion is the pulsar chart version to be installed
// For now only pulsar uses this field
// pulsar-v2 (v2.7.8) & pulsar-v3 (v3.3.0) can be used
// default to pulsar-v2 for backward compatibility
// after v1.2.0, pulsar-v3 is used for new milvus
// note it's the version of chart, not pulsar
// pulsar v2.x should use pulsar-v2 chart, & pulsar v3.x should use pulsar-v3 chart
// +kubebuilder:validation:Optional
ChartVersion values.ChartVersion `json:"chartVersion,omitempty"`

Expand Down
8 changes: 8 additions & 0 deletions apis/milvus.io/v1beta1/milvus_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,14 @@ func (r *Milvus) defaultMsgStream() {
if r.Spec.Dep.Pulsar.InCluster.Values.Data == nil {
r.Spec.Dep.Pulsar.InCluster.Values.Data = map[string]interface{}{}
}
if r.Spec.Dep.Pulsar.InCluster.ChartVersion == "" {
if r.IsFirstTimeStarting() {
r.Spec.Dep.Pulsar.InCluster.ChartVersion = "pulsar-v3"
} else {
// considering compatitiy with old version
r.Spec.Dep.Pulsar.InCluster.ChartVersion = "pulsar-v2"
}
}
r.defaultValuesByDependency(values.DependencyKindPulsar)
if r.Spec.Dep.Pulsar.InCluster.DeletionPolicy == "" {
r.Spec.Dep.Pulsar.InCluster.DeletionPolicy = DeletionPolicyRetain
Expand Down
4 changes: 3 additions & 1 deletion apis/milvus.io/v1beta1/milvus_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ func TestMilvus_Default_NotExternal(t *testing.T) {
Data: map[string]interface{}{},
},
}
pulsarDefaultInClusterConfig := defaultInClusterConfig.DeepCopy()
pulsarDefaultInClusterConfig.ChartVersion = "pulsar-v3"

etcdStandaloneDefaultInClusterConfig := defaultInClusterConfig.DeepCopy()
etcdStandaloneDefaultInClusterConfig.Values.Data["replicaCount"] = int64(1)
Expand Down Expand Up @@ -91,7 +93,7 @@ func TestMilvus_Default_NotExternal(t *testing.T) {
clusterDefault.Dep.MsgStreamType = MsgStreamTypePulsar
clusterDefault.Dep.Pulsar = MilvusPulsar{
Endpoint: "mc-pulsar-proxy.default:6650",
InCluster: defaultInClusterConfig,
InCluster: pulsarDefaultInClusterConfig,
}
clusterDefault.Dep.Etcd.Endpoints = []string{
"mc-etcd-0.mc-etcd-headless.default:2379",
Expand Down
12 changes: 12 additions & 0 deletions charts/milvus-operator/templates/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6939,6 +6939,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand All @@ -6965,6 +6966,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down Expand Up @@ -7025,6 +7027,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down Expand Up @@ -7076,6 +7079,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down Expand Up @@ -7667,6 +7671,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand All @@ -7693,6 +7698,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down Expand Up @@ -7753,6 +7759,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down Expand Up @@ -7804,6 +7811,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down Expand Up @@ -15134,6 +15142,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand All @@ -15160,6 +15169,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down Expand Up @@ -15220,6 +15230,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down Expand Up @@ -15271,6 +15282,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down
61 changes: 35 additions & 26 deletions config/assets/charts/pulsar-v3-values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# This file contains recommended default values for a production deployment
persistence: true
extra: {}
monitoring: {}
volumes:
persistence: true
local_storage: false
Expand All @@ -25,35 +27,37 @@ components:
images:
zookeeper:
repository: apachepulsar/pulsar
tag: 3.0.2
tag: 3.0.7
pullPolicy: IfNotPresent
bookie:
repository: apachepulsar/pulsar
tag: 3.0.2
tag: 3.0.7
pullPolicy: IfNotPresent
autorecovery:
repository: apachepulsar/pulsar
tag: 3.0.2
tag: 3.0.7
pullPolicy: IfNotPresent
broker:
repository: apachepulsar/pulsar
tag: 3.0.2
tag: 3.0.7
pullPolicy: IfNotPresent
proxy:
repository: apachepulsar/pulsar
tag: 3.0.2
tag: 3.0.7
pullPolicy: IfNotPresent

zookeeper:
pdb:
usePolicy: false
affinity:
anti_affinity: false
component: zookeeper
replicaCount: 3
updateStrategy:
type: RollingUpdate
podManagementPolicy: Parallel
podMonitor:
enabled: true
interval: 10s
scrapeTimeout: 10s
enabled: false
resources:
requests:
memory: 256Mi
Expand Down Expand Up @@ -81,15 +85,17 @@ zookeeper:
-XX:+PerfDisableSharedMem
bookkeeper:
pdb:
usePolicy: false
affinity:
anti_affinity: false
component: bookie
replicaCount: 3
updateStrategy:
type: RollingUpdate
podManagementPolicy: Parallel
podMonitor:
enabled: true
interval: 30s
scrapeTimeout: 10s
enabled: false
resources:
requests:
memory: 2048Mi
Expand All @@ -99,11 +105,11 @@ bookkeeper:
persistence: true
journal:
name: journal
size: 50Gi
size: 100Gi
local_storage: false
ledgers:
name: ledgers
size: 500Gi
size: 200Gi
local_storage: false
configData:
PULSAR_MEM: >
Expand All @@ -123,18 +129,18 @@ bookkeeper:
-XX:-ResizePLAB
-XX:+ExitOnOutOfMemoryError
-XX:+PerfDisableSharedMem
nettyMaxFrameSizeBytes: "104867840"
autorecovery:
affinity:
anti_affinity: false
component: recovery
replicaCount: 1
podMonitor:
enabled: true
interval: 30s
scrapeTimeout: 10s
resources:
requests:
memory: 128Mi
cpu: 0.1
podMonitor:
enabled: false
configData:
BOOKIE_MEM: >
-Xms128m -Xmx128m
Expand All @@ -143,18 +149,20 @@ pulsar_metadata:
component: pulsar-init
image:
repository: apachepulsar/pulsar
tag: 3.0.2
tag: 3.0.7
pullPolicy: IfNotPresent

broker:
pdb:
usePolicy: false
affinity:
anti_affinity: false
component: broker
replicaCount: 2
autoscaling:
enabled: false
podMonitor:
enabled: true
interval: 30s
scrapeTimeout: 10s
enabled: false
resources:
requests:
memory: 2048Mi
Expand Down Expand Up @@ -189,14 +197,16 @@ broker:
backlogQuotaDefaultRetentionPolicy: producer_exception

proxy:
pdb:
usePolicy: false
affinity:
anti_affinity: false
component: proxy
replicaCount: 2
autoscaling:
enabled: false
podMonitor:
enabled: true
interval: 30s
scrapeTimeout: 10s
enabled: false
resources:
requests:
memory: 1024Mi
Expand Down Expand Up @@ -240,4 +250,3 @@ kube-prometheus-stack:
enabled: false
grafana:
enabled: false

4 changes: 4 additions & 0 deletions config/crd/bases/milvus.io_milvusclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6937,6 +6937,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand All @@ -6963,6 +6964,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down Expand Up @@ -7023,6 +7025,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down Expand Up @@ -7074,6 +7077,7 @@ spec:
pvcDeletion:
type: boolean
values:
nullable: true
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Expand Down
Loading

0 comments on commit 5f3e10b

Please sign in to comment.