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

fix: use dl.k8s.io, not kubernetes-release bucket #2872

Merged
merged 3 commits into from
May 16, 2023
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
27 changes: 7 additions & 20 deletions docs/testing-pre-releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ The table below summarize the current state:

| | .deb or .rpm | kubeadm binary | control plane |
|-------------------------|------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| **GA release** | from .deb or .rpm repository | from [github release page](https://github.com/kubernetes/kubernetes/releases) or from `gs://kubernetes-release/release/` GCS bucket | from `k8s.gcr.io` container registry or from [github release page](https://github.com/kubernetes/kubernetes/releases) |
| **alpha/beta release*** | not available. | from [github release page](https://github.com/kubernetes/kubernetes/releases) or from `gs://kubernetes-release/release/` GCS bucket | from `k8s.gcr.io` container registry or from [github release page](https://github.com/kubernetes/kubernetes/releases) |
| **GA release** | from .deb or .rpm repository | from [github release page](https://github.com/kubernetes/kubernetes/releases) or from `https://dl.k8s.io/` release bucket | from `k8s.gcr.io` container registry or from [github release page](https://github.com/kubernetes/kubernetes/releases) |
| **alpha/beta release*** | not available. | from [github release page](https://github.com/kubernetes/kubernetes/releases) or from `https://dl.k8s.io/` release bucket | from `k8s.gcr.io` container registry or from [github release page](https://github.com/kubernetes/kubernetes/releases) |
| **CI/CD release*** | not available. | from `gs://k8s-release-dev/ci/` GCS bucket (built every merge) | from `gcr.io/k8s-staging-ci-images` container registry (built every few hours, not by PR) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the plan for
gs://k8s-release-dev/ci/, can we change it with its pot. replacement in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asking kubernetes/k8s.io#2396 (comment), rework based on the sig's recommendation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k8s-release-dev will be tracked separately and isn't meant to be end-user facing (unlike dl.k8s.io), it's meant for contributors to the project

kubernetes/k8s.io#2396 (comment)

Copy link
Member

@neolit123 neolit123 May 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack


[*] for alpha/beta and CI/CD currently it is not possible to have exact version number consistency for all the
Expand Down Expand Up @@ -94,29 +94,16 @@ apt-get install <package name>=<version number>
yum install <package name>-<version number>
```

### Getting kubeadm binaries from a GCS bucket
### Getting kubeadm binaries from a release bucket

Pre-compiled GA, alpha/beta versions of kubeadm binary are deployed into `gs://kubernetes-release/release/` GCS bucket,
Pre-compiled GA, alpha/beta versions of kubeadm binary are deployed into `https://dl.k8s.io/release/` release bucket,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pacoxu mentioned this URL is a 404.

Copy link
Contributor Author

@rjsadow rjsadow May 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be a 302 if done with curl. Through the reverse proxy you dan't browse directories which may be why you're getting a 404 but if you look at a specific file, it should be there.

$ curl -s -o /dev/null -w "%{http_code}\n" https://dl.k8s.io/release/
302
$ curl -sL -o /dev/null -w "%{http_code}\n" https://dl.k8s.io/release/
404
$ curl -sL -o /dev/null -w "%{http_code}\n" https://dl.k8s.io/release/stable.txt
200

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sgtm,

@pacoxu please let us know if you see a problem with the doc text, as is

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

while CI/CD versions are deployed into `gs://k8s-release-dev/ci/` bucket.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same Q as above for the CI bucket

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

k8s-release-dev will be tracked separately and isn't meant to be end-user facing (unlike dl.k8s.io), it's meant for contributors to the project

kubernetes/k8s.io#2396 (comment)


To explore versions available in Google Storage buckets use:

```bash
gsutil ls gs://{bucket-name}{filter}

# e.g. search all GA and alpha/beta v1.10 releases
gsutil ls -d gs://kubernetes-release/release/v1.10*
```

As alternative, you can browse GCS buckets using <https://console.cloud.google.com/storage/browser/{bucket-name}> or
<http://gcsweb.k8s.io/gcs/kubernetes-release/release/> (only for `gs://kubernetes-release/release/`).
To explore Kubernetes versions available to use, visit the [github release page](https://github.com/kubernetes/kubernetes/releases).

To retrieve a pre-compiled version of kubeadm binary use:

```bash
gsutil cp gs://{bucket-name}/{release}/bin/linux/amd64/kubeadm .

# or, only for releases in gs://kubernetes-release/release/
curl -L https://dl.k8s.io/release/{release}/bin/linux/amd64/kubeadm && chown +x kubeadm
```

Expand Down Expand Up @@ -167,8 +154,8 @@ Run `cluster/get-kube-binaries.sh` to download the tarball with server binaries.

> Inside release notes, usually there is a direct link for getting server binaries directly

> `cluster/get-kube-binaries.sh` retrieves server binaries from `gs://kubernetes-release/release/{release}`
GCS bucket; you can use `gsutil` to get server binaries directly.
> `cluster/get-kube-binaries.sh` retrieves server binaries from `https://dl.k8s.io/release/{release}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note, in the future we should clean all /cluster/x referenced

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were those fully depricated or were they moved somewhere else?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i haven't checked. we should not ref /cluster tools from k/kubeadm, since /cluster should not be used directly by users. instead users should curl, perhaps.

Release bucket; you can use `curl` to get server binaries directly.

Both Kubeadm binaries and docker images are available in `/server/bin` folder of `kubernetes-server-linux-amd64.tar.gz`

Expand Down
13 changes: 11 additions & 2 deletions kinder/pkg/extract/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (

const (
ciBuildRepository = "https://storage.googleapis.com/k8s-release-dev/ci"
releaseBuildURepository = "https://storage.googleapis.com/kubernetes-release/release"
releaseBuildURepository = "https://dl.k8s.io/release"

kubeadmBinary = "kubeadm"
kubeletBinary = "kubelet"
Expand Down Expand Up @@ -509,9 +509,18 @@ var httpGetBackoff = wait.Backoff{
func httpGet(uri string) (int64, io.ReadCloser, error) {
var lastError error
var resp *http.Response

// Create a custom http.Client with redirect behavior
client := &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
// Allow redirects
return nil
},
}

err := wait.ExponentialBackoff(httpGetBackoff, func() (bool, error) {
var err error
resp, err = http.Get(uri)
resp, err = client.Get(uri)
if err != nil {
log.Warnf("HTTP GET %s failed. Retry in few seconds", uri)
lastError = errors.Wrapf(err, "HTTP GET %s failed", uri)
Expand Down
6 changes: 5 additions & 1 deletion tests/e2e/manifests/verify_manifest_lists.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ func getFromURLTimeoutSize(url string, timeout int, sizeOnly bool) (string, int,
t := time.Duration(time.Duration(timeout) * time.Second)
client := http.Client{
Timeout: t,
CheckRedirect: func(req *http.Request, via []*http.Request) error {
// Allow redirects
return nil
},
}

req, err := http.NewRequest("GET", url, nil)
Expand Down Expand Up @@ -641,7 +645,7 @@ func filterVersions(versions VersionList) (VersionList, error) {
minEstimated = version.MustParseGeneric(semVersion)
// else get the last version from the previous Major release and apply the skew.
} else {
url := fmt.Sprintf("https://storage.googleapis.com/kubernetes-release/release/stable-%d.txt", minEstimated.Major()-1)
url := fmt.Sprintf("https://dl.k8s.io/release/stable-%d.txt", minEstimated.Major()-1)
rjsadow marked this conversation as resolved.
Show resolved Hide resolved
verFromURL, _, err := getFromURL(url)
if err != nil {
return versions, err
Expand Down