Skip to content

Commit 4f2ea96

Browse files
Merge pull request #1786 from hj-johannes-lee/PR-2024-002
add updateStrategy to daemonSets
2 parents a0b8e14 + ba9b012 commit 4f2ea96

File tree

15 files changed

+114
-0
lines changed

15 files changed

+114
-0
lines changed

deployments/dlb_plugin/base/intel-dlb-plugin.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ spec:
88
selector:
99
matchLabels:
1010
app: intel-dlb-plugin
11+
updateStrategy:
12+
type: RollingUpdate
13+
rollingUpdate:
14+
maxSurge: 0
15+
maxUnavailable: 1
1116
template:
1217
metadata:
1318
labels:

deployments/dsa_plugin/base/intel-dsa-plugin.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ spec:
88
selector:
99
matchLabels:
1010
app: intel-dsa-plugin
11+
updateStrategy:
12+
type: RollingUpdate
13+
rollingUpdate:
14+
maxSurge: 0
15+
maxUnavailable: 1
1116
template:
1217
metadata:
1318
labels:

deployments/fpga_plugin/base/intel-fpga-plugin-daemonset.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ spec:
99
selector:
1010
matchLabels:
1111
app: intel-fpga-plugin
12+
updateStrategy:
13+
type: RollingUpdate
14+
rollingUpdate:
15+
maxSurge: 0
16+
maxUnavailable: 1
1217
template:
1318
metadata:
1419
labels:

deployments/gpu_plugin/base/intel-gpu-plugin.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ spec:
88
selector:
99
matchLabels:
1010
app: intel-gpu-plugin
11+
updateStrategy:
12+
type: RollingUpdate
13+
rollingUpdate:
14+
maxSurge: 0
15+
maxUnavailable: 1
1116
template:
1217
metadata:
1318
labels:

deployments/iaa_plugin/base/intel-iaa-plugin.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ spec:
88
selector:
99
matchLabels:
1010
app: intel-iaa-plugin
11+
updateStrategy:
12+
type: RollingUpdate
13+
rollingUpdate:
14+
maxSurge: 0
15+
maxUnavailable: 1
1116
template:
1217
metadata:
1318
labels:

deployments/qat_plugin/base/intel-qat-kernel-plugin.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ spec:
88
selector:
99
matchLabels:
1010
app: intel-qat-kernel-plugin
11+
updateStrategy:
12+
type: RollingUpdate
13+
rollingUpdate:
14+
maxSurge: 0
15+
maxUnavailable: 1
1116
template:
1217
metadata:
1318
labels:

deployments/qat_plugin/base/intel-qat-plugin.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ spec:
1010
selector:
1111
matchLabels:
1212
app: intel-qat-plugin
13+
updateStrategy:
14+
type: RollingUpdate
15+
rollingUpdate:
16+
maxSurge: 0
17+
maxUnavailable: 1
1318
template:
1419
metadata:
1520
labels:

deployments/sgx_plugin/base/intel-sgx-plugin.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ spec:
88
selector:
99
matchLabels:
1010
app: intel-sgx-plugin
11+
updateStrategy:
12+
type: RollingUpdate
13+
rollingUpdate:
14+
maxSurge: 0
15+
maxUnavailable: 1
1116
template:
1217
metadata:
1318
labels:

pkg/controllers/dlb/controller_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
v1 "k8s.io/api/core/v1"
2424
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2525
"k8s.io/apimachinery/pkg/util/diff"
26+
"k8s.io/apimachinery/pkg/util/intstr"
2627
"sigs.k8s.io/controller-runtime/pkg/client"
2728

2829
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
3435
devicePlugin := rawObj.(*devicepluginv1.DlbDevicePlugin)
3536
yes := true
3637
no := false
38+
maxUnavailable := intstr.FromInt(1)
39+
maxSurge := intstr.FromInt(0)
3740

3841
daemonSet := apps.DaemonSet{
3942
TypeMeta: metav1.TypeMeta{
@@ -53,6 +56,13 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet
5356
"app": appLabel,
5457
},
5558
},
59+
UpdateStrategy: apps.DaemonSetUpdateStrategy{
60+
Type: "RollingUpdate",
61+
RollingUpdate: &apps.RollingUpdateDaemonSet{
62+
MaxUnavailable: &maxUnavailable,
63+
MaxSurge: &maxSurge,
64+
},
65+
},
5666
Template: v1.PodTemplateSpec{
5767
ObjectMeta: metav1.ObjectMeta{
5868
Labels: map[string]string{

pkg/controllers/dsa/controller_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
v1 "k8s.io/api/core/v1"
2323
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2424
"k8s.io/apimachinery/pkg/util/diff"
25+
"k8s.io/apimachinery/pkg/util/intstr"
2526
"sigs.k8s.io/controller-runtime/pkg/client"
2627

2728
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
3637

3738
yes := true
3839
no := false
40+
maxUnavailable := intstr.FromInt(1)
41+
maxSurge := intstr.FromInt(0)
42+
3943
daemonSet := apps.DaemonSet{
4044
TypeMeta: metav1.TypeMeta{
4145
Kind: "DaemonSet",
@@ -54,6 +58,13 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet
5458
"app": appLabel,
5559
},
5660
},
61+
UpdateStrategy: apps.DaemonSetUpdateStrategy{
62+
Type: "RollingUpdate",
63+
RollingUpdate: &apps.RollingUpdateDaemonSet{
64+
MaxUnavailable: &maxUnavailable,
65+
MaxSurge: &maxSurge,
66+
},
67+
},
5768
Template: v1.PodTemplateSpec{
5869
ObjectMeta: metav1.ObjectMeta{
5970
Labels: map[string]string{

0 commit comments

Comments
 (0)