DaemonSet Upgrade Model
Background
In edge scenarios, the native DaemonSet upgrade model does not perfectly satisfy existing requirements. In the case of cloud-edge network disconnection, DaemonSet upgrade process may be blocked. In addition, the native upgrade model does not provide any upgrade operation API, and users cannot control the application upgrade on their own.
In order to address the above problems, we extend the native DaemonSet upgrade model by adding a custom controller daemonPodUpdater-controller
, providing AdvancedRollingUpdate and OTA two upgrade model.
- AdvancedRollingUpdate: Solve the DaemonSet upgrade process blocking problem which caused by node
Not-Ready
when the cloud-edge is disconnected. During AdvancedRollingUpdate upgrade,not-ready
nodes will be ignored. And whenNot-Ready
nodes turn toReady
, upgrade process will be completed automatically. - OTA: Add pod status condition
PodNeedUpgrade
which indicates the upgrade availability information. YurtHub OTA component can use this condition to determine if a new version of DaemonSet application exists.
Configuration
# example configuration for AdvancedRollingUpdate or OTA upgrade
apiVersion: apps/v1
kind: DaemonSet
metadata:
# ···
annotations:
# This annotation is the first prerequisite for using AdvancedRollingUpdate or OTA upgrade
# and the only valid values are "AdvancedRollingUpdate" or "OTA".
apps.openyurt.io/update-strategy: OTA
# This annotation is used for rolling update and only works in AdvancedRollingUpdate mode.
# The supported value is the same with native DaemonSet maxUnavailable, default to 10%.
apps.openyurt.io/max-unavailable: 30%
# ···
spec:
# ···
# Set updateStrategy to "OnDelete" is another prerequisite for using AdvancedRollingUpdate or OTA upgrade.
updateStrategy:
type: OnDelete
# ···
In short, if you wish to use AdvancedRollingUpdate or OTA upgrade, you need to set annotation apps.openyurt.io/update-strategy
to "AdvancedRollingUpdate" or "OTA" and set .spec.updateStrategy.type
to "OnDelete".