Skip to content

Commit

Permalink
fix(host): configureable host maxUnavailable and augment FailureThres…
Browse files Browse the repository at this point in the history
…hold count
  • Loading branch information
wanyaoqi committed Jan 27, 2025
1 parent b66ace2 commit cdf5c1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/apis/onecloud/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ type DaemonSetSpec struct {
Annotations map[string]string `json:"annotations,omitempty"`
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
UpdateStrategy string `json:"updateStrategy,omitempty"`
MaxUnavailable *int `json:"maxUnavailable,omitempty"`
}

type YunionagentSpec struct {
Expand Down
8 changes: 6 additions & 2 deletions pkg/manager/component/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (m *hostManager) newHostPrivilegedDaemonSet(
Scheme: corev1.URISchemeHTTPS,
},
},
FailureThreshold: 30,
FailureThreshold: 300,
PeriodSeconds: 10,
},
ReadinessProbe: generateReadinessProbe("/ping", 8885),
Expand Down Expand Up @@ -215,7 +215,11 @@ func (m *hostManager) newHostPrivilegedDaemonSet(
if ds.Spec.UpdateStrategy.RollingUpdate == nil {
ds.Spec.UpdateStrategy.RollingUpdate = new(apps.RollingUpdateDaemonSet)
}
var maxUnavailableCount = intstr.FromInt(3)
var maxUnavailable = 3
if dsSpec.DaemonSetSpec.MaxUnavailable != nil && *dsSpec.DaemonSetSpec.MaxUnavailable > 0 {
maxUnavailable = *dsSpec.DaemonSetSpec.MaxUnavailable
}
var maxUnavailableCount = intstr.FromInt(maxUnavailable)
ds.Spec.UpdateStrategy.RollingUpdate.MaxUnavailable = &maxUnavailableCount

/* add pod label for pod affinity */
Expand Down

0 comments on commit cdf5c1a

Please sign in to comment.