Use new registry for all the kubernetes images.

Turns out, that all the images has been moved from k8s.gcr.io to
registry.k8s.io, so that there is no need to distinguish between those
two locations for older version of k8s (especially the one which we are
relaying on for docker gate). In this patch we switch over to the
registry.k8s.io for all of the supported kubernetes versions.

To make it work it is also requires to bump kubernetes 1.23 to latest
minor version, otherwise there will be issues with pulling coredns
image.

Change-Id: I7ed0ae76108a409bc72bc61ab7c12164e8277257
Depends-On: https://review.opendev.org/c/openstack/devstack-plugin-container/+/874573
This commit is contained in:
Roman Dobosz 2023-02-16 13:57:28 +01:00
parent ed9f348e87
commit 3f80fc43a3
2 changed files with 3 additions and 16 deletions

View File

@ -183,7 +183,7 @@
vars:
devstack_localrc:
CONTAINER_ENGINE: docker
KURYR_KUBERNETES_VERSION: 1.23.13
KURYR_KUBERNETES_VERSION: 1.23.16
voting: true
- job:

View File

@ -1,19 +1,6 @@
#!/bin/bash
# Ugly hack for the image repository. Kubernetes team switched to new registry
# starting from 1.25 version.
# TODO(gryf): Remove this when kubernetes version will be bumped beyond 1.24
# and we drop docker support, as it is pinned to 1.23.
MINOR=${KURYR_KUBERNETES_VERSION#*.}
MINOR=${MINOR%.*}
if [[ $MINOR -gt 23 ]]; then
KURYR_KUBEADMIN_IMAGE_REPOSITORY="registry.k8s.io"
else
KURYR_KUBEADMIN_IMAGE_REPOSITORY="k8s.gcr.io"
PULLARGS="--image-repository=${KURYR_KUBEADMIN_IMAGE_REPOSITORY}"
fi
KURYR_KUBEADMIN_IMAGE_REPOSITORY="registry.k8s.io"
function get_k8s_log_level {
if [[ ${ENABLE_DEBUG_LOG_LEVEL} == "True" ]]; then
echo "4"
@ -133,7 +120,7 @@ address: "0.0.0.0"
enableServer: true
cgroupDriver: $cgroup_driver
EOF
sudo kubeadm config images pull ${PULLARGS}
sudo kubeadm config images pull --image-repository=${KURYR_KUBEADMIN_IMAGE_REPOSITORY}
args="--config ${output_dir}/kubeadm-init.yaml"
# NOTE(gryf): skip installing kube proxy, kuryr will handle services.
args+=" --skip-phases=addon/kube-proxy"