Skip to content

Commit ad2d263

Browse files
committed
Convert to DaemonSet and fix update strategy of ovnkube-identity pods
Ovnkube-identity pods should run on all control-plane nodes and require that a newly created pod is fully functional before the old one can be terminated and hence require additional pods during upgrades Signed-off-by: nithyar <[email protected]>
1 parent bce9c1b commit ad2d263

File tree

3 files changed

+17
-57
lines changed

3 files changed

+17
-57
lines changed

dist/templates/ovnkube-identity.yaml.j2

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
# ovnkube-identity
22
# starts ovnkube-identity
33
# it is run on the master(s).
4-
kind: Deployment
4+
kind: DaemonSet
55
apiVersion: apps/v1
66
metadata:
77
name: ovnkube-identity
88
# namespace set up by install
99
namespace: ovn-kubernetes
1010
annotations:
1111
kubernetes.io/description: |
12-
This Deployment launches the ovnkube-identity networking component.
12+
This DaemonSet launches the ovnkube-identity networking component on control-plane nodes.
1313
spec:
14-
progressDeadlineSeconds: 600
15-
replicas: {{ ovn_master_count | default(1|int) }}
1614
revisionHistoryLimit: 10
1715
selector:
1816
matchLabels:
1917
name: ovnkube-identity
20-
strategy:
18+
updateStrategy:
2119
rollingUpdate:
22-
maxSurge: 0
23-
maxUnavailable: 1
20+
maxSurge: 100%
21+
maxUnavailable: 0
2422
type: RollingUpdate
2523
template:
2624
metadata:
@@ -35,20 +33,9 @@ spec:
3533
serviceAccountName: ovnkube-identity
3634
hostNetwork: true
3735
dnsPolicy: Default
38-
39-
# required to be scheduled on a linux node with node-role.kubernetes.io/control-plane label and
40-
# only one instance of ovnkube-control-plane pod per node
41-
affinity:
42-
nodeAffinity:
43-
requiredDuringSchedulingIgnoredDuringExecution:
44-
nodeSelectorTerms:
45-
- matchExpressions:
46-
- key: node-role.kubernetes.io/control-plane
47-
operator: Exists
48-
- key: kubernetes.io/os
49-
operator: In
50-
values:
51-
- "linux"
36+
nodeSelector:
37+
node-role.kubernetes.io/control-plane: ""
38+
kubernetes.io/os: "linux"
5239
containers:
5340
- name: ovnkube-identity
5441
image: "{{ ovn_image | default('docker.io/ovnkube/ovn-daemonset:latest') }}"

helm/ovn-kubernetes/charts/ovnkube-identity/templates/ovnkube-identity.yaml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@
22
# ovnkube-identity
33
# starts ovnkube-identity
44
# it is run on the master(s).
5-
kind: Deployment
5+
kind: DaemonSet
66
apiVersion: apps/v1
77
metadata:
88
name: ovnkube-identity
99
# namespace set up by install
1010
namespace: ovn-kubernetes
1111
annotations:
1212
kubernetes.io/description: |
13-
This Deployment launches the ovnkube-identity networking component.
13+
This DaemonSet launches the ovnkube-identity networking component on control-plane nodes.
1414
spec:
15-
progressDeadlineSeconds: 600
16-
replicas: {{ default 1 .Values.replicas }}
1715
revisionHistoryLimit: 10
1816
selector:
1917
matchLabels:
2018
name: ovnkube-identity
21-
strategy:
19+
updateStrategy:
2220
rollingUpdate:
23-
maxSurge: 0
24-
maxUnavailable: 1
21+
maxSurge: 100%
22+
maxUnavailable: 0
2523
type: RollingUpdate
2624
template:
2725
metadata:
@@ -40,9 +38,9 @@ spec:
4038
serviceAccountName: ovnkube-identity
4139
hostNetwork: true
4240
dnsPolicy: Default
43-
{{- if .Values.affinity }}
44-
affinity: {{ toYaml .Values.affinity | nindent 8 }}
45-
{{- end }}
41+
nodeSelector:
42+
node-role.kubernetes.io/control-plane: ""
43+
kubernetes.io/os: "linux"
4644
containers:
4745
- name: ovnkube-identity
4846
image: {{ include "getImage" . }}
@@ -78,4 +76,4 @@ spec:
7876
secretName: ovnkube-webhook-cert
7977
tolerations:
8078
- operator: "Exists"
81-
{{- end }}
79+
{{- end }}
Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,4 @@
1-
replicas: 1
21
logLevel: 4
32
logFileMaxSize: 100
43
logFileMaxBackups: 5
54
logFileMaxAge: 5
6-
7-
## Affinity for pod assignment
8-
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
9-
## Required to be scheduled on a linux node and only one instance of ovnkube-identity pod per node
10-
affinity:
11-
nodeAffinity:
12-
requiredDuringSchedulingIgnoredDuringExecution:
13-
nodeSelectorTerms:
14-
- matchExpressions:
15-
- key: node-role.kubernetes.io/control-plane
16-
operator: Exists
17-
- key: kubernetes.io/os
18-
operator: In
19-
values:
20-
- "linux"
21-
podAntiAffinity:
22-
requiredDuringSchedulingIgnoredDuringExecution:
23-
- labelSelector:
24-
matchExpressions:
25-
- key: name
26-
operator: In
27-
values:
28-
- ovnkube-identity
29-
topologyKey: kubernetes.io/hostname

0 commit comments

Comments
 (0)