Skip to content

Commit

Permalink
feat: rolling update for MonoVertex (#2029)
Browse files Browse the repository at this point in the history
  • Loading branch information
whynowy authored Sep 7, 2024
1 parent 4f6b02e commit 3287887
Show file tree
Hide file tree
Showing 30 changed files with 2,477 additions and 707 deletions.
44 changes: 40 additions & 4 deletions api/json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19270,6 +19270,10 @@
},
"type": "array"
},
"updateStrategy": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.UpdateStrategy",
"description": "The strategy to use to replace existing pods with new ones."
},
"volumes": {
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.Volume"
Expand All @@ -19293,11 +19297,11 @@
"x-kubernetes-patch-strategy": "merge"
},
"currentHash": {
"description": "If not empty, indicates the version of the MonoVertex used to generate Pods in the sequence [0,currentReplicas).",
"description": "If not empty, indicates the current version of the MonoVertex used to generate Pods.",
"type": "string"
},
"currentReplicas": {
"description": "The number of Pods created by the controller from the MonoVertex version indicated by currentHash.",
"desiredReplicas": {
"description": "The number of desired replicas.",
"format": "int64",
"type": "integer"
},
Expand Down Expand Up @@ -19336,9 +19340,14 @@
"type": "string"
},
"updateHash": {
"description": "If not empty, indicates the version of the MonoVertx used to generate Pods in the sequence [replicas-updatedReplicas,replicas)",
"description": "If not empty, indicates the updated version of the MonoVertex used to generate Pods.",
"type": "string"
},
"updatedReadyReplicas": {
"description": "The number of ready Pods created by the controller from the MonoVertex version indicated by updateHash.",
"format": "int64",
"type": "integer"
},
"updatedReplicas": {
"description": "The number of Pods created by the controller from the MonoVertex version indicated by updateHash.",
"format": "int64",
Expand Down Expand Up @@ -19803,6 +19812,16 @@
},
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.RollingUpdateStrategy": {
"description": "RollingUpdateStrategy is used to communicate parameter for RollingUpdateStrategyType.",
"properties": {
"maxUnavailable": {
"$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString",
"description": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. Defaults to 25%. Example: when this is set to 30%, the old pods can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old pods can be scaled down further, followed by scaling up the new pods, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods."
}
},
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.SASL": {
"properties": {
"gssapi": {
Expand Down Expand Up @@ -20318,6 +20337,23 @@
},
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.UpdateStrategy": {
"description": "UpdateStrategy indicates the strategy that the controller will use to perform updates for Vertex or MonoVertex.",
"properties": {
"rollingUpdate": {
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.RollingUpdateStrategy",
"description": "RollingUpdate is used to communicate parameters when Type is RollingUpdateStrategy."
},
"type": {
"description": "Type indicates the type of the StatefulSetUpdateStrategy. Default is RollingUpdate.\n\nPossible enum values:\n - `\"RollingUpdate\"`",
"enum": [
"RollingUpdate"
],
"type": "string"
}
},
"type": "object"
},
"io.numaproj.numaflow.v1alpha1.Vertex": {
"properties": {
"apiVersion": {
Expand Down
44 changes: 40 additions & 4 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -19266,6 +19266,10 @@
"$ref": "#/definitions/io.k8s.api.core.v1.Toleration"
}
},
"updateStrategy": {
"description": "The strategy to use to replace existing pods with new ones.",
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.UpdateStrategy"
},
"volumes": {
"type": "array",
"items": {
Expand All @@ -19289,11 +19293,11 @@
"x-kubernetes-patch-strategy": "merge"
},
"currentHash": {
"description": "If not empty, indicates the version of the MonoVertex used to generate Pods in the sequence [0,currentReplicas).",
"description": "If not empty, indicates the current version of the MonoVertex used to generate Pods.",
"type": "string"
},
"currentReplicas": {
"description": "The number of Pods created by the controller from the MonoVertex version indicated by currentHash.",
"desiredReplicas": {
"description": "The number of desired replicas.",
"type": "integer",
"format": "int64"
},
Expand Down Expand Up @@ -19332,9 +19336,14 @@
"type": "string"
},
"updateHash": {
"description": "If not empty, indicates the version of the MonoVertx used to generate Pods in the sequence [replicas-updatedReplicas,replicas)",
"description": "If not empty, indicates the updated version of the MonoVertex used to generate Pods.",
"type": "string"
},
"updatedReadyReplicas": {
"description": "The number of ready Pods created by the controller from the MonoVertex version indicated by updateHash.",
"type": "integer",
"format": "int64"
},
"updatedReplicas": {
"description": "The number of Pods created by the controller from the MonoVertex version indicated by updateHash.",
"type": "integer",
Expand Down Expand Up @@ -19789,6 +19798,16 @@
}
}
},
"io.numaproj.numaflow.v1alpha1.RollingUpdateStrategy": {
"description": "RollingUpdateStrategy is used to communicate parameter for RollingUpdateStrategyType.",
"type": "object",
"properties": {
"maxUnavailable": {
"description": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding down. Defaults to 25%. Example: when this is set to 30%, the old pods can be scaled down to 70% of desired pods immediately when the rolling update starts. Once new pods are ready, old pods can be scaled down further, followed by scaling up the new pods, ensuring that the total number of pods available at all times during the update is at least 70% of desired pods.",
"$ref": "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"
}
}
},
"io.numaproj.numaflow.v1alpha1.SASL": {
"type": "object",
"required": [
Expand Down Expand Up @@ -20304,6 +20323,23 @@
}
}
},
"io.numaproj.numaflow.v1alpha1.UpdateStrategy": {
"description": "UpdateStrategy indicates the strategy that the controller will use to perform updates for Vertex or MonoVertex.",
"type": "object",
"properties": {
"rollingUpdate": {
"description": "RollingUpdate is used to communicate parameters when Type is RollingUpdateStrategy.",
"$ref": "#/definitions/io.numaproj.numaflow.v1alpha1.RollingUpdateStrategy"
},
"type": {
"description": "Type indicates the type of the StatefulSetUpdateStrategy. Default is RollingUpdate.\n\nPossible enum values:\n - `\"RollingUpdate\"`",
"type": "string",
"enum": [
"RollingUpdate"
]
}
}
},
"io.numaproj.numaflow.v1alpha1.Vertex": {
"type": "object",
"required": [
Expand Down
2 changes: 1 addition & 1 deletion config/advanced-install/minimal-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ spec:
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .spec.replicas
- jsonPath: .status.desiredReplicas
name: Desired
type: string
- jsonPath: .status.replicas
Expand Down
24 changes: 22 additions & 2 deletions config/base/crds/full/numaflow.numaproj.io_monovertices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .spec.replicas
- jsonPath: .status.desiredReplicas
name: Desired
type: string
- jsonPath: .status.replicas
Expand Down Expand Up @@ -4790,6 +4790,23 @@ spec:
type: string
type: object
type: array
updateStrategy:
default:
rollingUpdate:
maxUnavailable: 25%
type: RollingUpdate
properties:
rollingUpdate:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
type: object
type:
type: string
type: object
volumes:
items:
properties:
Expand Down Expand Up @@ -5551,7 +5568,7 @@ spec:
type: array
currentHash:
type: string
currentReplicas:
desiredReplicas:
format: int32
type: integer
lastScaledAt:
Expand Down Expand Up @@ -5586,6 +5603,9 @@ spec:
type: string
updateHash:
type: string
updatedReadyReplicas:
format: int32
type: integer
updatedReplicas:
format: int32
type: integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .spec.replicas
- jsonPath: .status.desiredReplicas
name: Desired
type: string
- jsonPath: .status.replicas
Expand Down
24 changes: 22 additions & 2 deletions config/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2665,7 +2665,7 @@ spec:
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .spec.replicas
- jsonPath: .status.desiredReplicas
name: Desired
type: string
- jsonPath: .status.replicas
Expand Down Expand Up @@ -7434,6 +7434,23 @@ spec:
type: string
type: object
type: array
updateStrategy:
default:
rollingUpdate:
maxUnavailable: 25%
type: RollingUpdate
properties:
rollingUpdate:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
type: object
type:
type: string
type: object
volumes:
items:
properties:
Expand Down Expand Up @@ -8195,7 +8212,7 @@ spec:
type: array
currentHash:
type: string
currentReplicas:
desiredReplicas:
format: int32
type: integer
lastScaledAt:
Expand Down Expand Up @@ -8230,6 +8247,9 @@ spec:
type: string
updateHash:
type: string
updatedReadyReplicas:
format: int32
type: integer
updatedReplicas:
format: int32
type: integer
Expand Down
24 changes: 22 additions & 2 deletions config/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2665,7 +2665,7 @@ spec:
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .spec.replicas
- jsonPath: .status.desiredReplicas
name: Desired
type: string
- jsonPath: .status.replicas
Expand Down Expand Up @@ -7434,6 +7434,23 @@ spec:
type: string
type: object
type: array
updateStrategy:
default:
rollingUpdate:
maxUnavailable: 25%
type: RollingUpdate
properties:
rollingUpdate:
properties:
maxUnavailable:
anyOf:
- type: integer
- type: string
x-kubernetes-int-or-string: true
type: object
type:
type: string
type: object
volumes:
items:
properties:
Expand Down Expand Up @@ -8195,7 +8212,7 @@ spec:
type: array
currentHash:
type: string
currentReplicas:
desiredReplicas:
format: int32
type: integer
lastScaledAt:
Expand Down Expand Up @@ -8230,6 +8247,9 @@ spec:
type: string
updateHash:
type: string
updatedReadyReplicas:
format: int32
type: integer
updatedReplicas:
format: int32
type: integer
Expand Down
Loading

0 comments on commit 3287887

Please sign in to comment.