Skip to content

Commit 69b02b9

Browse files
authored
Merge pull request #18290 from hakman/bump-etcd
etcd-manager: Bump etcd patches and drop 3.4 support
2 parents 858df38 + 7b6c5c8 commit 69b02b9

450 files changed

Lines changed: 9563 additions & 7615 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pkg/model/components/etcd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ type EtcdOptionsBuilder struct {
2929
var _ loader.ClusterOptionsBuilder = &EtcdOptionsBuilder{}
3030

3131
const (
32-
DefaultEtcd3Version_1_22 = "3.5.25"
33-
DefaultEtcd3Version_1_34 = "3.6.6"
32+
DefaultEtcd3Version_1_22 = "3.5.30"
33+
DefaultEtcd3Version_1_34 = "3.6.11"
3434
)
3535

3636
// BuildOptions is responsible for filling in the defaults for the etcd cluster model

pkg/model/components/etcdmanager/options.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"sort"
2222
"strings"
2323

24+
"github.com/blang/semver/v4"
2425
"k8s.io/klog/v2"
2526
"k8s.io/kops/pkg/apis/kops"
2627
"k8s.io/kops/pkg/featureflag"
@@ -89,36 +90,35 @@ type etcdVersion struct {
8990
SymlinkToVersion string
9091
}
9192

92-
var etcdSupportedImages = []etcdVersion{
93-
{Version: "3.4.3", SymlinkToVersion: "3.4.13"},
94-
{Version: "3.4.13", Image: "registry.k8s.io/etcd:v3.4.13"},
95-
{Version: "3.5.0", SymlinkToVersion: "3.5.25"},
96-
{Version: "3.5.1", SymlinkToVersion: "3.5.25"},
97-
{Version: "3.5.3", SymlinkToVersion: "3.5.25"},
98-
{Version: "3.5.4", SymlinkToVersion: "3.5.25"},
99-
{Version: "3.5.6", SymlinkToVersion: "3.5.25"},
100-
{Version: "3.5.7", SymlinkToVersion: "3.5.25"},
101-
{Version: "3.5.9", SymlinkToVersion: "3.5.25"},
102-
{Version: "3.5.13", SymlinkToVersion: "3.5.25"},
103-
{Version: "3.5.17", SymlinkToVersion: "3.5.25"},
104-
{Version: "3.5.21", SymlinkToVersion: "3.5.25"},
105-
{Version: "3.5.23", SymlinkToVersion: "3.5.25"},
106-
{Version: "3.5.24", SymlinkToVersion: "3.5.25"},
107-
{Version: "3.5.25", Image: "registry.k8s.io/etcd:v3.5.25"},
108-
{Version: "3.6.5", SymlinkToVersion: "3.6.6"},
109-
{Version: "3.6.6", Image: "registry.k8s.io/etcd:v3.6.6"},
93+
// etcdLatestImages lists the latest etcd patch image bundled by kops for each
94+
// supported minor. All earlier patch versions within the same minor are
95+
// generated as SymlinkToVersion entries by etcdSupportedVersions.
96+
var etcdLatestImages = []etcdVersion{
97+
{Version: "3.5.30", Image: "registry.k8s.io/etcd:v3.5.30"},
98+
{Version: "3.6.11", Image: "registry.k8s.io/etcd:v3.6.11"},
11099
}
111100

112101
func etcdSupportedVersions() []etcdVersion {
113102
var versions []etcdVersion
114-
versions = append(versions, etcdSupportedImages...)
115-
sort.Slice(versions, func(i, j int) bool { return versions[i].Version < versions[j].Version })
103+
for _, latest := range etcdLatestImages {
104+
sv := semver.MustParse(latest.Version)
105+
versions = append(versions, latest)
106+
for patch := uint64(0); patch < sv.Patch; patch++ {
107+
versions = append(versions, etcdVersion{
108+
Version: fmt.Sprintf("%d.%d.%d", sv.Major, sv.Minor, patch),
109+
SymlinkToVersion: latest.Version,
110+
})
111+
}
112+
}
113+
sort.Slice(versions, func(i, j int) bool {
114+
return semver.MustParse(versions[i].Version).LT(semver.MustParse(versions[j].Version))
115+
})
116116
return versions
117117
}
118118

119119
func etcdVersionIsSupported(version string) bool {
120120
version = strings.TrimPrefix(version, "v")
121-
for _, etcdVersion := range etcdSupportedImages {
121+
for _, etcdVersion := range etcdSupportedVersions() {
122122
if etcdVersion.Version == version {
123123
return true
124124
}

pkg/model/components/etcdmanager/tests/interval/tasks.yaml

Lines changed: 80 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -119,50 +119,25 @@ Contents: |
119119
- mountPath: /opt
120120
name: opt
121121
- args:
122-
- --target-dir=/opt/etcd-v3.4.13
122+
- --target-dir=/opt/etcd-v3.5.30
123123
- --src=/usr/local/bin/etcd
124124
- --src=/usr/local/bin/etcdctl
125125
command:
126126
- /opt/kops-utils/kops-utils-cp
127-
image: registry.k8s.io/etcd:v3.4.13
128-
name: init-etcd-3-4-13
127+
image: registry.k8s.io/etcd:v3.5.30
128+
name: init-etcd-3-5-30
129129
resources: {}
130130
volumeMounts:
131131
- mountPath: /opt
132132
name: opt
133133
- args:
134-
- --target-dir=/opt/etcd-v3.5.25
135-
- --src=/usr/local/bin/etcd
136-
- --src=/usr/local/bin/etcdctl
137-
command:
138-
- /opt/kops-utils/kops-utils-cp
139-
image: registry.k8s.io/etcd:v3.5.25
140-
name: init-etcd-3-5-25
141-
resources: {}
142-
volumeMounts:
143-
- mountPath: /opt
144-
name: opt
145-
- args:
146-
- --target-dir=/opt/etcd-v3.6.6
134+
- --target-dir=/opt/etcd-v3.6.11
147135
- --src=/usr/local/bin/etcd
148136
- --src=/usr/local/bin/etcdctl
149137
command:
150138
- /opt/kops-utils/kops-utils-cp
151-
image: registry.k8s.io/etcd:v3.6.6
152-
name: init-etcd-3-6-6
153-
resources: {}
154-
volumeMounts:
155-
- mountPath: /opt
156-
name: opt
157-
- args:
158-
- --symlink
159-
- --target-dir=/opt/etcd-v3.4.3
160-
- --src=/opt/etcd-v3.4.13/etcd
161-
- --src=/opt/etcd-v3.4.13/etcdctl
162-
command:
163-
- /opt/kops-utils/kops-utils-cp
164-
image: registry.k8s.io/kops/kops-utils-cp:1.35.0-beta.1
165-
name: init-etcd-symlinks-3-4-13
139+
image: registry.k8s.io/etcd:v3.6.11
140+
name: init-etcd-3-6-11
166141
resources: {}
167142
volumeMounts:
168143
- mountPath: /opt
@@ -171,35 +146,63 @@ Contents: |
171146
- --symlink
172147
- --target-dir=/opt/etcd-v3.5.0
173148
- --target-dir=/opt/etcd-v3.5.1
149+
- --target-dir=/opt/etcd-v3.5.10
150+
- --target-dir=/opt/etcd-v3.5.11
151+
- --target-dir=/opt/etcd-v3.5.12
174152
- --target-dir=/opt/etcd-v3.5.13
153+
- --target-dir=/opt/etcd-v3.5.14
154+
- --target-dir=/opt/etcd-v3.5.15
155+
- --target-dir=/opt/etcd-v3.5.16
175156
- --target-dir=/opt/etcd-v3.5.17
157+
- --target-dir=/opt/etcd-v3.5.18
158+
- --target-dir=/opt/etcd-v3.5.19
159+
- --target-dir=/opt/etcd-v3.5.2
160+
- --target-dir=/opt/etcd-v3.5.20
176161
- --target-dir=/opt/etcd-v3.5.21
162+
- --target-dir=/opt/etcd-v3.5.22
177163
- --target-dir=/opt/etcd-v3.5.23
178164
- --target-dir=/opt/etcd-v3.5.24
165+
- --target-dir=/opt/etcd-v3.5.25
166+
- --target-dir=/opt/etcd-v3.5.26
167+
- --target-dir=/opt/etcd-v3.5.27
168+
- --target-dir=/opt/etcd-v3.5.28
169+
- --target-dir=/opt/etcd-v3.5.29
179170
- --target-dir=/opt/etcd-v3.5.3
180171
- --target-dir=/opt/etcd-v3.5.4
172+
- --target-dir=/opt/etcd-v3.5.5
181173
- --target-dir=/opt/etcd-v3.5.6
182174
- --target-dir=/opt/etcd-v3.5.7
175+
- --target-dir=/opt/etcd-v3.5.8
183176
- --target-dir=/opt/etcd-v3.5.9
184-
- --src=/opt/etcd-v3.5.25/etcd
185-
- --src=/opt/etcd-v3.5.25/etcdctl
177+
- --src=/opt/etcd-v3.5.30/etcd
178+
- --src=/opt/etcd-v3.5.30/etcdctl
186179
command:
187180
- /opt/kops-utils/kops-utils-cp
188181
image: registry.k8s.io/kops/kops-utils-cp:1.35.0-beta.1
189-
name: init-etcd-symlinks-3-5-25
182+
name: init-etcd-symlinks-3-5-30
190183
resources: {}
191184
volumeMounts:
192185
- mountPath: /opt
193186
name: opt
194187
- args:
195188
- --symlink
189+
- --target-dir=/opt/etcd-v3.6.0
190+
- --target-dir=/opt/etcd-v3.6.1
191+
- --target-dir=/opt/etcd-v3.6.10
192+
- --target-dir=/opt/etcd-v3.6.2
193+
- --target-dir=/opt/etcd-v3.6.3
194+
- --target-dir=/opt/etcd-v3.6.4
196195
- --target-dir=/opt/etcd-v3.6.5
197-
- --src=/opt/etcd-v3.6.6/etcd
198-
- --src=/opt/etcd-v3.6.6/etcdctl
196+
- --target-dir=/opt/etcd-v3.6.6
197+
- --target-dir=/opt/etcd-v3.6.7
198+
- --target-dir=/opt/etcd-v3.6.8
199+
- --target-dir=/opt/etcd-v3.6.9
200+
- --src=/opt/etcd-v3.6.11/etcd
201+
- --src=/opt/etcd-v3.6.11/etcdctl
199202
command:
200203
- /opt/kops-utils/kops-utils-cp
201204
image: registry.k8s.io/kops/kops-utils-cp:1.35.0-beta.1
202-
name: init-etcd-symlinks-3-6-6
205+
name: init-etcd-symlinks-3-6-11
203206
resources: {}
204207
volumeMounts:
205208
- mountPath: /opt
@@ -289,50 +292,25 @@ Contents: |
289292
- mountPath: /opt
290293
name: opt
291294
- args:
292-
- --target-dir=/opt/etcd-v3.4.13
295+
- --target-dir=/opt/etcd-v3.5.30
293296
- --src=/usr/local/bin/etcd
294297
- --src=/usr/local/bin/etcdctl
295298
command:
296299
- /opt/kops-utils/kops-utils-cp
297-
image: registry.k8s.io/etcd:v3.4.13
298-
name: init-etcd-3-4-13
300+
image: registry.k8s.io/etcd:v3.5.30
301+
name: init-etcd-3-5-30
299302
resources: {}
300303
volumeMounts:
301304
- mountPath: /opt
302305
name: opt
303306
- args:
304-
- --target-dir=/opt/etcd-v3.5.25
305-
- --src=/usr/local/bin/etcd
306-
- --src=/usr/local/bin/etcdctl
307-
command:
308-
- /opt/kops-utils/kops-utils-cp
309-
image: registry.k8s.io/etcd:v3.5.25
310-
name: init-etcd-3-5-25
311-
resources: {}
312-
volumeMounts:
313-
- mountPath: /opt
314-
name: opt
315-
- args:
316-
- --target-dir=/opt/etcd-v3.6.6
307+
- --target-dir=/opt/etcd-v3.6.11
317308
- --src=/usr/local/bin/etcd
318309
- --src=/usr/local/bin/etcdctl
319310
command:
320311
- /opt/kops-utils/kops-utils-cp
321-
image: registry.k8s.io/etcd:v3.6.6
322-
name: init-etcd-3-6-6
323-
resources: {}
324-
volumeMounts:
325-
- mountPath: /opt
326-
name: opt
327-
- args:
328-
- --symlink
329-
- --target-dir=/opt/etcd-v3.4.3
330-
- --src=/opt/etcd-v3.4.13/etcd
331-
- --src=/opt/etcd-v3.4.13/etcdctl
332-
command:
333-
- /opt/kops-utils/kops-utils-cp
334-
image: registry.k8s.io/kops/kops-utils-cp:1.35.0-beta.1
335-
name: init-etcd-symlinks-3-4-13
312+
image: registry.k8s.io/etcd:v3.6.11
313+
name: init-etcd-3-6-11
336314
resources: {}
337315
volumeMounts:
338316
- mountPath: /opt
@@ -341,35 +319,63 @@ Contents: |
341319
- --symlink
342320
- --target-dir=/opt/etcd-v3.5.0
343321
- --target-dir=/opt/etcd-v3.5.1
322+
- --target-dir=/opt/etcd-v3.5.10
323+
- --target-dir=/opt/etcd-v3.5.11
324+
- --target-dir=/opt/etcd-v3.5.12
344325
- --target-dir=/opt/etcd-v3.5.13
326+
- --target-dir=/opt/etcd-v3.5.14
327+
- --target-dir=/opt/etcd-v3.5.15
328+
- --target-dir=/opt/etcd-v3.5.16
345329
- --target-dir=/opt/etcd-v3.5.17
330+
- --target-dir=/opt/etcd-v3.5.18
331+
- --target-dir=/opt/etcd-v3.5.19
332+
- --target-dir=/opt/etcd-v3.5.2
333+
- --target-dir=/opt/etcd-v3.5.20
346334
- --target-dir=/opt/etcd-v3.5.21
335+
- --target-dir=/opt/etcd-v3.5.22
347336
- --target-dir=/opt/etcd-v3.5.23
348337
- --target-dir=/opt/etcd-v3.5.24
338+
- --target-dir=/opt/etcd-v3.5.25
339+
- --target-dir=/opt/etcd-v3.5.26
340+
- --target-dir=/opt/etcd-v3.5.27
341+
- --target-dir=/opt/etcd-v3.5.28
342+
- --target-dir=/opt/etcd-v3.5.29
349343
- --target-dir=/opt/etcd-v3.5.3
350344
- --target-dir=/opt/etcd-v3.5.4
345+
- --target-dir=/opt/etcd-v3.5.5
351346
- --target-dir=/opt/etcd-v3.5.6
352347
- --target-dir=/opt/etcd-v3.5.7
348+
- --target-dir=/opt/etcd-v3.5.8
353349
- --target-dir=/opt/etcd-v3.5.9
354-
- --src=/opt/etcd-v3.5.25/etcd
355-
- --src=/opt/etcd-v3.5.25/etcdctl
350+
- --src=/opt/etcd-v3.5.30/etcd
351+
- --src=/opt/etcd-v3.5.30/etcdctl
356352
command:
357353
- /opt/kops-utils/kops-utils-cp
358354
image: registry.k8s.io/kops/kops-utils-cp:1.35.0-beta.1
359-
name: init-etcd-symlinks-3-5-25
355+
name: init-etcd-symlinks-3-5-30
360356
resources: {}
361357
volumeMounts:
362358
- mountPath: /opt
363359
name: opt
364360
- args:
365361
- --symlink
362+
- --target-dir=/opt/etcd-v3.6.0
363+
- --target-dir=/opt/etcd-v3.6.1
364+
- --target-dir=/opt/etcd-v3.6.10
365+
- --target-dir=/opt/etcd-v3.6.2
366+
- --target-dir=/opt/etcd-v3.6.3
367+
- --target-dir=/opt/etcd-v3.6.4
366368
- --target-dir=/opt/etcd-v3.6.5
367-
- --src=/opt/etcd-v3.6.6/etcd
368-
- --src=/opt/etcd-v3.6.6/etcdctl
369+
- --target-dir=/opt/etcd-v3.6.6
370+
- --target-dir=/opt/etcd-v3.6.7
371+
- --target-dir=/opt/etcd-v3.6.8
372+
- --target-dir=/opt/etcd-v3.6.9
373+
- --src=/opt/etcd-v3.6.11/etcd
374+
- --src=/opt/etcd-v3.6.11/etcdctl
369375
command:
370376
- /opt/kops-utils/kops-utils-cp
371377
image: registry.k8s.io/kops/kops-utils-cp:1.35.0-beta.1
372-
name: init-etcd-symlinks-3-6-6
378+
name: init-etcd-symlinks-3-6-11
373379
resources: {}
374380
volumeMounts:
375381
- mountPath: /opt

0 commit comments

Comments
 (0)