Skip to content

Commit

Permalink
update k8s base url to https://dl.k8s.io (#2437)
Browse files Browse the repository at this point in the history
Signed-off-by: pixiake <[email protected]>
  • Loading branch information
pixiake authored Oct 29, 2024
1 parent bedbeb2 commit 5b3e363
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 15 deletions.
4 changes: 4 additions & 0 deletions cmd/kk/pkg/artifact/templates/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ spec:
{{- range .Options.Arches }}
- {{ . }}
{{- end }}
{{- if not .Options.OperatingSystems }}
operatingSystems: []
{{- else }}
operatingSystems:
{{- range $i, $v := .Options.OperatingSystems }}
- arch: {{ $v.Arch }}
Expand All @@ -49,6 +52,7 @@ spec:
localPath:
url:
{{- end }}
{{- end }}
kubernetesDistributions:
{{- range $i, $v := .Options.KubernetesDistributions }}
- type: {{ $v.Type }}
Expand Down
6 changes: 3 additions & 3 deletions cmd/kk/pkg/files/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,21 @@ func NewKubeBinary(name, arch, version, prePath string, getCmd func(path, url st
case kubeadm:
component.Type = KUBE
component.FileName = kubeadm
component.Url = fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/%s/kubeadm", version, arch)
component.Url = fmt.Sprintf("https://dl.k8s.io/release/%s/bin/linux/%s/kubeadm", version, arch)
if component.Zone == "cn" {
component.Url = fmt.Sprintf("https://kubernetes-release.pek3b.qingstor.com/release/%s/bin/linux/%s/kubeadm", version, arch)
}
case kubelet:
component.Type = KUBE
component.FileName = kubelet
component.Url = fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/%s/kubelet", version, arch)
component.Url = fmt.Sprintf("https://dl.k8s.io/release/%s/bin/linux/%s/kubelet", version, arch)
if component.Zone == "cn" {
component.Url = fmt.Sprintf("https://kubernetes-release.pek3b.qingstor.com/release/%s/bin/linux/%s/kubelet", version, arch)
}
case kubectl:
component.Type = KUBE
component.FileName = kubectl
component.Url = fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/%s/bin/linux/%s/kubectl", version, arch)
component.Url = fmt.Sprintf("https://dl.k8s.io/release/%s/bin/linux/%s/kubectl", version, arch)
if component.Zone == "cn" {
component.Url = fmt.Sprintf("https://kubernetes-release.pek3b.qingstor.com/release/%s/bin/linux/%s/kubectl", version, arch)
}
Expand Down
12 changes: 6 additions & 6 deletions feature/builtin/roles/init/init-artifact/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,39 @@ artifact:
{{- if .kkzone | eq "cn" }}
https://kubernetes-release.pek3b.qingstor.com/release/{{ .kube_version }}/bin/linux/amd64/kubeadm
{{- else }}
https://storage.googleapis.com/kubernetes-release/release/{{ .kube_version }}/bin/linux/amd64/kubeadm
https://dl.k8s.io/release/{{ .kube_version }}/bin/linux/amd64/kubeadm
{{- end }}
arm64: |
{{- if .kkzone | eq "cn" }}
https://kubernetes-release.pek3b.qingstor.com/release/{{ .kube_version }}/bin/linux/arm64/kubeadm
{{- else }}
https://storage.googleapis.com/kubernetes-release/release/{{ .kube_version }}/bin/linux/arm64/kubeadm
https://dl.k8s.io/release/{{ .kube_version }}/bin/linux/arm64/kubeadm
{{- end }}
kubelet:
amd64: |
{{- if .kkzone | eq "cn" }}
https://kubernetes-release.pek3b.qingstor.com/release/{{ .kube_version }}/bin/linux/amd64/kubelet
{{- else }}
https://storage.googleapis.com/kubernetes-release/release/{{ .kube_version }}/bin/linux/amd64/kubelet
https://dl.k8s.io/release/{{ .kube_version }}/bin/linux/amd64/kubelet
{{- end }}
arm64: |
{{- if .kkzone | eq "cn" }}
https://kubernetes-release.pek3b.qingstor.com/release/{{ .kube_version }}/bin/linux/arm64/kubelet
{{- else }}
https://storage.googleapis.com/kubernetes-release/release/{{ .kube_version }}/bin/linux/arm64/kubelet
https://dl.k8s.io/release/{{ .kube_version }}/bin/linux/arm64/kubelet
{{- end }}
kubectl:
amd64: |
{{- if .kkzone | eq "cn" }}
https://kubernetes-release.pek3b.qingstor.com/release/{{ .kube_version }}/bin/linux/amd64/kubectl
{{- else }}
https://storage.googleapis.com/kubernetes-release/release/{{ .kube_version }}/bin/linux/amd64/kubectl
https://dl.k8s.io/release/{{ .kube_version }}/bin/linux/amd64/kubectl
{{- end }}
arm64: |
{{- if .kkzone | eq "cn" }}
https://kubernetes-release.pek3b.qingstor.com/release/{{ .kube_version }}/bin/linux/arm64/kubectl
{{- else }}
https://storage.googleapis.com/kubernetes-release/release/{{ .kube_version }}/bin/linux/arm64/kubectl
https://dl.k8s.io/release/{{ .kube_version }}/bin/linux/arm64/kubectl
{{- end }}
cni:
amd64: |
Expand Down
2 changes: 1 addition & 1 deletion feature/hack/auto-update-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def fetch_kubernetes_sha256(versions):
for binary in K8S_COMPONENTS:
for arch in ARCH_LIST:
response = requests.get(
"https://storage.googleapis.com/kubernetes-release/release/{}/bin/linux/{}/{}.sha256".format(
"https://dl.k8s.io/release/{}/bin/linux/{}/{}.sha256".format(
version, arch, binary))
if response.status_code == 200:
new_sha256["{}-{}-{}".format(binary, arch, version)] = response.text
Expand Down
2 changes: 1 addition & 1 deletion feature/hack/fetch-kubernetes-hash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ do
echo "${app}@${arch}"
for ver in "${versions[@]}"
do
url="https://storage.googleapis.com/kubernetes-release/release/${ver}/bin/linux/${arch}/${app}.sha256"
url="https://dl.k8s.io/release/${ver}/bin/linux/${arch}/${app}.sha256"
hash=$(wget --quiet -O - "$url")
echo "\"${ver}\": \"${hash}\","
json=$(echo "$json" | jq ".${app}.${arch} += {\"${ver}\":\"${hash}\"}")
Expand Down
2 changes: 1 addition & 1 deletion feature/hack/sync-components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ if [ $KUBERNETES_VERSION ]; then
echo "Synchronizing $binary-$arch"

curl -L -o binaries/kube/$KUBERNETES_VERSION/$arch/$binary \
https://storage.googleapis.com/kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/$arch/$binary
https://dl.k8s.io/release/$KUBERNETES_VERSION/bin/linux/$arch/$binary

qsctl cp binaries/kube/$KUBERNETES_VERSION/$arch/$binary \
qs://kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/$arch/$binary \
Expand Down
2 changes: 1 addition & 1 deletion hack/auto-update-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def fetch_kubernetes_sha256(versions):
for binary in K8S_COMPONENTS:
for arch in ARCH_LIST:
response = requests.get(
"https://storage.googleapis.com/kubernetes-release/release/{}/bin/linux/{}/{}.sha256".format(
"https://dl.k8s.io/release/{}/bin/linux/{}/{}.sha256".format(
version, arch, binary))
if response.status_code == 200:
new_sha256["{}-{}-{}".format(binary, arch, version)] = response.text
Expand Down
2 changes: 1 addition & 1 deletion hack/fetch-kubernetes-hash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ do
echo "${app}@${arch}"
for ver in "${versions[@]}"
do
url="https://storage.googleapis.com/kubernetes-release/release/${ver}/bin/linux/${arch}/${app}.sha256"
url="https://dl.k8s.io/release/${ver}/bin/linux/${arch}/${app}.sha256"
hash=$(wget --quiet -O - "$url")
echo "\"${ver}\": \"${hash}\","
json=$(echo "$json" | jq ".${app}.${arch} += {\"${ver}\":\"${hash}\"}")
Expand Down
2 changes: 1 addition & 1 deletion hack/sync-components.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if [ $KUBERNETES_VERSION ]; then
echo "Synchronizing $binary-$arch"

curl -L -o binaries/kube/$KUBERNETES_VERSION/$arch/$binary \
https://storage.googleapis.com/kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/$arch/$binary
https://dl.k8s.io/release/$KUBERNETES_VERSION/bin/linux/$arch/$binary

qsctl cp binaries/kube/$KUBERNETES_VERSION/$arch/$binary \
qs://kubernetes-release/release/$KUBERNETES_VERSION/bin/linux/$arch/$binary \
Expand Down

0 comments on commit 5b3e363

Please sign in to comment.