Skip to content

Commit

Permalink
milvus_webhook: fix component port not settable (#207)
Browse files Browse the repository at this point in the history
Signed-off-by: haorenfsa <[email protected]>
  • Loading branch information
haorenfsa authored Nov 12, 2024
1 parent 2c0e5cd commit 2daba53
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 304 deletions.
1 change: 0 additions & 1 deletion apis/milvus.io/v1alpha1/milvus_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func (r *MilvusSpec) ConvertSpecTo(dst *v1beta1.MilvusSpec) {
Component: v1beta1.Component{
ComponentSpec: r.ComponentSpec,
Replicas: r.Replicas,
Port: 19530,
},
ServiceType: r.ServiceType,
ServiceLabels: r.ServiceLabels,
Expand Down
12 changes: 6 additions & 6 deletions apis/milvus.io/v1beta1/components_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,6 @@ type Component struct {
// when replicas is -1, it means the replicas should be managed by HPA
Replicas *int32 `json:"replicas,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=65535
// not used for now
Port int32 `json:"port,omitempty"`

// SideCars is same as []corev1.Container, we use a Values here to avoid the CRD become too large
// +kubebuilder:validation:Optional
// +kubebuilder:pruning:PreserveUnknownFields
Expand Down Expand Up @@ -294,6 +288,12 @@ type ServiceComponent struct {
// +kubebuilder:default="ClusterIP"
ServiceType corev1.ServiceType `json:"serviceType,omitempty"`

// Port of grpc service, if not set or <=0, default to 19530
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=65535
Port int32 `json:"port,omitempty"`

// +kubebuilder:validation:Optional
ServiceRestfulPort int32 `json:"serviceRestfulPort,omitempty"`

Expand Down
7 changes: 0 additions & 7 deletions apis/milvus.io/v1beta1/milvus_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,6 @@ func deleteUnsettableConf(conf map[string]interface{}) {
util.DeleteValue(conf, "pulsar", "address")
util.DeleteValue(conf, "pulsar", "port")
util.DeleteValue(conf, "etcd", "endpoints")

for _, t := range MilvusComponentTypes {
util.DeleteValue(conf, t.String(), "port")
}
for _, t := range MilvusCoordTypes {
util.DeleteValue(conf, t.String(), "address")
}
}

var (
Expand Down
80 changes: 0 additions & 80 deletions charts/milvus-operator/templates/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -875,11 +875,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -1440,11 +1435,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -2099,11 +2089,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -2664,11 +2649,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -3231,11 +3211,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -4418,11 +4393,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -4983,11 +4953,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -5581,11 +5546,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -8542,11 +8502,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -9107,11 +9062,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -9766,11 +9716,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -10331,11 +10276,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -10898,11 +10838,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -12085,11 +12020,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -12650,11 +12580,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -13248,11 +13173,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down
40 changes: 0 additions & 40 deletions config/crd/bases/milvus.io_milvusclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -873,11 +873,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -1438,11 +1433,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -2097,11 +2087,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -2662,11 +2647,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -3229,11 +3209,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -4416,11 +4391,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -4981,11 +4951,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down Expand Up @@ -5579,11 +5544,6 @@ spec:
additionalProperties:
type: string
type: object
port:
format: int32
maximum: 65535
minimum: 0
type: integer
priorityClassName:
type: string
replicas:
Expand Down
Loading

0 comments on commit 2daba53

Please sign in to comment.