Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-1.27] Bump k3s for v1.27 #5270

Merged
merged 4 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
271 changes: 181 additions & 90 deletions go.mod

Large diffs are not rendered by default.

567 changes: 414 additions & 153 deletions go.sum

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions pkg/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ func Stage(resolver *images.Resolver, nodeConfig *daemonconfig.Node, cfg cmds.Ag
// If we didn't find the requested image in a tarball, pull it from the remote registry.
// Note that this will fail (potentially after a long delay) if the registry cannot be reached.
if img == nil {
registry, err := registries.GetPrivateRegistries(nodeConfig.AgentConfig.PrivateRegistry)
registry, err := registries.GetPrivateRegistries(cfg.PrivateRegistry)
if err != nil {
return "", errors.Wrapf(err, "failed to load private registry configuration from %s", nodeConfig.AgentConfig.PrivateRegistry)
return "", errors.Wrapf(err, "failed to load private registry configuration from %s", cfg.PrivateRegistry)
}
// Override registry config with version provided by (and potentially modified by) k3s agent setup
registry.Registry = nodeConfig.AgentConfig.Registry

// Try to enable Kubelet image credential provider plugins; fall back to legacy docker credentials
if agent.ImageCredProvAvailable(&nodeConfig.AgentConfig) {
Expand All @@ -124,6 +126,8 @@ func Stage(resolver *images.Resolver, nodeConfig *daemonconfig.Node, cfg cmds.Ag
}

logrus.Infof("Pulling runtime image %s", ref.Name())
// Make sure that the runtime image is also loaded into containerd
images.Pull(imagesDir, images.Runtime, ref)
img, err = registry.Image(ref, remote.WithPlatform(v1.Platform{Architecture: runtime.GOARCH, OS: runtime.GOOS}))
if err != nil {
return "", errors.Wrapf(err, "failed to get runtime image %s", ref.Name())
Expand Down
1 change: 1 addition & 0 deletions pkg/cli/cmds/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ var (
"image-credential-provider-config": copyFlag,
"docker": dropFlag,
"container-runtime-endpoint": copyFlag,
"disable-default-registry-endpoint": copyFlag,
"image-service-endpoint": dropFlag,
"pause-image": dropFlag,
"default-runtime": copyFlag,
Expand Down
2 changes: 2 additions & 0 deletions pkg/cli/cmds/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ var (
"image-credential-provider-config": copyFlag,
"docker": dropFlag,
"container-runtime-endpoint": copyFlag,
"disable-default-registry-endpoint": copyFlag,
"embedded-registry": copyFlag,
"image-service-endpoint": dropFlag,
"pause-image": dropFlag,
"default-runtime": copyFlag,
Expand Down
1 change: 1 addition & 0 deletions scripts/build-binary
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ VERSION_FLAGS="
-X ${K3S_PKG}/pkg/version.GitCommit=${REVISION}
-X ${K3S_PKG}/pkg/version.Program=${PROG}
-X ${K3S_PKG}/pkg/version.Version=${VERSION}
-X ${K3S_PKG}/pkg/version.UpstreamGolang=${VERSION_GOLANG}
-X ${RKE2_PKG}/pkg/images.DefaultRegistry=${REGISTRY}
-X ${RKE2_PKG}/pkg/images.DefaultEtcdImage=rancher/hardened-etcd:${ETCD_VERSION}-build20230802
-X ${RKE2_PKG}/pkg/images.DefaultKubernetesImage=rancher/hardened-kubernetes:${KUBERNETES_IMAGE_TAG}
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-images
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ xargs -n1 -t docker image pull --quiet << EOF >> build/images-core.txt
${REGISTRY}/rancher/hardened-etcd:${ETCD_VERSION}-build20230802
${REGISTRY}/rancher/hardened-k8s-metrics-server:v0.6.3-build20231009
${REGISTRY}/rancher/klipper-helm:v0.8.2-build20230815
${REGISTRY}/rancher/klipper-lb:v0.4.4
${REGISTRY}/rancher/klipper-lb:v0.4.5
${REGISTRY}/rancher/mirrored-pause:${PAUSE_VERSION}
${REGISTRY}/rancher/mirrored-ingress-nginx-kube-webhook-certgen:v20230312-helm-chart-4.5.2-28-g66a760794
${REGISTRY}/rancher/nginx-ingress-controller:nginx-1.9.3-hardened1
Expand Down
1 change: 1 addition & 0 deletions scripts/build-windows-binary
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ VERSION_FLAGS="
-X ${K3S_PKG}/pkg/version.GitCommit=${REVISION}
-X ${K3S_PKG}/pkg/version.Program=${PROG}
-X ${K3S_PKG}/pkg/version.Version=${VERSION}
-X ${K3S_PKG}/pkg/version.UpstreamGolang=${VERSION_GOLANG}
-X ${RKE2_PKG}/pkg/images.DefaultRegistry=${REGISTRY}
-X ${RKE2_PKG}/pkg/images.DefaultEtcdImage=rancher/hardened-etcd:${ETCD_VERSION}-build20230802
-X ${RKE2_PKG}/pkg/images.DefaultKubernetesImage=${REPO}/hardened-kubernetes:${KUBERNETES_IMAGE_TAG}
Expand Down
3 changes: 3 additions & 0 deletions scripts/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ if [[ "${VERSION}" =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)([-+][a-zA-Z0-9.]+)?[-+]((rk
echo "VERSION=${VERSION} parsed as MAJOR=${MAJOR} MINOR=${MINOR} PATCH=${PATCH} RC=${RC} RKE2_PATCH=${RKE2_PATCH}"
fi

DEPENDENCIES_URL="https://raw.githubusercontent.com/kubernetes/kubernetes/${KUBERNETES_VERSION}/build/dependencies.yaml"
VERSION_GOLANG="go"$(curl -sL "${DEPENDENCIES_URL}" | yq e '.dependencies[] | select(.name == "golang: upstream version").version' -)

DOCKERIZED_VERSION="${VERSION/+/-}" # this mimics what kubernetes builds do