diff --git a/deployments/dlb_plugin/base/intel-dlb-plugin.yaml b/deployments/dlb_plugin/base/intel-dlb-plugin.yaml index 354f3c9c5..79d3ecf1e 100644 --- a/deployments/dlb_plugin/base/intel-dlb-plugin.yaml +++ b/deployments/dlb_plugin/base/intel-dlb-plugin.yaml @@ -8,6 +8,11 @@ spec: selector: matchLabels: app: intel-dlb-plugin + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 template: metadata: labels: diff --git a/deployments/dsa_plugin/base/intel-dsa-plugin.yaml b/deployments/dsa_plugin/base/intel-dsa-plugin.yaml index d9089dc55..4e3acf780 100644 --- a/deployments/dsa_plugin/base/intel-dsa-plugin.yaml +++ b/deployments/dsa_plugin/base/intel-dsa-plugin.yaml @@ -8,6 +8,11 @@ spec: selector: matchLabels: app: intel-dsa-plugin + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 template: metadata: labels: diff --git a/deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml b/deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml index aa4d56239..787d4add5 100644 --- a/deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml +++ b/deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml @@ -9,6 +9,11 @@ spec: selector: matchLabels: app: intel-fpga-plugin + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 template: metadata: labels: diff --git a/deployments/gpu_plugin/base/intel-gpu-plugin.yaml b/deployments/gpu_plugin/base/intel-gpu-plugin.yaml index 30a6158d6..3092c4e45 100644 --- a/deployments/gpu_plugin/base/intel-gpu-plugin.yaml +++ b/deployments/gpu_plugin/base/intel-gpu-plugin.yaml @@ -8,6 +8,11 @@ spec: selector: matchLabels: app: intel-gpu-plugin + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 template: metadata: labels: diff --git a/deployments/iaa_plugin/base/intel-iaa-plugin.yaml b/deployments/iaa_plugin/base/intel-iaa-plugin.yaml index 6fd737c3f..3821a81a0 100644 --- a/deployments/iaa_plugin/base/intel-iaa-plugin.yaml +++ b/deployments/iaa_plugin/base/intel-iaa-plugin.yaml @@ -8,6 +8,11 @@ spec: selector: matchLabels: app: intel-iaa-plugin + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 template: metadata: labels: diff --git a/deployments/qat_plugin/base/intel-qat-kernel-plugin.yaml b/deployments/qat_plugin/base/intel-qat-kernel-plugin.yaml index 4b6f84477..bb7f7a0e4 100644 --- a/deployments/qat_plugin/base/intel-qat-kernel-plugin.yaml +++ b/deployments/qat_plugin/base/intel-qat-kernel-plugin.yaml @@ -8,6 +8,11 @@ spec: selector: matchLabels: app: intel-qat-kernel-plugin + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 template: metadata: labels: diff --git a/deployments/qat_plugin/base/intel-qat-plugin.yaml b/deployments/qat_plugin/base/intel-qat-plugin.yaml index 82858f119..4f4dbf74f 100644 --- a/deployments/qat_plugin/base/intel-qat-plugin.yaml +++ b/deployments/qat_plugin/base/intel-qat-plugin.yaml @@ -10,6 +10,11 @@ spec: selector: matchLabels: app: intel-qat-plugin + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 template: metadata: labels: diff --git a/deployments/sgx_plugin/base/intel-sgx-plugin.yaml b/deployments/sgx_plugin/base/intel-sgx-plugin.yaml index 9e4020289..078cbf3de 100644 --- a/deployments/sgx_plugin/base/intel-sgx-plugin.yaml +++ b/deployments/sgx_plugin/base/intel-sgx-plugin.yaml @@ -8,6 +8,11 @@ spec: selector: matchLabels: app: intel-sgx-plugin + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 0 + maxUnavailable: 1 template: metadata: labels: diff --git a/pkg/controllers/dlb/controller_test.go b/pkg/controllers/dlb/controller_test.go index 3bd7cf5bc..7a4ed7966 100644 --- a/pkg/controllers/dlb/controller_test.go +++ b/pkg/controllers/dlb/controller_test.go @@ -23,6 +23,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" + "k8s.io/apimachinery/pkg/util/intstr" "sigs.k8s.io/controller-runtime/pkg/client" devicepluginv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/deviceplugin/v1" @@ -34,6 +35,8 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet devicePlugin := rawObj.(*devicepluginv1.DlbDevicePlugin) yes := true no := false + maxUnavailable := intstr.FromInt(1) + maxSurge := intstr.FromInt(0) daemonSet := apps.DaemonSet{ TypeMeta: metav1.TypeMeta{ @@ -53,6 +56,13 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet "app": appLabel, }, }, + UpdateStrategy: apps.DaemonSetUpdateStrategy{ + Type: "RollingUpdate", + RollingUpdate: &apps.RollingUpdateDaemonSet{ + MaxUnavailable: &maxUnavailable, + MaxSurge: &maxSurge, + }, + }, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ diff --git a/pkg/controllers/dsa/controller_test.go b/pkg/controllers/dsa/controller_test.go index aa4120bec..370107a80 100644 --- a/pkg/controllers/dsa/controller_test.go +++ b/pkg/controllers/dsa/controller_test.go @@ -22,6 +22,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" + "k8s.io/apimachinery/pkg/util/intstr" "sigs.k8s.io/controller-runtime/pkg/client" devicepluginv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/deviceplugin/v1" @@ -36,6 +37,9 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet yes := true no := false + maxUnavailable := intstr.FromInt(1) + maxSurge := intstr.FromInt(0) + daemonSet := apps.DaemonSet{ TypeMeta: metav1.TypeMeta{ Kind: "DaemonSet", @@ -54,6 +58,13 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet "app": appLabel, }, }, + UpdateStrategy: apps.DaemonSetUpdateStrategy{ + Type: "RollingUpdate", + RollingUpdate: &apps.RollingUpdateDaemonSet{ + MaxUnavailable: &maxUnavailable, + MaxSurge: &maxSurge, + }, + }, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ diff --git a/pkg/controllers/fpga/controller_test.go b/pkg/controllers/fpga/controller_test.go index f4e2b5714..1471477bd 100644 --- a/pkg/controllers/fpga/controller_test.go +++ b/pkg/controllers/fpga/controller_test.go @@ -23,6 +23,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" + "k8s.io/apimachinery/pkg/util/intstr" "sigs.k8s.io/controller-runtime/pkg/client" devicepluginv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/deviceplugin/v1" @@ -37,6 +38,8 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet yes := true no := false directoryOrCreate := v1.HostPathDirectoryOrCreate + maxUnavailable := intstr.FromInt(1) + maxSurge := intstr.FromInt(0) return &apps.DaemonSet{ TypeMeta: metav1.TypeMeta{ @@ -56,6 +59,13 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet "app": appLabel, }, }, + UpdateStrategy: apps.DaemonSetUpdateStrategy{ + Type: "RollingUpdate", + RollingUpdate: &apps.RollingUpdateDaemonSet{ + MaxUnavailable: &maxUnavailable, + MaxSurge: &maxSurge, + }, + }, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ diff --git a/pkg/controllers/gpu/controller_test.go b/pkg/controllers/gpu/controller_test.go index ccdb7c30d..f244c8c4b 100644 --- a/pkg/controllers/gpu/controller_test.go +++ b/pkg/controllers/gpu/controller_test.go @@ -24,6 +24,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" + "k8s.io/apimachinery/pkg/util/intstr" "sigs.k8s.io/controller-runtime/pkg/client" devicepluginv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/deviceplugin/v1" @@ -38,6 +39,9 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet yes := true no := false + maxUnavailable := intstr.FromInt(1) + maxSurge := intstr.FromInt(0) + daemonSet := apps.DaemonSet{ TypeMeta: metav1.TypeMeta{ Kind: "DaemonSet", @@ -56,6 +60,13 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet "app": appLabel, }, }, + UpdateStrategy: apps.DaemonSetUpdateStrategy{ + Type: "RollingUpdate", + RollingUpdate: &apps.RollingUpdateDaemonSet{ + MaxUnavailable: &maxUnavailable, + MaxSurge: &maxSurge, + }, + }, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ diff --git a/pkg/controllers/iaa/controller_test.go b/pkg/controllers/iaa/controller_test.go index c47eaad92..fd4c91834 100644 --- a/pkg/controllers/iaa/controller_test.go +++ b/pkg/controllers/iaa/controller_test.go @@ -22,6 +22,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" + "k8s.io/apimachinery/pkg/util/intstr" "sigs.k8s.io/controller-runtime/pkg/client" devicepluginv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/deviceplugin/v1" @@ -36,6 +37,9 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet yes := true no := false + maxUnavailable := intstr.FromInt(1) + maxSurge := intstr.FromInt(0) + daemonSet := apps.DaemonSet{ TypeMeta: metav1.TypeMeta{ Kind: "DaemonSet", @@ -54,6 +58,13 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet "app": appLabel, }, }, + UpdateStrategy: apps.DaemonSetUpdateStrategy{ + Type: "RollingUpdate", + RollingUpdate: &apps.RollingUpdateDaemonSet{ + MaxUnavailable: &maxUnavailable, + MaxSurge: &maxSurge, + }, + }, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ diff --git a/pkg/controllers/qat/controller_test.go b/pkg/controllers/qat/controller_test.go index 3105e4e2b..fed489d3a 100644 --- a/pkg/controllers/qat/controller_test.go +++ b/pkg/controllers/qat/controller_test.go @@ -23,6 +23,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" + "k8s.io/apimachinery/pkg/util/intstr" "sigs.k8s.io/controller-runtime/pkg/client" devicepluginv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/deviceplugin/v1" @@ -38,6 +39,8 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet yes := true no := false pluginAnnotations := devicePlugin.ObjectMeta.DeepCopy().Annotations + maxUnavailable := intstr.FromInt(1) + maxSurge := intstr.FromInt(0) daemonSet := apps.DaemonSet{ TypeMeta: metav1.TypeMeta{ @@ -58,6 +61,13 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet "app": appLabel, }, }, + UpdateStrategy: apps.DaemonSetUpdateStrategy{ + Type: "RollingUpdate", + RollingUpdate: &apps.RollingUpdateDaemonSet{ + MaxUnavailable: &maxUnavailable, + MaxSurge: &maxSurge, + }, + }, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{ diff --git a/pkg/controllers/sgx/controller_test.go b/pkg/controllers/sgx/controller_test.go index eb7916ba6..971b5be86 100644 --- a/pkg/controllers/sgx/controller_test.go +++ b/pkg/controllers/sgx/controller_test.go @@ -23,6 +23,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/diff" + "k8s.io/apimachinery/pkg/util/intstr" "sigs.k8s.io/controller-runtime/pkg/client" devicepluginv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/deviceplugin/v1" @@ -38,6 +39,9 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet yes := true no := false charDevice := v1.HostPathCharDev + maxUnavailable := intstr.FromInt(1) + maxSurge := intstr.FromInt(0) + daemonSet := apps.DaemonSet{ TypeMeta: metav1.TypeMeta{ Kind: "DaemonSet", @@ -56,6 +60,13 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet "app": appLabel, }, }, + UpdateStrategy: apps.DaemonSetUpdateStrategy{ + Type: "RollingUpdate", + RollingUpdate: &apps.RollingUpdateDaemonSet{ + MaxUnavailable: &maxUnavailable, + MaxSurge: &maxSurge, + }, + }, Template: v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: map[string]string{