diff --git a/content/en/releases/download.md b/content/en/releases/download.md index c728ec015f..cbac27f570 100644 --- a/content/en/releases/download.md +++ b/content/en/releases/download.md @@ -10,6 +10,24 @@ cluster. Those components are also shipped in container images as part of the official release process. All binaries as well as container images are available for multiple operating systems as well as hardware architectures. +### kubectl + + + +The Kubernetes command-line tool, [kubectl](/docs/reference/kubectl/kubectl/), allows +you to run commands against Kubernetes clusters. + +You can use kubectl to deploy applications, inspect and manage cluster resources, +and view logs. For more information including a complete list of kubectl operations, see the +[`kubectl` reference documentation](/docs/reference/kubectl/). + +kubectl is installable on a variety of Linux platforms, macOS and Windows. +Find your preferred operating system below. + +- [Install kubectl on Linux](/docs/tasks/tools/install-kubectl-linux) +- [Install kubectl on macOS](/docs/tasks/tools/install-kubectl-macos) +- [Install kubectl on Windows](/docs/tasks/tools/install-kubectl-windows) + ## Container Images All Kubernetes container images are deployed to the @@ -53,25 +71,4 @@ To manually verify signed container images of Kubernetes core components, refer ## Binaries -Find links to download Kubernetes components (and their checksums) in the -[CHANGELOG](https://github.com/kubernetes/kubernetes/tree/master/CHANGELOG) files. - -Alternately, use [downloadkubernetes.com](https://www.downloadkubernetes.com/) to filter by version and architecture. - -### kubectl - - - -The Kubernetes command-line tool, [kubectl](/docs/reference/kubectl/kubectl/), allows -you to run commands against Kubernetes clusters. - -You can use kubectl to deploy applications, inspect and manage cluster resources, -and view logs. For more information including a complete list of kubectl operations, see the -[`kubectl` reference documentation](/docs/reference/kubectl/). - -kubectl is installable on a variety of Linux platforms, macOS and Windows. -Find your preferred operating system below. - -- [Install kubectl on Linux](/docs/tasks/tools/install-kubectl-linux) -- [Install kubectl on macOS](/docs/tasks/tools/install-kubectl-macos) -- [Install kubectl on Windows](/docs/tasks/tools/install-kubectl-windows) +{{< release-binaries >}} \ No newline at end of file diff --git a/data/i18n/en/en.toml b/data/i18n/en/en.toml index 0d0922bded..3ebe1b5610 100644 --- a/data/i18n/en/en.toml +++ b/data/i18n/en/en.toml @@ -366,6 +366,78 @@ other = "Before you begin" [previous_patches] other = "Patch Releases:" +# The following text is displayed when JavaScript isn't available. +[release_binary_alternate_links] +other = """You can find links to download Kubernetes components (and their checksums) in the [CHANGELOG](https://github.com/kubernetes/kubernetes/tree/master/CHANGELOG) files. +Alternately, use [downloadkubernetes.com](https://www.downloadkubernetes.com/) to filter by version and architecture.""" + +[release_binary_arch] +other = "Architecture" + +[release_binary_arch_option] +other = "Architectures" + +[release_binary_copy_link] +other = "Copy Link" + +[release_binary_copy_link_certifcate] +other = "cert" + +[release_binary_copy_link_checksum] +other = "checksum" + +[release_binary_copy_link_signature] +other = "signature" + +[release_binary_copy_link_tooltip] +other = "copy to clipboard" + +[release_binary_download] +other = "Download Binary" + +[release_binary_download_tooltip] +other = "download binary file" + +[release_binary_options] +other = "Download Options" + +[release_binary_os] +other = "Operating System" + +[release_binary_os_option] +other = "Operating Systems" + +[release_binary_os_darwin] +other = "darwin" + +[release_binary_os_linux] +other = "linux" + +[release_binary_os_windows] +other = "windows" + +[release_binary_table_caption] +other = "Download Kubernetes component binaries" + +# NOTE: is a placeholder for the actual version number set by 'release-binaries' shortcode. +# Please do not localize or modify placeholder. +[release_binary_section] +other = """You can find the links to download Kubernetes components (along with their checksums) below. +To access downloads for older supported versions, visit the respective documentation +link for [older versions](https://kubernetes.io/docs/home/supported-doc-versions/#versions-older) or use [downloadkubernetes.com](https://www.downloadkubernetes.com/).""" + +# NOTE: and are placeholders set by 'release-binaries' shortcode. +# Please do not localize or modify and placeholders. +[release_binary_section_note] +other = """To download older patch versions of Kubernetes components (and their checksums), +please refer to the [CHANGELOG](https://github.com/kubernetes/kubernetes/tree/master/CHANGELOG/CHANGELOG-.md) file.""" + +[release_binary_version] +other = "Version" + +[release_binary_version_option] +other = "Latest Version" + [release_date_after] other = ")" diff --git a/layouts/partials/head.html b/layouts/partials/head.html index df4fba66ca..b859238768 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -87,6 +87,10 @@ {{- end -}} +{{- if .HasShortcode "release-binaries" -}} + +{{- end -}} + {{- if eq (lower .Params.cid) "community" -}} {{- if eq .Params.community_styles_migrated true -}} diff --git a/layouts/shortcodes/release-binaries.html b/layouts/shortcodes/release-binaries.html new file mode 100644 index 0000000000..6eef11dda2 --- /dev/null +++ b/layouts/shortcodes/release-binaries.html @@ -0,0 +1,130 @@ + +{{ $response := getJSON "https://raw.githubusercontent.com/kubernetes-sigs/downloadkubernetes/master/dist/release_binaries.json" }} + +{{ $currentVersion := site.Params.version }} + +{{ $Binaries := slice }} +{{ $AllOSes := slice }} +{{ $AllArch := slice }} +{{ $AllVersions := slice }} + +{{ range $key, $value := $response }} + {{ if eq $key "Binaries" }} + {{ $Binaries = $value }} + {{ else if eq $key "AllOSes" }} + {{ $AllOSes = $value }} + {{ else if eq $key "AllArch" }} + {{ $AllArch = $value }} + {{ else if eq $key "AllVersions" }} + {{ $AllVersions = $value }} + {{ end }} +{{ end }} + + + +
+

{{ T "release_binary_alternate_links" | markdownify }}

+
+ + + \ No newline at end of file diff --git a/static/js/release_binaries.js b/static/js/release_binaries.js new file mode 100644 index 0000000000..b0ff571dd2 --- /dev/null +++ b/static/js/release_binaries.js @@ -0,0 +1,75 @@ +const filterCriteria = { + os: "", + arch: "" +}; + +["os", "arch"].forEach(kind => { + eventListener(kind); +}); + +function eventListener(kind) { + let buttonGroupQuery = '#' + kind + '-filter' + ' > button'; + let buttonGroup = document.querySelectorAll(buttonGroupQuery); + + buttonGroup.forEach(button => { + button.addEventListener('click', (evt) => { + let buttonData = button.dataset[kind]; + + if (filterCriteria[kind] === buttonData) { + filterCriteria[kind] = ""; + button.classList.add('btn-outline-primary'); + button.classList.remove('btn-primary'); + } else { + filterCriteria[kind] = buttonData; + buttonGroup.forEach(b => { + b.classList.remove('btn-primary'); + b.classList.add('btn-outline-primary'); + }); + button.classList.remove('btn-outline-primary'); + button.classList.add('btn-primary'); + } + + filterRows(); + }); + }); +} + +function filterRows() { + const rows = document.querySelectorAll('#release-binary-table tbody tr'); + + rows.forEach(row => { + const os = row.classList.contains(filterCriteria.os) || filterCriteria.os === ""; + const arch = row.classList.contains(filterCriteria.arch) || filterCriteria.arch === ""; + + if (os && arch) { + row.classList.remove('hide'); + } else { + row.classList.add('hide'); + } + }); +} + +document.querySelectorAll("#release-binary-table .release-binary-copy").forEach(link => { + link.addEventListener('click', (evt) => { + evt.preventDefault(); + + const hrefValue = link.getAttribute('href'); + const tempTextArea = document.createElement('textarea'); + tempTextArea.value = hrefValue; + document.body.appendChild(tempTextArea); + tempTextArea.select(); + document.execCommand('copy'); + document.body.removeChild(tempTextArea); + return false; + }); +}); + +// The page and script is loaded successfully +$( document ).ready(function() { + + // Remove the non-js content + $('.downloadbinaries-nojs').hide(); + + // Display the release binary content + $('#download-kubernetes-data').show(); +}) \ No newline at end of file