Skip to content

Commit

Permalink
NnfDataMovementManager: Add UpdateStrategy to support parallel rollin…
Browse files Browse the repository at this point in the history
…g updates

The NNF DMM manages the nnf-dm-worker DaemonSet, which is reponsible for
the nnf-dm-worker pods. Adding UpdateStrategy to the
NnfDataMovementManagerSpec ensures admins can configure the update
strategy for those pods.

This allows for a non-sequential update when rolling out new worker
pods.

Signed-off-by: Blake Devcich <[email protected]>
  • Loading branch information
bdevcich committed Feb 13, 2024
1 parent de99507 commit b610046
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/v1alpha1/nnf_datamovementmanager_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package v1alpha1

import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

Expand Down Expand Up @@ -50,6 +51,10 @@ type NnfDataMovementManagerSpec struct {
// manages the per node data movement operations.
Template corev1.PodTemplateSpec `json:"template"`

// UpdateStrategy defines the UpdateStrategy that is used for the basis of the worker Daemon Set
// that manages the per node data movement operations.
UpdateStrategy appsv1.DaemonSetUpdateStrategy `json:"updateStrategy"`

// Host Path defines the directory location of shared mounts on an individual worker node.
HostPath string `json:"hostPath"`

Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions config/crd/bases/nnf.cray.hpe.com_nnfdatamovementmanagers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7626,11 +7626,75 @@ spec:
- containers
type: object
type: object
updateStrategy:
description: UpdateStrategy defines the UpdateStrategy that is used
for the basis of the worker Daemon Set that manages the per node
data movement operations.
properties:
rollingUpdate:
description: 'Rolling update config params. Present only if type
= "RollingUpdate". --- TODO: Update this to follow our convention
for oneOf, whatever we decide it to be. Same as Deployment `strategy.rollingUpdate`.
See https://github.com/kubernetes/kubernetes/issues/35345'
properties:
maxSurge:
anyOf:
- type: integer
- type: string
description: 'The maximum number of nodes with an existing
available DaemonSet pod that can have an updated DaemonSet
pod during during an update. Value can be an absolute number
(ex: 5) or a percentage of desired pods (ex: 10%). This
can not be 0 if MaxUnavailable is 0. Absolute number is
calculated from percentage by rounding up to a minimum of
1. Default value is 0. Example: when this is set to 30%,
at most 30% of the total number of nodes that should be
running the daemon pod (i.e. status.desiredNumberScheduled)
can have their a new pod created before the old pod is marked
as deleted. The update starts by launching new pods on 30%
of nodes. Once an updated pod is available (Ready for at
least minReadySeconds) the old DaemonSet pod on that node
is marked deleted. If the old pod becomes unavailable for
any reason (Ready transitions to false, is evicted, or is
drained) an updated pod is immediatedly created on that
node without considering surge limits. Allowing surge implies
the possibility that the resources consumed by the daemonset
on any given node can double if the readiness check fails,
and so resource intensive daemonsets should take into account
that they may cause evictions during disruption.'
x-kubernetes-int-or-string: true
maxUnavailable:
anyOf:
- type: integer
- type: string
description: 'The maximum number of DaemonSet pods that can
be unavailable during the update. Value can be an absolute
number (ex: 5) or a percentage of total number of DaemonSet
pods at the start of the update (ex: 10%). Absolute number
is calculated from percentage by rounding up. This cannot
be 0 if MaxSurge is 0 Default value is 1. Example: when
this is set to 30%, at most 30% of the total number of nodes
that should be running the daemon pod (i.e. status.desiredNumberScheduled)
can have their pods stopped for an update at any given time.
The update starts by stopping at most 30% of those DaemonSet
pods and then brings up new DaemonSet pods in their place.
Once the new pods are available, it then proceeds onto other
DaemonSet pods, thus ensuring that at least 70% of original
number of DaemonSet pods are available at all times during
the update.'
x-kubernetes-int-or-string: true
type: object
type:
description: Type of daemon set update. Can be "RollingUpdate"
or "OnDelete". Default is RollingUpdate.
type: string
type: object
required:
- hostPath
- mountPath
- selector
- template
- updateStrategy
type: object
status:
description: NnfDataMovementManagerStatus defines the observed state of
Expand Down

0 comments on commit b610046

Please sign in to comment.