Skip to content

Commit 37f234e

Browse files
committed
Introduce multi-stage upgrade
`linkerd install` supports a 2-stage install process, `linkerd upgrade` did not. Add 2-stage support for `linkerd upgrade`. Also exercise multi-stage functionality during upgrade integration tests. Part of #2337 Signed-off-by: Andrew Seigner <siggy@buoyant.io>
1 parent 53bb7c4 commit 37f234e

13 files changed

Lines changed: 169 additions & 137 deletions

chart/templates/prometheus-rbac.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
### Prometheus RBAC
55
###
66
---
7-
kind: ServiceAccount
8-
apiVersion: v1
9-
metadata:
10-
name: linkerd-prometheus
11-
namespace: {{.Namespace}}
12-
---
137
kind: ClusterRole
148
apiVersion: rbac.authorization.k8s.io/v1beta1
159
metadata:
@@ -31,4 +25,10 @@ subjects:
3125
- kind: ServiceAccount
3226
name: linkerd-prometheus
3327
namespace: {{.Namespace}}
28+
---
29+
kind: ServiceAccount
30+
apiVersion: v1
31+
metadata:
32+
name: linkerd-prometheus
33+
namespace: {{.Namespace}}
3434
{{- end}}

chart/templates/proxy_injector-rbac.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
### Proxy Injector RBAC
55
###
66
---
7-
kind: ServiceAccount
8-
apiVersion: v1
9-
metadata:
10-
name: linkerd-proxy-injector
11-
namespace: {{.Namespace}}
12-
---
137
kind: ClusterRole
148
apiVersion: rbac.authorization.k8s.io/v1
159
metadata:
@@ -41,4 +35,10 @@ roleRef:
4135
kind: ClusterRole
4236
name: linkerd-{{.Namespace}}-proxy-injector
4337
apiGroup: rbac.authorization.k8s.io
38+
---
39+
kind: ServiceAccount
40+
apiVersion: v1
41+
metadata:
42+
name: linkerd-proxy-injector
43+
namespace: {{.Namespace}}
4444
{{end -}}

chart/templates/sp_validator-rbac.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
### Service Profile Validator RBAC
55
###
66
---
7-
kind: ServiceAccount
8-
apiVersion: v1
9-
metadata:
10-
name: linkerd-sp-validator
11-
namespace: {{.Namespace}}
12-
---
137
kind: ClusterRole
148
apiVersion: rbac.authorization.k8s.io/v1
159
metadata:
@@ -35,4 +29,10 @@ roleRef:
3529
kind: ClusterRole
3630
name: linkerd-{{.Namespace}}-sp-validator
3731
apiGroup: rbac.authorization.k8s.io
32+
---
33+
kind: ServiceAccount
34+
apiVersion: v1
35+
metadata:
36+
name: linkerd-sp-validator
37+
namespace: {{.Namespace}}
3838
{{end -}}

cli/cmd/testdata/install_config.golden

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ spec:
108108
### Prometheus RBAC
109109
###
110110
---
111-
kind: ServiceAccount
112-
apiVersion: v1
113-
metadata:
114-
name: linkerd-prometheus
115-
namespace: linkerd
116-
---
117111
kind: ClusterRole
118112
apiVersion: rbac.authorization.k8s.io/v1beta1
119113
metadata:
@@ -136,16 +130,16 @@ subjects:
136130
name: linkerd-prometheus
137131
namespace: linkerd
138132
---
139-
###
140-
### Proxy Injector RBAC
141-
###
142-
---
143133
kind: ServiceAccount
144134
apiVersion: v1
145135
metadata:
146-
name: linkerd-proxy-injector
136+
name: linkerd-prometheus
147137
namespace: linkerd
148138
---
139+
###
140+
### Proxy Injector RBAC
141+
###
142+
---
149143
kind: ClusterRole
150144
apiVersion: rbac.authorization.k8s.io/v1
151145
metadata:
@@ -178,16 +172,16 @@ roleRef:
178172
name: linkerd-linkerd-proxy-injector
179173
apiGroup: rbac.authorization.k8s.io
180174
---
181-
###
182-
### Service Profile Validator RBAC
183-
###
184-
---
185175
kind: ServiceAccount
186176
apiVersion: v1
187177
metadata:
188-
name: linkerd-sp-validator
178+
name: linkerd-proxy-injector
189179
namespace: linkerd
190180
---
181+
###
182+
### Service Profile Validator RBAC
183+
###
184+
---
191185
kind: ClusterRole
192186
apiVersion: rbac.authorization.k8s.io/v1
193187
metadata:
@@ -214,3 +208,9 @@ roleRef:
214208
name: linkerd-linkerd-sp-validator
215209
apiGroup: rbac.authorization.k8s.io
216210
---
211+
kind: ServiceAccount
212+
apiVersion: v1
213+
metadata:
214+
name: linkerd-sp-validator
215+
namespace: linkerd
216+
---

cli/cmd/testdata/install_default.golden

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ spec:
108108
### Prometheus RBAC
109109
###
110110
---
111-
kind: ServiceAccount
112-
apiVersion: v1
113-
metadata:
114-
name: linkerd-prometheus
115-
namespace: linkerd
116-
---
117111
kind: ClusterRole
118112
apiVersion: rbac.authorization.k8s.io/v1beta1
119113
metadata:
@@ -136,16 +130,16 @@ subjects:
136130
name: linkerd-prometheus
137131
namespace: linkerd
138132
---
139-
###
140-
### Proxy Injector RBAC
141-
###
142-
---
143133
kind: ServiceAccount
144134
apiVersion: v1
145135
metadata:
146-
name: linkerd-proxy-injector
136+
name: linkerd-prometheus
147137
namespace: linkerd
148138
---
139+
###
140+
### Proxy Injector RBAC
141+
###
142+
---
149143
kind: ClusterRole
150144
apiVersion: rbac.authorization.k8s.io/v1
151145
metadata:
@@ -178,16 +172,16 @@ roleRef:
178172
name: linkerd-linkerd-proxy-injector
179173
apiGroup: rbac.authorization.k8s.io
180174
---
181-
###
182-
### Service Profile Validator RBAC
183-
###
184-
---
185175
kind: ServiceAccount
186176
apiVersion: v1
187177
metadata:
188-
name: linkerd-sp-validator
178+
name: linkerd-proxy-injector
189179
namespace: linkerd
190180
---
181+
###
182+
### Service Profile Validator RBAC
183+
###
184+
---
191185
kind: ClusterRole
192186
apiVersion: rbac.authorization.k8s.io/v1
193187
metadata:
@@ -214,6 +208,12 @@ roleRef:
214208
name: linkerd-linkerd-sp-validator
215209
apiGroup: rbac.authorization.k8s.io
216210
---
211+
kind: ServiceAccount
212+
apiVersion: v1
213+
metadata:
214+
name: linkerd-sp-validator
215+
namespace: linkerd
216+
---
217217
kind: ConfigMap
218218
apiVersion: v1
219219
metadata:

cli/cmd/testdata/install_ha_output.golden

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ spec:
108108
### Prometheus RBAC
109109
###
110110
---
111-
kind: ServiceAccount
112-
apiVersion: v1
113-
metadata:
114-
name: linkerd-prometheus
115-
namespace: linkerd
116-
---
117111
kind: ClusterRole
118112
apiVersion: rbac.authorization.k8s.io/v1beta1
119113
metadata:
@@ -136,16 +130,16 @@ subjects:
136130
name: linkerd-prometheus
137131
namespace: linkerd
138132
---
139-
###
140-
### Proxy Injector RBAC
141-
###
142-
---
143133
kind: ServiceAccount
144134
apiVersion: v1
145135
metadata:
146-
name: linkerd-proxy-injector
136+
name: linkerd-prometheus
147137
namespace: linkerd
148138
---
139+
###
140+
### Proxy Injector RBAC
141+
###
142+
---
149143
kind: ClusterRole
150144
apiVersion: rbac.authorization.k8s.io/v1
151145
metadata:
@@ -178,16 +172,16 @@ roleRef:
178172
name: linkerd-linkerd-proxy-injector
179173
apiGroup: rbac.authorization.k8s.io
180174
---
181-
###
182-
### Service Profile Validator RBAC
183-
###
184-
---
185175
kind: ServiceAccount
186176
apiVersion: v1
187177
metadata:
188-
name: linkerd-sp-validator
178+
name: linkerd-proxy-injector
189179
namespace: linkerd
190180
---
181+
###
182+
### Service Profile Validator RBAC
183+
###
184+
---
191185
kind: ClusterRole
192186
apiVersion: rbac.authorization.k8s.io/v1
193187
metadata:
@@ -214,6 +208,12 @@ roleRef:
214208
name: linkerd-linkerd-sp-validator
215209
apiGroup: rbac.authorization.k8s.io
216210
---
211+
kind: ServiceAccount
212+
apiVersion: v1
213+
metadata:
214+
name: linkerd-sp-validator
215+
namespace: linkerd
216+
---
217217
kind: ConfigMap
218218
apiVersion: v1
219219
metadata:

cli/cmd/testdata/install_ha_with_overrides_output.golden

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,6 @@ spec:
108108
### Prometheus RBAC
109109
###
110110
---
111-
kind: ServiceAccount
112-
apiVersion: v1
113-
metadata:
114-
name: linkerd-prometheus
115-
namespace: linkerd
116-
---
117111
kind: ClusterRole
118112
apiVersion: rbac.authorization.k8s.io/v1beta1
119113
metadata:
@@ -136,16 +130,16 @@ subjects:
136130
name: linkerd-prometheus
137131
namespace: linkerd
138132
---
139-
###
140-
### Proxy Injector RBAC
141-
###
142-
---
143133
kind: ServiceAccount
144134
apiVersion: v1
145135
metadata:
146-
name: linkerd-proxy-injector
136+
name: linkerd-prometheus
147137
namespace: linkerd
148138
---
139+
###
140+
### Proxy Injector RBAC
141+
###
142+
---
149143
kind: ClusterRole
150144
apiVersion: rbac.authorization.k8s.io/v1
151145
metadata:
@@ -178,16 +172,16 @@ roleRef:
178172
name: linkerd-linkerd-proxy-injector
179173
apiGroup: rbac.authorization.k8s.io
180174
---
181-
###
182-
### Service Profile Validator RBAC
183-
###
184-
---
185175
kind: ServiceAccount
186176
apiVersion: v1
187177
metadata:
188-
name: linkerd-sp-validator
178+
name: linkerd-proxy-injector
189179
namespace: linkerd
190180
---
181+
###
182+
### Service Profile Validator RBAC
183+
###
184+
---
191185
kind: ClusterRole
192186
apiVersion: rbac.authorization.k8s.io/v1
193187
metadata:
@@ -214,6 +208,12 @@ roleRef:
214208
name: linkerd-linkerd-sp-validator
215209
apiGroup: rbac.authorization.k8s.io
216210
---
211+
kind: ServiceAccount
212+
apiVersion: v1
213+
metadata:
214+
name: linkerd-sp-validator
215+
namespace: linkerd
216+
---
217217
kind: ConfigMap
218218
apiVersion: v1
219219
metadata:

0 commit comments

Comments
 (0)