CKS: update imagePullPolicy to IfNotPresent in yaml files (#8296)

The kubernetes dashboard yaml file has the following setting

image: kubernetesui/dashboard:v2.7.0
imagePullPolicy: Always

see https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml The similar config can be found at https://raw.githubusercontent.com/weaveworks/weave/master/prog/weave-kube/weave-daemonset-k8s-1.11.yaml

Due to it, CKS does not work in the following cases

    reach the dockerhub rate limitations (see https://docs.docker.com/docker-hub/download-rate-limit/)
    The VMs do not have internet connection

Since the CKS ISO contains the image, it is not necessary to pull the images again.
This commit is contained in:
Wei Zhou 2023-12-08 12:35:09 +01:00 committed by GitHub
parent bba554bcc4
commit f42feb1568
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -145,6 +145,9 @@ if [ -z "${kubeadm_file_permissions}" ]; then
fi fi
chmod ${kubeadm_file_permissions} "${working_dir}/k8s/kubeadm" chmod ${kubeadm_file_permissions} "${working_dir}/k8s/kubeadm"
echo "Updating imagePullPolicy to IfNotPresent in yaml files..."
sed -i "s/imagePullPolicy:.*/imagePullPolicy: IfNotPresent/g" ${working_dir}/*.yaml
mkisofs -o "${output_dir}/${build_name}" -J -R -l "${iso_dir}" mkisofs -o "${output_dir}/${build_name}" -J -R -l "${iso_dir}"
rm -rf "${iso_dir}" rm -rf "${iso_dir}"

View File

@ -2260,11 +2260,23 @@ test_data = {
"url": "http://download.cloudstack.org/cks/setup-1.26.0.iso", "url": "http://download.cloudstack.org/cks/setup-1.26.0.iso",
"mincpunumber": 2, "mincpunumber": 2,
"minmemory": 2048 "minmemory": 2048
},
"1.27.8": {
"semanticversion": "1.27.8",
"url": "http://download.cloudstack.org/cks/setup-1.27.8.iso",
"mincpunumber": 2,
"minmemory": 2048
},
"1.28.4": {
"semanticversion": "1.28.4",
"url": "http://download.cloudstack.org/cks/setup-1.28.4.iso",
"mincpunumber": 2,
"minmemory": 2048
} }
}, },
"cks_kubernetes_version": "1.26.0", "cks_kubernetes_version": "1.28.4",
"cks_kubernetes_version_upgrade_from": "1.25.0", "cks_kubernetes_version_upgrade_from": "1.27.8",
"cks_kubernetes_version_upgrade_to": "1.26.0", "cks_kubernetes_version_upgrade_to": "1.28.4",
"cks_service_offering": { "cks_service_offering": {
"name": "CKS-Instance", "name": "CKS-Instance",
"displaytext": "CKS Instance", "displaytext": "CKS Instance",