Skip to content

Commit f50fdab

Browse files
authored
Merge pull request #2210 from justaugustus/bullseye
images: Build bullseye variants (part two)
2 parents 8fb7e52 + a639b11 commit f50fdab

File tree

7 files changed

+142
-31
lines changed

7 files changed

+142
-31
lines changed

dependencies.yaml

+39-29
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,8 @@ dependencies:
360360
match: OS_CODENAME\ \?=\ (bullseye|buster)
361361
- path: images/build/cross/variants.yaml
362362
match: "OS_CODENAME: '(bullseye|buster)'"
363-
# TODO(codename): Uncomment once bullseye is default
364-
#- path: images/build/debian-base/Makefile
365-
# match: CONFIG\ \?=\ (bullseye|buster)
363+
- path: images/build/debian-base/Makefile
364+
match: CONFIG\ \?=\ (bullseye|buster)
366365
- path: images/build/debian-base/variants.yaml
367366
match: "CONFIG: '(bullseye|buster)'"
368367
- path: images/build/debian-iptables/Makefile
@@ -387,74 +386,85 @@ dependencies:
387386
- path: packages/deb/Dockerfile
388387
match: FROM golang:\d+.\d+(alpha|beta|rc)?\.?(\d+)-(bullseye|buster)
389388

390-
- name: "Debian: codename (next)"
389+
- name: "Debian: codename (next candidate)"
391390
version: bullseye
392391
refPaths:
392+
# TODO(bullseye): Uncomment as part of https://github.com/kubernetes/release/pull/2249
393+
#- path: images/build/cross/variants.yaml
394+
# match: "OS_CODENAME: '(bullseye|buster)'"
393395
- path: images/build/debian-base/variants.yaml
394396
match: "CONFIG: '(bullseye|buster)'"
397+
- path: images/build/go-runner/variants.yaml
398+
match: "OS_CODENAME: '(bullseye|buster)'"
399+
- path: images/releng/ci/variants.yaml
400+
match: "OS_CODENAME: '(bullseye|buster)'"
401+
# TODO(bullseye): Uncomment as part of https://github.com/kubernetes/release/pull/2249
402+
#- path: images/releng/k8s-ci-builder/variants.yaml
403+
# match: "OS_CODENAME: '(bullseye|buster)'"
395404

396405
- name: "k8s.gcr.io/build-image/debian-base"
397-
version: bullseye-v1.0.0
406+
version: buster-v1.9.0
398407
refPaths:
399408
- path: images/build/debian-base/Makefile
400-
match: IMAGE_VERSION\ \?=\ [a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
409+
match: IMAGE_VERSION\ \?=\ (bullseye|buster)-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
401410
- path: images/build/debian-base/variants.yaml
402-
match: '[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
411+
match: "IMAGE_VERSION: '(bullseye|buster)-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"
403412

404413
- name: "k8s.gcr.io/build-image/debian-base: dependents"
405414
version: buster-v1.9.0
406415
refPaths:
407416
- path: images/build/debian-iptables/Makefile
408-
match: DEBIAN_BASE_VERSION\ \?=\ [a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
417+
match: DEBIAN_BASE_VERSION\ \?=\ (bullseye|buster)-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
409418
- path: images/build/debian-iptables/variants.yaml
410-
match: '[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
419+
match: "DEBIAN_BASE_VERSION: '(bullseye|buster)-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"
411420
- path: images/build/setcap/Makefile
412-
match: DEBIAN_BASE_VERSION\ \?=\ [a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
421+
match: DEBIAN_BASE_VERSION\ \?=\ (bullseye|buster)-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
413422
- path: images/build/setcap/variants.yaml
414-
match: '[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
423+
match: "DEBIAN_BASE_VERSION: '(bullseye|buster)-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"
415424

416425
- name: "k8s.gcr.io/build-image/debian-iptables"
417426
version: buster-v1.6.7
418427
refPaths:
419428
- path: images/build/debian-iptables/Makefile
420-
match: IMAGE_VERSION\ \?=\ [a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
429+
match: IMAGE_VERSION\ \?=\ (bullseye|buster)-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
421430
- path: images/build/debian-iptables/variants.yaml
422-
match: '[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
431+
match: "IMAGE_VERSION: '(bullseye|buster)-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"
423432

424433
- name: "k8s.gcr.io/build-image/setcap"
425434
version: buster-v2.0.4
426435
refPaths:
427436
- path: images/build/setcap/Makefile
428-
match: IMAGE_VERSION\ \?=\ [a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
437+
match: IMAGE_VERSION\ \?=\ (bullseye|buster)-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
429438
- path: images/build/setcap/variants.yaml
430-
match: '[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
439+
match: "IMAGE_VERSION: '(bullseye|buster)-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"
431440

432-
# Base images (for previous release branches)
433-
- name: "k8s.gcr.io/build-image/debian-base (for previous release branches)"
434-
version: buster-v1.9.0
441+
# Base images (next candidate)
442+
- name: "k8s.gcr.io/build-image/debian-base (next candidate)"
443+
version: bullseye-v1.0.0
435444
refPaths:
436445
- path: images/build/debian-base/variants.yaml
437-
match: '[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
446+
match: "IMAGE_VERSION: '(bullseye|buster)-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"
438447

439-
- name: "k8s.gcr.io/build-image/debian-base: dependents (for previous release branches)"
440-
version: buster-v1.9.0
448+
- name: "k8s.gcr.io/build-image/debian-base: dependents (next candidate)"
449+
version: bullseye-v1.0.0
441450
refPaths:
442451
- path: images/build/debian-iptables/variants.yaml
443-
match: '[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
444-
- path: images/build/setcap/variants.yaml
445-
match: '[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
452+
match: "DEBIAN_BASE_VERSION: '(bullseye|buster)-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"
453+
# TODO(bullseye): Uncomment as part of https://github.com/kubernetes/release/pull/2249
454+
#- path: images/build/setcap/variants.yaml
455+
# match: "DEBIAN_BASE_VERSION: '(bullseye|buster)-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"
446456

447-
- name: "k8s.gcr.io/build-image/debian-iptables (for previous release branches)"
448-
version: buster-v1.6.7
457+
- name: "k8s.gcr.io/build-image/debian-iptables (next candidate)"
458+
version: bullseye-v1.0.0
449459
refPaths:
450460
- path: images/build/debian-iptables/variants.yaml
451-
match: '[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
461+
match: "IMAGE_VERSION: '(bullseye|buster)-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"
452462

453-
- name: "k8s.gcr.io/build-image/setcap (for previous release branches)"
463+
- name: "k8s.gcr.io/build-image/setcap (next candidate)"
454464
version: buster-v2.0.4
455465
refPaths:
456466
- path: images/build/setcap/variants.yaml
457-
match: '[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)'
467+
match: "IMAGE_VERSION: '(bullseye|buster)-v((([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?)'"
458468

459469
# Build environments
460470
- name: "gcr.io/k8s-testimages/gcb-docker-gcloud"

images/build/debian-base/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ IMAGE ?= $(REGISTRY)/debian-base
1919
BUILD_IMAGE ?= debian-build
2020

2121
TAG ?= $(shell git describe --tags --always --dirty)
22-
IMAGE_VERSION ?= bullseye-v1.0.0
23-
CONFIG ?= bullseye
22+
IMAGE_VERSION ?= buster-v1.9.0
23+
CONFIG ?= buster
2424

2525
TAR_FILE ?= rootfs.tar
2626
ARCH ?= amd64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright 2021 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
ARG BASEIMAGE
16+
17+
FROM ${BASEIMAGE} as build
18+
19+
# Install other dependencies and then clean up apt caches
20+
RUN clean-install \
21+
conntrack \
22+
ebtables \
23+
ipset \
24+
iptables \
25+
kmod \
26+
netbase
27+
28+
# Install iptables wrapper scripts to detect the correct iptables mode
29+
# the first time any of them is run
30+
COPY iptables-wrapper /usr/sbin/iptables-wrapper
31+
32+
RUN update-alternatives \
33+
--install /usr/sbin/iptables iptables /usr/sbin/iptables-wrapper 100 \
34+
--slave /usr/sbin/iptables-restore iptables-restore /usr/sbin/iptables-wrapper \
35+
--slave /usr/sbin/iptables-save iptables-save /usr/sbin/iptables-wrapper
36+
RUN update-alternatives \
37+
--install /usr/sbin/ip6tables ip6tables /usr/sbin/iptables-wrapper 100 \
38+
--slave /usr/sbin/ip6tables-restore ip6tables-restore /usr/sbin/iptables-wrapper \
39+
--slave /usr/sbin/ip6tables-save ip6tables-save /usr/sbin/iptables-wrapper
40+
41+
FROM scratch
42+
COPY --from=build / /
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
3+
# Copyright 2021 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -e
18+
19+
# Detect whether the base system is using iptables-legacy or
20+
# iptables-nft. This assumes that some non-containerized process (eg
21+
# kubelet) has already created some iptables rules.
22+
23+
# Bugs in iptables-nft 1.8.3 may cause it to get stuck in a loop in
24+
# some circumstances, so we have to run the nft check in a timeout. To
25+
# avoid hitting that timeout, we only bother to even check nft if
26+
# legacy iptables was empty / mostly empty.
27+
28+
num_legacy_lines=$( (iptables-legacy-save || true; ip6tables-legacy-save || true) 2>/dev/null | grep '^-' | wc -l || true)
29+
num_nft_lines=$( (timeout 5 sh -c "iptables-nft-save; ip6tables-nft-save" || true) 2>/dev/null | grep '^-' | wc -l || true)
30+
if [ "${num_legacy_lines}" -ge "${num_nft_lines}" ]; then
31+
mode=legacy
32+
else
33+
mode=nft
34+
fi
35+
36+
update-alternatives --set iptables "/usr/sbin/iptables-${mode}" > /dev/null
37+
update-alternatives --set ip6tables "/usr/sbin/ip6tables-${mode}" > /dev/null
38+
39+
# Now re-exec the original command with the newly-selected alternative
40+
exec "$0" "$@"

images/build/debian-iptables/variants.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
variants:
2+
# Debian 11 - Kubernetes 1.23 and newer
3+
bullseye:
4+
CONFIG: 'bullseye'
5+
IMAGE_VERSION: 'bullseye-v1.0.0'
6+
DEBIAN_BASE_VERSION: 'bullseye-v1.0.0'
7+
# Debian 10 - Kubernetes 1.22 and older
28
buster:
39
CONFIG: 'buster'
410
IMAGE_VERSION: 'buster-v1.6.7'

images/build/go-runner/variants.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
variants:
2+
go1.17-bullseye:
3+
CONFIG: 'go1.17-bullseye'
4+
IMAGE_VERSION: 'v2.3.1-go1.17.1-bullseye.0'
5+
GO_MAJOR_VERSION: '1.17'
6+
OS_CODENAME: 'bullseye'
7+
REVISION: '0'
8+
GO_VERSION: '1.17.1'
9+
DISTROLESS_IMAGE: 'static-debian11'
210
go1.17-buster:
311
CONFIG: 'go1.17-buster'
412
IMAGE_VERSION: 'v2.3.1-go1.17.1-buster.0'

images/releng/ci/variants.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
variants:
2+
go1.17-bullseye:
3+
CONFIG: 'go1.17-bullseye'
4+
GO_VERSION: '1.17.1'
5+
OS_CODENAME: 'bullseye'
6+
REVISION: '0'
27
go1.17-buster:
38
CONFIG: 'go1.17-buster'
49
GO_VERSION: '1.17.1'

0 commit comments

Comments
 (0)