diff --git a/static/js/release_binaries.js b/assets/js/release_binaries.js similarity index 100% rename from static/js/release_binaries.js rename to assets/js/release_binaries.js diff --git a/content/de/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html b/content/de/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html index 6cf9899c73..5c960361d0 100644 --- a/content/de/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html +++ b/content/de/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/de/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html b/content/de/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html index 455653c541..5f9eee4858 100644 --- a/content/de/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html +++ b/content/de/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/de/docs/tutorials/kubernetes-basics/explore/explore-interactive.html b/content/de/docs/tutorials/kubernetes-basics/explore/explore-interactive.html index 3470b023d3..2af1961c30 100644 --- a/content/de/docs/tutorials/kubernetes-basics/explore/explore-interactive.html +++ b/content/de/docs/tutorials/kubernetes-basics/explore/explore-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/de/docs/tutorials/kubernetes-basics/expose/expose-interactive.html b/content/de/docs/tutorials/kubernetes-basics/expose/expose-interactive.html index d5df13623c..2e5b5351a7 100644 --- a/content/de/docs/tutorials/kubernetes-basics/expose/expose-interactive.html +++ b/content/de/docs/tutorials/kubernetes-basics/expose/expose-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/de/docs/tutorials/kubernetes-basics/scale/scale-interactive.html b/content/de/docs/tutorials/kubernetes-basics/scale/scale-interactive.html index 036cb111e1..eab68e20f9 100644 --- a/content/de/docs/tutorials/kubernetes-basics/scale/scale-interactive.html +++ b/content/de/docs/tutorials/kubernetes-basics/scale/scale-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/de/docs/tutorials/kubernetes-basics/update/update-interactive.html b/content/de/docs/tutorials/kubernetes-basics/update/update-interactive.html index 35a1fbe7c0..ae50d37fe8 100644 --- a/content/de/docs/tutorials/kubernetes-basics/update/update-interactive.html +++ b/content/de/docs/tutorials/kubernetes-basics/update/update-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/en/blog/_posts/2024-08-12-feature-gates_client-go.md b/content/en/blog/_posts/2024-08-12-feature-gates_client-go.md new file mode 100644 index 0000000000..7d98d66898 --- /dev/null +++ b/content/en/blog/_posts/2024-08-12-feature-gates_client-go.md @@ -0,0 +1,118 @@ +--- +layout: blog +title: 'Introducing Feature Gates to Client-Go: Enhancing Flexibility and Control' +date: 2024-08-12 +slug: feature-gates-in-client-go +author: > + Ben Luddy (Red Hat), + Lukasz Szaszkiewicz (Red Hat) +--- + +Kubernetes components use on-off switches called _feature gates_ to manage the risk of adding a new feature. +The feature gate mechanism is what enables incremental graduation of a feature through the stages Alpha, Beta, and GA. + +Kubernetes components, such as kube-controller-manager and kube-scheduler, use the client-go library to interact with the API. +The same library is used across the Kubernetes ecosystem to build controllers, tools, webhooks, and more. client-go now includes +its own feature gating mechanism, giving developers and cluster administrators more control over how they adopt client features. + +To learn more about feature gates in Kubernetes, visit [Feature Gates](/docs/reference/command-line-tools-reference/feature-gates/). + +## Motivation + +In the absence of client-go feature gates, each new feature separated feature availability from enablement in its own way, if at all. +Some features were enabled by updating to a newer version of client-go. Others needed to be actively configured in each program that used them. +A few were configurable at runtime using environment variables. Consuming a feature-gated functionality exposed by the kube-apiserver sometimes +required a client-side fallback mechanism to remain compatible with servers that don’t support the functionality due to their age or configuration. +In cases where issues were discovered in these fallback mechanisms, mitigation required updating to a fixed version of client-go or rolling back. + +None of these approaches offer good support for enabling a feature by default in some, but not all, programs that consume client-go. +Instead of enabling a new feature at first only for a single component, a change in the default setting immediately affects the default +for all Kubernetes components, which broadens the blast radius significantly. + +## Feature gates in client-go + +To address these challenges, substantial client-go features will be phased in using the new feature gate mechanism. +It will allow developers and users to enable or disable features in a way that will be familiar to anyone who has experience +with feature gates in the Kubernetes components. + +Out of the box, simply by using a recent version of client-go, this offers several benefits. + +For people who use software built with client-go: + + +* Early adopters can enable a default-off client-go feature on a per-process basis. +* Misbehaving features can be disabled without building a new binary. +* The state of all known client-go feature gates is logged, allowing users to inspect it. + +For people who develop software built with client-go: + +* By default, client-go feature gate overrides are read from environment variables. + If a bug is found in a client-go feature, users will be able to disable it without waiting for a new release. +* Developers can replace the default environment-variable-based overrides in a program to change defaults, + read overrides from another source, or disable runtime overrides completely. + The Kubernetes components use this customizability to integrate client-go feature gates with + the existing `--feature-gates` command-line flag, feature enablement metrics, and logging. + +## Overriding client-go feature gates + +**Note**: This describes the default method for overriding client-go feature gates at runtime. +It can be disabled or customized by the developer of a particular program. +In Kubernetes components, client-go feature gate overrides are controlled by the `--feature-gates` flag. + +Features of client-go can be enabled or disabled by setting environment variables prefixed with `KUBE_FEATURE`. +For example, to enable a feature named `MyFeature`, set the environment variable as follows: + +``` + KUBE_FEATURE_MyFeature=true +``` + +To disable the feature, set the environment variable to `false`: + +``` + KUBE_FEATURE_MyFeature=false +``` + +**Note**: Environment variables are case-sensitive on some operating systems. +Therefore, `KUBE_FEATURE_MyFeature` and `KUBE_FEATURE_MYFEATURE` would be considered two different variables. + +## Customizing client-go feature gates + +The default environment-variable based mechanism for feature gate overrides can be sufficient for many programs in the Kubernetes ecosystem, +and requires no special integration. Programs that require different behavior can replace it with their own custom feature gate provider. +This allows a program to do things like force-disable a feature that is known to work poorly, +read feature gates directly from a remote configuration service, or accept feature gate overrides through command-line options. + +The Kubernetes components replace client-go’s default feature gate provider with a shim to the existing Kubernetes feature gate provider. +For all practical purposes, client-go feature gates are treated the same as other Kubernetes +feature gates: they are wired to the `--feature-gates` command-line flag, included in feature enablement metrics, and logged on startup. + +To replace the default feature gate provider, implement the Gates interface and call ReplaceFeatureGates +at package initialization time, as in this simple example: + +```go +import ( + “k8s.io/client-go/features” +) + +type AlwaysEnabledGates struct{} + +func (AlwaysEnabledGates) Enabled(features.Feature) bool { + return true +} + +func init() { + features.ReplaceFeatureGates(AlwaysEnabledGates{}) +} +``` + +Implementations that need the complete list of defined client-go features can get it by implementing the Registry interface +and calling `AddFeaturesToExistingFeatureGates`. +For a complete example, refer to [the usage within Kubernetes](https://github.com/kubernetes/kubernetes/blob/64ba17c605a41700f7f4c4e27dca3684b593b2b9/pkg/features/kube_features.go#L990-L997). + +## Summary + +With the introduction of feature gates in client-go v1.30, rolling out a new client-go feature has become safer and easier. +Users and developers can control the pace of their own adoption of client-go features. +The work of Kubernetes contributors is streamlined by having a common mechanism for graduating features that span both sides of the Kubernetes API boundary. + +Special shoutout to [@sttts](https://github.com/sttts) and [@deads2k](https://github.com/deads2k) for their help in shaping this feature. \ No newline at end of file diff --git a/content/en/docs/concepts/workloads/pods/disruptions.md b/content/en/docs/concepts/workloads/pods/disruptions.md index 3f94f2dcc9..864848544d 100644 --- a/content/en/docs/concepts/workloads/pods/disruptions.md +++ b/content/en/docs/concepts/workloads/pods/disruptions.md @@ -258,6 +258,11 @@ indicates one of the following reasons for the Pod termination: the [graceful node shutdown](/docs/concepts/architecture/nodes/#graceful-node-shutdown), or preemption for [system critical pods](/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/). +In all other disruption scenarios, like eviction due to exceeding +[Pod container limits](/docs/concepts/configuration/manage-resources-containers/), +Pods don't receive the `DisruptionTarget` condition because the disruptions were +probably caused by the Pod and would reoccur on retry. + {{< note >}} A Pod disruption might be interrupted. The control plane might re-attempt to continue the disruption of the same Pod, but it is not guaranteed. As a result, diff --git a/content/en/docs/reference/kubectl/docker-cli-to-kubectl.md b/content/en/docs/reference/kubectl/docker-cli-to-kubectl.md index d5a98a851a..099c97ac3f 100644 --- a/content/en/docs/reference/kubectl/docker-cli-to-kubectl.md +++ b/content/en/docs/reference/kubectl/docker-cli-to-kubectl.md @@ -15,6 +15,7 @@ You can use the Kubernetes command line tool `kubectl` to interact with the API ## docker run To run an nginx Deployment and expose the Deployment, see [kubectl create deployment](/docs/reference/generated/kubectl/kubectl-commands#-em-deployment-em-). + docker: ```shell diff --git a/content/es/docs/tasks/tools/included/optional-kubectl-configs-fish.md b/content/es/docs/tasks/tools/included/optional-kubectl-configs-fish.md index a23b3dcbc3..dcac17b484 100644 --- a/content/es/docs/tasks/tools/included/optional-kubectl-configs-fish.md +++ b/content/es/docs/tasks/tools/included/optional-kubectl-configs-fish.md @@ -1,6 +1,6 @@ --- -title: "autocompletado con fish" -description: "Configuración opcional para habilitar el autocompletado en la shell fish." +title: "Autocompletado con Fish" +description: "Configuración opcional para habilitar el autocompletado de la shell Fish" headless: true _build: list: never @@ -9,12 +9,12 @@ _build: --- {{< note >}} -El autocompletado para Fish necesita de kubectl versión 1.23 o superior. +Se requiere kubectl 1.23 o superior para utilizar el autocompletado de Fish. {{< /note >}} -El script de autocompletado de Fish para kubectl puede ser generado con el comando `kubectl completion fish`. Ejecutando este comando en tu shell habilitará el autocompletado de kubectl para Fish. +El script de autocompletado de Fish puede ser generado con el comando `kubectl completion fish`. Leyendo este archivo en su Shell habilita el autocompletado de kubectl. -Para qué funcione en sus futuras sesiones shell, debes agregar la siguiente línea al archivo `~/.config/fish/config.fish`: +Para hacer esto en todas sus sesiones agregue la siguiente linea a su archivo `~/.config/fish/config.fish`: ```shell kubectl completion fish | source diff --git a/content/es/docs/tasks/tools/install-kubectl-macos.md b/content/es/docs/tasks/tools/install-kubectl-macos.md new file mode 100644 index 0000000000..82fcdf6916 --- /dev/null +++ b/content/es/docs/tasks/tools/install-kubectl-macos.md @@ -0,0 +1,301 @@ +--- +title: Instalar y Configurar kubectl en macOS +content_type: task +weight: 10 +--- + +## {{% heading "prerequisites" %}} + +Se debe utilizar la versión de kubectl con la menor diferencia de versión de respecto de +su clúster. Por ejemplo, un cliente con versión v{{< skew currentVersion >}} se puede comunicar +con los siguientes versiones de plano de control v{{< skew currentVersionAddMinor -1 >}}, +v{{< skew currentVersionAddMinor 0 >}}, and v{{< skew currentVersionAddMinor 1 >}}. +Utilizar la última versión compatible de kubectl evita posibles errores. + +## Instalar kubectl en macOS + +Existen los siguientes métodos para instalar kubectl en macOS: + +- [Instalar kubectl en macOS](#instalar-kubectl-en-macos) + - [Instalación del binario para macOS con Curl](#instalación-del-binario-para-macos-de-kubectl-con-curl) + - [Instalar con Homebrew en macOS](#instalar-utilizando-homebrew-en-macos) + - [Instalar con Macports en macOS](#instalar-con-macports-en-macos) +- [Verificar la configuración de kubectl](#verificar-la-configuración-de-kubectl) +- [Configuraciones y plugins opcionales para kubectl](#configuraciones-opcionales-y-plugins-de-kubectl) + - [Habilitar el autocompletado de la shell](#habilitar-el-autocompletado-en-la-shell) + - [Instalar el plugin `kubectl convert`](#instalar-el-plugin-kubectl-convert) + +### Instalación del binario para macOS de kubectl con Curl + +1. Descargar la última versión con el siguiente comando: + + {{< tabs name="download_binary_macos" >}} + {{< tab name="Intel" codelang="bash" >}} + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl" + {{< /tab >}} + {{< tab name="Apple Silicon" codelang="bash" >}} + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl" + {{< /tab >}} + {{< /tabs >}} + + {{< note >}} + Para descargar una versión específica, reemplaza la siguiente parte del comando con la + versión que deseas instalar `$(curl -L -s https://dl.k8s.io/release/stable.txt)` + + Por ejemplo, para descargar la versión {{< skew currentPatchVersion >}} en macOS: + + ```bash + curl -LO "https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/darwin/amd64/kubectl" + ``` + + Para macOS con procesador Apple Silicon, ejecuta: + + ```bash + curl -LO "https://dl.k8s.io/release/v{{< skew currentPatchVersion >}}/bin/darwin/arm64/kubectl" + ``` + + {{< /note >}} + +1. Validación del binario (paso opcional) + + Descargar el archivo checksum: + + {{< tabs name="download_checksum_macos" >}} + {{< tab name="Intel" codelang="bash" >}} + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl.sha256" + {{< /tab >}} + {{< tab name="Apple Silicon" codelang="bash" >}} + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl.sha256" + {{< /tab >}} + {{< /tabs >}} + + Validar el binario de kubectl contra el archivo checksum: + + ```bash + echo "$(cat kubectl.sha256) kubectl" | shasum -a 256 --check + ``` + + Si es válido, vas a obtener la siguiente respuesta: + + ```console + kubectl: OK + ``` + + En caso de falla, `sha256` terminará con un estado diferente a cero con una salida similar a: + + ```console + kubectl: FAILED + shasum: WARNING: 1 computed checksum did NOT match + ``` + + {{< note >}} + Descargue la misma versión del binario y el checksum. + {{< /note >}} + +1. Dar permisos de ejecución al binario. + + ```bash + chmod +x ./kubectl + ``` + +1. Mover el binario de kubectl al `PATH` de tu sistema. + + ```bash + sudo mv ./kubectl /usr/local/bin/kubectl + sudo chown root: /usr/local/bin/kubectl + ``` + + {{< note >}} + Asegúrate que el PATH `/usr/local/bin` forme parte de las variables de entorno. + {{< /note >}} + +1. Test para asegurar que la versión instalada está actualizada: + + ```bash + kubectl version --client + ``` + + Se puede utilizar lo siguiente para una vista detallada de la versión: + + ```cmd + kubectl version --client --output=yaml + ``` + +1. Luego de instalar el plugin puede eliminar los archivos de instalación: + + ```bash + rm kubectl kubectl.sha256 + ``` + +### Instalar utilizando Homebrew en macOS + +Si está utilizando [Homebrew](https://brew.sh/) en macOS, +puede instalar kubectl con Homebrew. + +1. Ejecute el comando para instalar: + + ```bash + brew install kubectl + ``` + + ó + + ```bash + brew install kubernetes-cli + ``` + +1. Test para asegurar que la versión instalada está actualizada: + + ```bash + kubectl version --client + ``` + +### Instalar con Macports en macOS + +Si esta en macOS y utiliza [Macports](https://macports.org/), +puedes instalar kubectl con Macports. + +1. Ejecute el comando para instalar: + + ```bash + sudo port selfupdate + sudo port install kubectl + ``` + +1. Test para asegurar que la versión instalada está actualizada: + + ```bash + kubectl version --client + ``` + +## Verificar la configuración de kubectl + +{{< include "included/verify-kubectl.md" >}} + +## Configuraciones opcionales y plugins de kubectl + +### Habilitar el autocompletado en la shell + +Kubectl tiene soporte para autocompletar en Bash, Zsh, Fish y Powershell, +lo que puede agilizar el tipeo. + +A continuación están los procedimientos para configurarlo en Bash, Fisch y Zsh. + +{{< tabs name="kubectl_autocompletion" >}} +{{< tab name="Bash" include="included/optional-kubectl-configs-bash-mac.md" />}} +{{< tab name="Fish" include="included/optional-kubectl-configs-fish.md" />}} +{{< tab name="Zsh" include="included/optional-kubectl-configs-zsh.md" />}} +{{< /tabs >}} + +### Instalar el plugin `kubectl convert` + +{{< include "included/kubectl-convert-overview.md" >}} + +1. Descarga la última versión con el siguiente comando: + + {{< tabs name="download_convert_binary_macos" >}} + {{< tab name="Intel" codelang="bash" >}} + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl-convert" + {{< /tab >}} + {{< tab name="Apple Silicon" codelang="bash" >}} + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl-convert" + {{< /tab >}} + {{< /tabs >}} + +1. Valide el binario (opcional) + + Descargue el checksum de kubectl-convert: + + {{< tabs name="download_convert_checksum_macos" >}} + {{< tab name="Intel" codelang="bash" >}} + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl-convert.sha256" + {{< /tab >}} + {{< tab name="Apple Silicon" codelang="bash" >}} + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl-convert.sha256" + {{< /tab >}} + {{< /tabs >}} + + Ahora se puede validar el binario utilizando el checksum: + + ```bash + echo "$(cat kubectl-convert.sha256) kubectl-convert" | shasum -a 256 --check + ``` + + Si es válido, la salida será: + + ```console + kubectl-convert: OK + ``` + + En caso de falla, `sha256` terminará con un estado diferente a cero con una salida similar a esta: + + ```console + kubectl-convert: FAILED + shasum: WARNING: 1 computed checksum did NOT match + ``` + + {{< note >}} + Descargue la misma versión del binario y del checksum. + {{< /note >}} + +1. Dar permisos de ejecución al binario. + + ```bash + chmod +x ./kubectl-convert + ``` + +1. Mover el binario de kubectl al `PATH` de su sistema. + + ```bash + sudo mv ./kubectl-convert /usr/local/bin/kubectl-convert + sudo chown root: /usr/local/bin/kubectl-convert + ``` + + {{< note >}} + Asegúrese que el PATH `/usr/local/bin` forme parte de las variables de entorno. + {{< /note >}} + +1. Verificar si el plugin fue instalado correctamente + + ```shell + kubectl convert --help + ``` + + Si no visualiza ningún error quiere decir que el plugin fue instalado correctamente. + +1. Después de instalar el plugin elimine los archivos de instalación: + + ```bash + rm kubectl-convert kubectl-convert.sha256 + ``` + +### Eliminar kubectl en macOS + +Dependiendo de como haya instalado `kubectl` puede utilizar uno de los siguientes métodos. + +### Eliminar kubectl usando la linea de comandos + +1. Ubique el binario de `kubectl` en su sistema: + + ```bash + which kubectl + ``` + +1. Elimine el binario de `kubectl`: + + ```bash + sudo rm <path> + ``` + Reemplace `<path>` con el path que apunta al binario de `kubectl` del paso anterior. Por ejemplo, `sudo rm /usr/local/bin/kubectl` + +### Eliminar kubectl utilizando homebrew + +Si instaló `kubectl` utilizando Homebrew ejecute el siguiente comando: + +```bash +brew remove kubectl +``` + +## {{% heading "whatsnext" %}} + +{{< include "included/kubectl-whats-next.md" >}} diff --git a/content/es/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html b/content/es/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html index 6e04566bea..ab5c228667 100644 --- a/content/es/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html +++ b/content/es/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html @@ -10,7 +10,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/es/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html b/content/es/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html index 74b4c50469..744938f8d7 100644 --- a/content/es/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html +++ b/content/es/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/fr/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html b/content/fr/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html index 5fcc57e46b..5da29df21f 100644 --- a/content/fr/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html +++ b/content/fr/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/fr/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html b/content/fr/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html index 594c2f3d6e..5fde3b76d7 100644 --- a/content/fr/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html +++ b/content/fr/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html @@ -10,7 +10,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/hi/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html b/content/hi/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html index 6187352e85..bc0fc53757 100644 --- a/content/hi/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html +++ b/content/hi/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/hi/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html b/content/hi/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html index ce89d5594b..a920df7168 100644 --- a/content/hi/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html +++ b/content/hi/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/hi/docs/tutorials/kubernetes-basics/explore/explore-interactive.html b/content/hi/docs/tutorials/kubernetes-basics/explore/explore-interactive.html index 1a0bb1547a..c2b63c5056 100644 --- a/content/hi/docs/tutorials/kubernetes-basics/explore/explore-interactive.html +++ b/content/hi/docs/tutorials/kubernetes-basics/explore/explore-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/hi/docs/tutorials/kubernetes-basics/expose/expose-interactive.html b/content/hi/docs/tutorials/kubernetes-basics/expose/expose-interactive.html index a3b77b57ff..6ff85fcdde 100644 --- a/content/hi/docs/tutorials/kubernetes-basics/expose/expose-interactive.html +++ b/content/hi/docs/tutorials/kubernetes-basics/expose/expose-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/hi/docs/tutorials/kubernetes-basics/scale/scale-interactive.html b/content/hi/docs/tutorials/kubernetes-basics/scale/scale-interactive.html index b2729d4728..f8ee54b820 100644 --- a/content/hi/docs/tutorials/kubernetes-basics/scale/scale-interactive.html +++ b/content/hi/docs/tutorials/kubernetes-basics/scale/scale-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/hi/docs/tutorials/kubernetes-basics/update/update-interactive.html b/content/hi/docs/tutorials/kubernetes-basics/update/update-interactive.html index 43898160ff..464a129914 100644 --- a/content/hi/docs/tutorials/kubernetes-basics/update/update-interactive.html +++ b/content/hi/docs/tutorials/kubernetes-basics/update/update-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/id/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html b/content/id/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html index 5641d5991e..8a9e9634ee 100644 --- a/content/id/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html +++ b/content/id/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/id/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html b/content/id/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html index 5dc8d1a0e8..88b20d4be2 100644 --- a/content/id/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html +++ b/content/id/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/id/docs/tutorials/kubernetes-basics/explore/explore-interactive.html b/content/id/docs/tutorials/kubernetes-basics/explore/explore-interactive.html index 0c96613419..42c88c0d3b 100644 --- a/content/id/docs/tutorials/kubernetes-basics/explore/explore-interactive.html +++ b/content/id/docs/tutorials/kubernetes-basics/explore/explore-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/id/docs/tutorials/kubernetes-basics/expose/expose-interactive.html b/content/id/docs/tutorials/kubernetes-basics/expose/expose-interactive.html index c10f9d057d..02f485ac93 100644 --- a/content/id/docs/tutorials/kubernetes-basics/expose/expose-interactive.html +++ b/content/id/docs/tutorials/kubernetes-basics/expose/expose-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/id/docs/tutorials/kubernetes-basics/scale/scale-interactive.html b/content/id/docs/tutorials/kubernetes-basics/scale/scale-interactive.html index 99b83c98f9..0732f30e26 100644 --- a/content/id/docs/tutorials/kubernetes-basics/scale/scale-interactive.html +++ b/content/id/docs/tutorials/kubernetes-basics/scale/scale-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/id/docs/tutorials/kubernetes-basics/update/update-interactive.html b/content/id/docs/tutorials/kubernetes-basics/update/update-interactive.html index 6e11d5c6a7..59528d1298 100644 --- a/content/id/docs/tutorials/kubernetes-basics/update/update-interactive.html +++ b/content/id/docs/tutorials/kubernetes-basics/update/update-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/ja/blog/_posts/2024-04-05-diy-create-your-own-cloud-with-kubernetes-part-2/index.md b/content/ja/blog/_posts/2024-04-05-diy-create-your-own-cloud-with-kubernetes-part-2/index.md index cef8508dae..521daefc79 100644 --- a/content/ja/blog/_posts/2024-04-05-diy-create-your-own-cloud-with-kubernetes-part-2/index.md +++ b/content/ja/blog/_posts/2024-04-05-diy-create-your-own-cloud-with-kubernetes-part-2/index.md @@ -166,7 +166,7 @@ Kubernetesでのサービスネットワークの実装は、サービスネッ CiliumはeBPFテクノロジーに基づいており、Linuxネットワークスタックを効率的にオフロードできるため、iptablesベースの従来の方法と比較してパフォーマンスとセキュリティが向上します。 -実際には、CiliumとKube-OVNを簡単に[統合]((https://kube-ovn.readthedocs.io/zh-cn/stable/en/advance/with-cilium/))することが可能です。 +実際には、CiliumとKube-OVNを簡単に[統合](https://kube-ovn.readthedocs.io/zh-cn/stable/en/advance/with-cilium/)することが可能です。 これにより、仮想マシン向けにシームレスでマルチテナントのネットワーキングを提供する統合ソリューションを実現することができます。 また、高度なネットワークポリシーと統合されたサービスネットワーク機能も提供されます。 diff --git a/content/ja/docs/concepts/services-networking/service-topology.md b/content/ja/docs/concepts/services-networking/service-topology.md deleted file mode 100644 index ae80af4ed5..0000000000 --- a/content/ja/docs/concepts/services-networking/service-topology.md +++ /dev/null @@ -1,148 +0,0 @@ ---- -title: Serviceトポロジー -feature: - title: Serviceトポロジー - description: > - Serviceのトラフィックをクラスタートポロジーに基づいてルーティングします。 -content_type: concept -weight: 150 ---- - - -<!-- overview --> - -{{< feature-state for_k8s_version="v1.21" state="deprecated" >}} - -{{< note >}} -この機能、特にアルファ版の`topologyKeys`APIは、Kubernetes v1.21以降では非推奨です。Kubernetes v1.21で導入された、[トポロジーを意識したルーティング](/ja/docs/concepts/services-networking/topology-aware-routing/)が同様の機能を提供します。 -{{</ note >}} - -*Serviceトポロジー*を利用すると、Serviceのトラフィックをクラスターのノードトポロジーに基づいてルーティングできるようになります。たとえば、あるServiceのトラフィックに対して、できるだけ同じノードや同じアベイラビリティゾーン上にあるエンドポイントを優先してルーティングするように指定できます。 - -<!-- body --> - -## はじめに - -デフォルトでは、`ClusterIP`や`NodePort`Serviceに送信されたトラフィックは、Serviceに対応する任意のバックエンドのアドレスにルーティングされる可能性があります。しかし、Kubernetes 1.7以降では、「外部の」トラフィックをそのトラフィックを受信したノード上のPodにルーティングすることが可能になりました。しかし、この機能は`ClusterIP`Serviceでは対応しておらず、ゾーン内ルーティングなどのより複雑なトポロジーは実現不可能でした。*Serviceトポロジー*の機能を利用すれば、Serviceの作者が送信元ノードと送信先ノードのNodeのラベルに基づいてトラフィックをルーティングするためのポリシーを定義できるようになるため、この問題を解決できます。 - -送信元と送信先の間のNodeラベルのマッチングを使用することにより、オペレーターは、そのオペレーターの要件に適したメトリクスを使用して、お互いに「より近い」または「より遠い」ノードのグループを指定できます。たとえば、パブリッククラウド上のさまざまなオペレーターでは、Serviceのトラフィックを同一ゾーン内に留めようとする傾向があります。パブリッククラウドでは、ゾーンをまたぐトラフィックでは関連するコストがかかる一方、ゾーン内のトラフィックにはコストがかからない場合があるからです。その他のニーズとしては、DaemonSetが管理するローカルのPodにトラフィックをルーティングできるようにしたり、レイテンシーを低く抑えるために同じラック上のスイッチに接続されたノードにトラフィックを限定したいというものがあります。 - -## Serviceトポロジーを利用する - -クラスターのServiceトポロジーが有効になっていれば、Serviceのspecに`topologyKeys`フィールドを指定することで、Serviceのトラフィックのルーティングを制御できます。このフィールドは、Nodeラベルの優先順位リストで、このServiceにアクセスするときにエンドポイントをソートするために使われます。トラフィックは、最初のラベルの値が送信元Nodeのものと一致するNodeに送信されます。一致したノード上にServiceに対応するバックエンドが存在しなかった場合は、2つ目のラベルについて検討が行われ、同様に、残っているラベルが順番に検討されまます。 - -一致するキーが1つも見つからなかった場合、トラフィックは、Serviceに対応するバックエンドが存在しなかったかのように拒否されます。言い換えると、エンドポイントは、利用可能なバックエンドが存在する最初のトポロジーキーに基づいて選択されます。このフィールドが指定され、すべてのエントリーでクライアントのトポロジーに一致するバックエンドが存在しない場合、そのクライアントに対するバックエンドが存在しないものとしてコネクションが失敗します。「任意のトポロジー」を意味する特別な値`"*"`を指定することもできます。任意の値にマッチするこの値に意味があるのは、リストの最後の値として使った場合だけです。 - -`topologyKeys`が未指定または空の場合、トポロジーの制約は適用されません。 - -ホスト名、ゾーン名、リージョン名のラベルが付いたNodeを持つクラスターについて考えてみましょう。このとき、Serviceの`topologyKeys`の値を設定することで、トラフィックの向きを以下のように制御できます。 - -* トラフィックを同じノード上のエンドポイントのみに向け、同じノード上にエンドポイントが1つも存在しない場合には失敗するようにする: `["kubernetes.io/hostname"]`。 -* 同一ノード上のエンドポイントを優先し、失敗した場合には同一ゾーン上のエンドポイント、同一リージョンゾーンのエンドポイントへとフォールバックし、それ以外の場合には失敗する: `["kubernetes.io/hostname", "topology.kubernetes.io/zone", "topology.kubernetes.io/region"]`。これは、たとえばデータのローカリティが非常に重要である場合などに役に立ちます。 -* 同一ゾーンを優先しますが、ゾーン内に利用可能なノードが存在しない場合は、利用可能な任意のエンドポイントにフォールバックする: `["topology.kubernetes.io/zone", "*"]`。 - -## 制約 - -* Serviceトポロジーは`externalTrafficPolicy=Local`と互換性がないため、Serviceは2つの機能を同時に利用できません。2つの機能を同じクラスター上の異なるServiceでそれぞれ利用することは可能ですが、同一のService上では利用できません。 - -* 有効なトポロジーキーは、現在は`kubernetes.io/hostname`、`topology.kubernetes.io/zone`、および`topology.kubernetes.io/region`に限定されています。しかし、将来は一般化され、他のノードラベルも使用できるようになる予定です。 - -* トポロジーキーは有効なラベルのキーでなければならず、最大で16個のキーまで指定できます。 - -* すべての値をキャッチする`"*"`を使用する場合は、トポロジーキーの最後の値として指定しなければなりません。 - -## 例 - -以下では、Serviceトポロジーの機能を利用したよくある例を紹介します。 - -### ノードローカルのエンドポイントだけを使用する - -ノードローカルのエンドポイントのみにルーティングするServiceの例です。もし同一ノード上にエンドポイントが存在しない場合、トラフィックは損失します。 - -```yaml -apiVersion: v1 -kind: Service -metadata: - name: my-service -spec: - selector: - app: my-app - ports: - - protocol: TCP - port: 80 - targetPort: 9376 - topologyKeys: - - "kubernetes.io/hostname" -``` - -### ノードローカルのエンドポイントを優先して使用する - -ノードローカルのエンドポイントを優先して使用しますが、ノードローカルのエンドポイントが存在しない場合にはクラスター全体のエンドポイントにフォールバックするServiceの例です。 - -```yaml -apiVersion: v1 -kind: Service -metadata: - name: my-service -spec: - selector: - app: my-app - ports: - - protocol: TCP - port: 80 - targetPort: 9376 - topologyKeys: - - "kubernetes.io/hostname" - - "*" -``` - - -### 同一ゾーンや同一リージョンのエンドポイントだけを使用する - -同一リージョンのエンドポイントより同一ゾーンのエンドポイントを優先するServiceの例です。もしいずれのエンドポイントも存在しない場合、トラフィックは損失します。 - -```yaml -apiVersion: v1 -kind: Service -metadata: - name: my-service -spec: - selector: - app: my-app - ports: - - protocol: TCP - port: 80 - targetPort: 9376 - topologyKeys: - - "topology.kubernetes.io/zone" - - "topology.kubernetes.io/region" -``` - -### ノードローカル、同一ゾーン、同一リーションのエンドポイントを優先して使用する - -ノードローカル、同一ゾーン、同一リージョンのエンドポイントを順番に優先し、クラスター全体のエンドポイントにフォールバックするServiceの例です。 - -```yaml -apiVersion: v1 -kind: Service -metadata: - name: my-service -spec: - selector: - app: my-app - ports: - - protocol: TCP - port: 80 - targetPort: 9376 - topologyKeys: - - "kubernetes.io/hostname" - - "topology.kubernetes.io/zone" - - "topology.kubernetes.io/region" - - "*" -``` - -## {{% heading "whatsnext" %}} - -* [トポロジーを意識したヒント](/ja/docs/concepts/services-networking/topology-aware-hints/)を読む。 -* [サービスとアプリケーションの接続](/ja/docs/tutorials/services/connect-applications-service/)を読む。 - diff --git a/content/ja/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html b/content/ja/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html index 7e7226bddc..84a42fbad7 100644 --- a/content/ja/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html +++ b/content/ja/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/ja/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html b/content/ja/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html index 91d8334a3e..9336d30fed 100644 --- a/content/ja/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html +++ b/content/ja/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/ja/docs/tutorials/kubernetes-basics/explore/explore-interactive.html b/content/ja/docs/tutorials/kubernetes-basics/explore/explore-interactive.html index 0a41102759..1c8ddadc7c 100644 --- a/content/ja/docs/tutorials/kubernetes-basics/explore/explore-interactive.html +++ b/content/ja/docs/tutorials/kubernetes-basics/explore/explore-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/ja/docs/tutorials/kubernetes-basics/expose/expose-interactive.html b/content/ja/docs/tutorials/kubernetes-basics/expose/expose-interactive.html index 048ab9de29..f12af70f75 100644 --- a/content/ja/docs/tutorials/kubernetes-basics/expose/expose-interactive.html +++ b/content/ja/docs/tutorials/kubernetes-basics/expose/expose-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/ja/docs/tutorials/kubernetes-basics/scale/scale-interactive.html b/content/ja/docs/tutorials/kubernetes-basics/scale/scale-interactive.html index d7caecefbe..c32eb794b9 100644 --- a/content/ja/docs/tutorials/kubernetes-basics/scale/scale-interactive.html +++ b/content/ja/docs/tutorials/kubernetes-basics/scale/scale-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/ja/docs/tutorials/kubernetes-basics/update/update-interactive.html b/content/ja/docs/tutorials/kubernetes-basics/update/update-interactive.html index 92f9c6e02d..e1d448c495 100644 --- a/content/ja/docs/tutorials/kubernetes-basics/update/update-interactive.html +++ b/content/ja/docs/tutorials/kubernetes-basics/update/update-interactive.html @@ -9,7 +9,7 @@ weight: 20 <body> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/pt-br/docs/tutorials/kubernetes-basics/_index.html b/content/pt-br/docs/tutorials/kubernetes-basics/_index.html index 8fa280c8ce..7b70207116 100644 --- a/content/pt-br/docs/tutorials/kubernetes-basics/_index.html +++ b/content/pt-br/docs/tutorials/kubernetes-basics/_index.html @@ -9,8 +9,6 @@ card: title: Aprenda o básico --- -{{% katacoda-removal %}} - <!DOCTYPE html> <html lang="en"> diff --git a/content/pt-br/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html b/content/pt-br/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html index bc8d0e4e55..0f94116aba 100644 --- a/content/pt-br/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html +++ b/content/pt-br/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html @@ -16,7 +16,7 @@ _build: <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/pt-br/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html b/content/pt-br/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html index 96e5704834..1e99b3f37b 100644 --- a/content/pt-br/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html +++ b/content/pt-br/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html @@ -16,7 +16,7 @@ _build: <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/pt-br/docs/tutorials/kubernetes-basics/explore/explore-interactive.html b/content/pt-br/docs/tutorials/kubernetes-basics/explore/explore-interactive.html index d77446cea8..e0b6661542 100644 --- a/content/pt-br/docs/tutorials/kubernetes-basics/explore/explore-interactive.html +++ b/content/pt-br/docs/tutorials/kubernetes-basics/explore/explore-interactive.html @@ -16,7 +16,7 @@ _build: <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/pt-br/docs/tutorials/kubernetes-basics/expose/expose-interactive.html b/content/pt-br/docs/tutorials/kubernetes-basics/expose/expose-interactive.html index 1478f1aa92..81355f99d5 100644 --- a/content/pt-br/docs/tutorials/kubernetes-basics/expose/expose-interactive.html +++ b/content/pt-br/docs/tutorials/kubernetes-basics/expose/expose-interactive.html @@ -16,7 +16,7 @@ _build: <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/pt-br/docs/tutorials/kubernetes-basics/scale/scale-interactive.html b/content/pt-br/docs/tutorials/kubernetes-basics/scale/scale-interactive.html index d1778cf4d5..7fe288ac34 100644 --- a/content/pt-br/docs/tutorials/kubernetes-basics/scale/scale-interactive.html +++ b/content/pt-br/docs/tutorials/kubernetes-basics/scale/scale-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/uk/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html b/content/uk/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html index 3ea6b82628..7a9c06a2bf 100644 --- a/content/uk/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html +++ b/content/uk/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/uk/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html b/content/uk/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html index 4f2b9876aa..32715b656c 100644 --- a/content/uk/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html +++ b/content/uk/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/uk/docs/tutorials/kubernetes-basics/explore/explore-interactive.html b/content/uk/docs/tutorials/kubernetes-basics/explore/explore-interactive.html index 6722a495cb..08b795b4ac 100644 --- a/content/uk/docs/tutorials/kubernetes-basics/explore/explore-interactive.html +++ b/content/uk/docs/tutorials/kubernetes-basics/explore/explore-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/uk/docs/tutorials/kubernetes-basics/expose/expose-interactive.html b/content/uk/docs/tutorials/kubernetes-basics/expose/expose-interactive.html index 0a7ae43353..2bb9d22b9a 100644 --- a/content/uk/docs/tutorials/kubernetes-basics/expose/expose-interactive.html +++ b/content/uk/docs/tutorials/kubernetes-basics/expose/expose-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/uk/docs/tutorials/kubernetes-basics/scale/scale-interactive.html b/content/uk/docs/tutorials/kubernetes-basics/scale/scale-interactive.html index 393e5959a4..7e8e075db5 100644 --- a/content/uk/docs/tutorials/kubernetes-basics/scale/scale-interactive.html +++ b/content/uk/docs/tutorials/kubernetes-basics/scale/scale-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/uk/docs/tutorials/kubernetes-basics/update/update-interactive.html b/content/uk/docs/tutorials/kubernetes-basics/update/update-interactive.html index b502e26f26..9ad95b4d60 100644 --- a/content/uk/docs/tutorials/kubernetes-basics/update/update-interactive.html +++ b/content/uk/docs/tutorials/kubernetes-basics/update/update-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/vi/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html b/content/vi/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html index 4c2ea13af3..b3cf5e1c3b 100644 --- a/content/vi/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html +++ b/content/vi/docs/tutorials/kubernetes-basics/create-cluster/cluster-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/vi/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html b/content/vi/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html index b3b0b141af..38ffa5a896 100644 --- a/content/vi/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html +++ b/content/vi/docs/tutorials/kubernetes-basics/deploy-app/deploy-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/vi/docs/tutorials/kubernetes-basics/explore/explore-interactive.html b/content/vi/docs/tutorials/kubernetes-basics/explore/explore-interactive.html index 8169a3b989..03c255bf96 100644 --- a/content/vi/docs/tutorials/kubernetes-basics/explore/explore-interactive.html +++ b/content/vi/docs/tutorials/kubernetes-basics/explore/explore-interactive.html @@ -11,7 +11,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> diff --git a/content/zh-cn/docs/concepts/workloads/pods/disruptions.md b/content/zh-cn/docs/concepts/workloads/pods/disruptions.md index 4859a98adf..7e957b9708 100644 --- a/content/zh-cn/docs/concepts/workloads/pods/disruptions.md +++ b/content/zh-cn/docs/concepts/workloads/pods/disruptions.md @@ -508,6 +508,16 @@ Taint Manager(`kube-controller-manager` 中节点生命周期控制器的一 由于{{<glossary_tooltip term_id="node-pressure-eviction" text="节点压力驱逐">}}或[节点体面关闭](/zh-cn/docs/concepts/architecture/nodes/#graceful-node-shutdown)而被 kubelet 终止。 +<!-- +In all other disruption scenarios, like eviction due to exceeding +[Pod container limits](/docs/concepts/configuration/manage-resources-containers/), +Pods don't receive the `DisruptionTarget` condition because the disruptions were +probably caused by the Pod and would reoccur on retry. +--> +在所有其他中断场景中,例如由于超出 +[Pod 容器限制]而被驱逐,`DisruptionTarget` 状况不会被添加到 Pod 上, +因为中断可能是由 Pod 引起的,并且会在重试时再次发生。 + {{< note >}} <!-- A Pod disruption might be interrupted. The control plane might re-attempt to diff --git a/content/zh-cn/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes.md b/content/zh-cn/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes.md index 6a3414c011..5911488647 100644 --- a/content/zh-cn/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes.md +++ b/content/zh-cn/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes.md @@ -23,8 +23,8 @@ application more available despite bugs. --> 这篇文章介绍如何给容器配置存活(Liveness)、就绪(Readiness)和启动(Startup)探针。 -有关探针的更多信息,请参阅 -[Liveness、Readiness 和 Startup 探针](/zh-cn/docs/concepts/configuration/liveness-readiness-startup-probes)。 +有关探针的更多信息, +请参阅[存活、就绪和启动探针](/zh-cn/docs/concepts/configuration/liveness-readiness-startup-probes)。 [kubelet](/zh-cn/docs/reference/command-line-tools-reference/kubelet/) 使用存活探针来确定什么时候要重启容器。 @@ -291,7 +291,7 @@ checks will fail, and the kubelet will kill and restart the container. To try the HTTP liveness check, create a Pod: --> -kubelet 在容器启动之后 3 秒开始执行健康检测。所以前几次健康检查都是成功的。 +kubelet 在容器启动之后 3 秒开始执行健康检查。所以前几次健康检查都是成功的。 但是 10 秒之后,健康检查会失败,并且 kubelet 会杀死容器再重新启动容器。 创建一个 Pod 来测试 HTTP 的存活检测: @@ -334,29 +334,34 @@ can't it is considered a failure. <!-- As you can see, configuration for a TCP check is quite similar to an HTTP check. -This example uses both readiness and liveness probes. The kubelet will send the -first readiness probe 15 seconds after the container starts. This will attempt to -connect to the `goproxy` container on port 8080. If the probe succeeds, the Pod -will be marked as ready. The kubelet will continue to run this check every 10 -seconds. +This example uses both readiness and liveness probes. The kubelet will run the +first liveness probe 15 seconds after the container starts. This will attempt to +connect to the `goproxy` container on port 8080. If the liveness probe fails, +the container will be restarted. The kubelet will continue to run this check +every 10 seconds. +--> +如你所见,TCP 检测的配置和 HTTP 检测非常相似。 +下面这个例子同时使用就绪探针和存活探针。kubelet 会在容器启动 15 秒后运行第一次存活探测。 +此探测会尝试连接 `goproxy` 容器的 8080 端口。 +如果此存活探测失败,容器将被重启。kubelet 将继续每隔 10 秒运行一次这种探测。 -In addition to the readiness probe, this configuration includes a liveness probe. -The kubelet will run the first liveness probe 15 seconds after the container -starts. Similar to the readiness probe, this will attempt to connect to the -`goproxy` container on port 8080. If the liveness probe fails, the container -will be restarted. +<!-- +In addition to the liveness probe, this configuration includes a readiness +probe. The kubelet will run the first readiness probe 15 seconds after the +container starts. Similar to the liveness probe, this will attempt to connect to +the `goproxy` container on port 8080. If the probe succeeds, the Pod will be +marked as ready and will receive traffic from services. If the readiness probe +fails, the pod will be marked unready and will not receive traffic from any +services. To try the TCP liveness check, create a Pod: --> -如你所见,TCP 检测的配置和 HTTP 检测非常相似。 -下面这个例子同时使用就绪和存活探针。kubelet 会在容器启动 15 秒后发送第一个就绪探针。 -探针会尝试连接 `goproxy` 容器的 8080 端口。 -如果探测成功,这个 Pod 会被标记为就绪状态,kubelet 将继续每隔 10 秒运行一次探测。 +除了存活探针,这个配置还包括一个就绪探针。 +kubelet 会在容器启动 15 秒后运行第一次就绪探测。 +与存活探测类似,就绪探测会尝试连接 `goproxy` 容器的 8080 端口。 +如果就绪探测失败,Pod 将被标记为未就绪,且不会接收来自任何服务的流量。 -除了就绪探针,这个配置包括了一个存活探针。 -kubelet 会在容器启动 15 秒后进行第一次存活探测。 -与就绪探针类似,存活探针会尝试连接 `goproxy` 容器的 8080 端口。 -如果存活探测失败,容器会被重新启动。 +要尝试 TCP 存活检测,运行以下命令创建 Pod: ```shell kubectl apply -f https://k8s.io/examples/pods/probe/tcp-liveness-readiness.yaml @@ -365,7 +370,7 @@ kubectl apply -f https://k8s.io/examples/pods/probe/tcp-liveness-readiness.yaml <!-- After 15 seconds, view Pod events to verify that liveness probes: --> -15 秒之后,通过看 Pod 事件来检测存活探针: +15 秒之后,通过查看 Pod 事件来检测存活探针: ```shell kubectl describe pod goproxy @@ -388,11 +393,6 @@ Here is an example manifest: --> 如果你的应用实现了 [gRPC 健康检查协议](https://github.com/grpc/grpc/blob/master/doc/health-checking.md), -kubelet 可以配置为使用该协议来执行应用存活性检查。 -你必须启用 `GRPCContainerProbe` -[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/) -才能配置依赖于 gRPC 的检查机制。 - 这个例子展示了如何配置 Kubernetes 以将其用于应用的存活性检查。 类似地,你可以配置就绪探针和启动探针。 @@ -422,10 +422,10 @@ those. For example: `myservice-liveness` (using `-` as a separator). {{< note >}} <!-- -Unlike HTTP and TCP probes, you cannot specify the health check port by name, and you +Unlike HTTP or TCP probes, you cannot specify the health check port by name, and you cannot configure a custom hostname. --> -与 HTTP 和 TCP 探针不同,gRPC 探测不能使用按名称指定端口, +与 HTTP 或 TCP 探针不同,gRPC 探测不能按名称指定健康检查端口, 也不能自定义主机名。 {{< /note >}} @@ -501,21 +501,20 @@ livenessProbe: <!-- ## Protect slow starting containers with startup probes {#define-startup-probes} -Sometimes, you have to deal with legacy applications that might require -an additional startup time on their first initialization. -In such cases, it can be tricky to set up liveness probe parameters without -compromising the fast response to deadlocks that motivated such a probe. -The trick is to set up a startup probe with the same command, HTTP or TCP -check, with a `failureThreshold * periodSeconds` long enough to cover the -worst case startup time. +Sometimes, you have to deal with applications that require additional startup +time on their first initialization. In such cases, it can be tricky to set up +liveness probe parameters without compromising the fast response to deadlocks +that motivated such a probe. The solution is to set up a startup probe with the +same command, HTTP or TCP check, with a `failureThreshold * periodSeconds` long +enough to cover the worst case startup time. So, the previous example would become: --> ## 使用启动探针保护慢启动容器 {#define-startup-probes} 有时候,会有一些现有的应用在启动时需要较长的初始化时间。 -要这种情况下,若要不影响对死锁作出快速响应的探测,设置存活探测参数是要技巧的。 -技巧就是使用相同的命令来设置启动探测,针对 HTTP 或 TCP 检测,可以通过将 +在这种情况下,若要不影响对死锁作出快速响应的探测,设置存活探测参数是要技巧的。 +解决办法是使用相同的命令来设置启动探测,针对 HTTP 或 TCP 检测,可以通过将 `failureThreshold * periodSeconds` 参数设置为足够长的时间来应对最糟糕情况下的启动时间。 这样,前面的例子就变成了: @@ -639,7 +638,7 @@ liveness and readiness checks: * `initialDelaySeconds`: Number of seconds after the container has started before startup, liveness or readiness probes are initiated. If a startup probe is defined, liveness and readiness probe delays do not begin until the startup probe has succeeded. If the value of - `periodSeconds` is greater than `initialDelaySeconds` then the `initialDelaySeconds` would be + `periodSeconds` is greater than `initialDelaySeconds` then the `initialDelaySeconds` will be ignored. Defaults to 0 seconds. Minimum value is 0. * `periodSeconds`: How often (in seconds) to perform the probe. Default to 10 seconds. The minimum value is 1. @@ -878,6 +877,28 @@ For example: --> 例如: +<!-- +```yaml +spec: + terminationGracePeriodSeconds: 3600 # pod-level + containers: + - name: test + image: ... + + ports: + - name: liveness-port + containerPort: 8080 + + livenessProbe: + httpGet: + path: /healthz + port: liveness-port + failureThreshold: 1 + periodSeconds: 60 + # Override pod-level terminationGracePeriodSeconds # + terminationGracePeriodSeconds: 60 +``` +--> ```yaml spec: terminationGracePeriodSeconds: 3600 # Pod 级别设置 diff --git a/content/zh-cn/docs/tutorials/kubernetes-basics/_index.html b/content/zh-cn/docs/tutorials/kubernetes-basics/_index.html index 1beb7e6b2b..a74683d253 100644 --- a/content/zh-cn/docs/tutorials/kubernetes-basics/_index.html +++ b/content/zh-cn/docs/tutorials/kubernetes-basics/_index.html @@ -9,8 +9,6 @@ card: title: 基础知识介绍 --- -{{% katacoda-removal %}} - <!DOCTYPE html> <html lang="zh"> diff --git a/content/zh-cn/docs/tutorials/kubernetes-basics/update/update-interactive.html b/content/zh-cn/docs/tutorials/kubernetes-basics/update/update-interactive.html index e736e54638..2c75a9efc4 100644 --- a/content/zh-cn/docs/tutorials/kubernetes-basics/update/update-interactive.html +++ b/content/zh-cn/docs/tutorials/kubernetes-basics/update/update-interactive.html @@ -18,7 +18,7 @@ weight: 20 <link href="/docs/tutorials/kubernetes-basics/public/css/styles.css" rel="stylesheet"> <link href="/docs/tutorials/kubernetes-basics/public/css/overrides.css" rel="stylesheet"> -<script src="https://katacoda.com/embed.js"></script> +{{< katacoda-tutorial >}} <div class="layout" id="top"> <main class="content katacoda-content"> diff --git a/content/zh-cn/examples/pods/probe/tcp-liveness-readiness.yaml b/content/zh-cn/examples/pods/probe/tcp-liveness-readiness.yaml index 2668986e70..d10aae980e 100644 --- a/content/zh-cn/examples/pods/probe/tcp-liveness-readiness.yaml +++ b/content/zh-cn/examples/pods/probe/tcp-liveness-readiness.yaml @@ -19,4 +19,4 @@ spec: tcpSocket: port: 8080 initialDelaySeconds: 15 - periodSeconds: 20 + periodSeconds: 10 diff --git a/data/i18n/en/en.toml b/data/i18n/en/en.toml index 738d32fd25..c8077cd476 100644 --- a/data/i18n/en/en.toml +++ b/data/i18n/en/en.toml @@ -211,17 +211,16 @@ other = "JavaScript must be [enabled](https://www.enable-javascript.com/) to vie [katacoda_message] other = """<h4>Shutdown of interactive tutorials</h4> -<p>The interactive tutorials on this website are being shut down. The Kubernetes -project hopes to reinstate a similar interactive learning option in the long -term.</p> -<p>The shutdown follows O'Reilly Media's 2019 <a -href="https://www.oreilly.com/content/oreilly-acquires-katacoda-and-a-new-way-for-2-5m-customers-to-learn/">acquisition</a> -of Katacoda.</p> +<p>The interactive tutorials previously on this website have been shut down.</p> <p>Kubernetes is grateful to O'Reilly and Katacoda for many years of helping people take their first steps in learning Kubernetes.</p> -<p>The tutorials will cease to function after the <b>31<sup>st</sup> of March, -2023</b>. For more information, see "<a href="/blog/2023/02/14/kubernetes-katacoda-tutorials-stop-from-2023-03-31/">Free Katacoda Kubernetes Tutorials Are Shutting -Down</a>."</p>""" +<p>The shutdown followed O'Reilly Media's 2019 +<a href="https://www.oreilly.com/content/oreilly-acquires-katacoda-and-a-new-way-for-2-5m-customers-to-learn/">acquisition</a> +of Katacoda.</p> +<hr /> +<p>The tutorials ceased to function after the <b>31<sup>st</sup> of March, +2023</b>. You are seeing this notice because this particular page has not yet been updated +following that shutdown.</p>""" [latest_release] other = "Latest Release:" diff --git a/layouts/docs/single.html b/layouts/docs/single.html index 8bc6fc7a0a..6db1b9a0de 100644 --- a/layouts/docs/single.html +++ b/layouts/docs/single.html @@ -1,5 +1,10 @@ {{ define "main" }} <div class="td-content"> + {{- if .HasShortcode "kat-button" -}} + <div class="pageinfo pageinfo-secondary"> + {{ T "katacoda_message" | safeHTML }} + </div> + {{- end -}} {{ partial "docs/content-page" (dict "ctx" . "page" .) }} <!-- Partial "docs/api-reference-links" determines API reference links for 'partial/page-meta-links.html' --> {{ partial "docs/api-reference-links" . }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2fa098e3ed..aae1a6cfeb 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -86,11 +86,6 @@ <!--Script for dismissing banners/notices--> <script defer src="{{ "js/dismiss_banner.js" | relURL }}"></script> - -{{- if .HasShortcode "release-binaries" -}} -<script defer src="{{ "js/release_binaries.js" | relURL }}"></script> -{{- end -}} - {{- if eq (lower .Params.cid) "community" -}} {{- if eq .Params.community_styles_migrated true -}} <link href="/css/community.css" rel="stylesheet"><!-- legacy styles --> diff --git a/layouts/partials/hooks/head-end.html b/layouts/partials/hooks/head-end.html index 97626932f2..1774354b30 100644 --- a/layouts/partials/hooks/head-end.html +++ b/layouts/partials/hooks/head-end.html @@ -31,4 +31,14 @@ {{- else -}} {{- errorf "Unable to find the glossary helper script" -}} {{- end -}} +{{- end -}} + +{{- if .HasShortcode "release-binaries" -}} + {{- if hugo.IsProduction -}} + {{- $releaseBinariesJs := resources.Get "js/release_binaries.js" | minify | fingerprint -}} +<script defer src="{{ $releaseBinariesJs.RelPermalink }}" integrity="{{ $releaseBinariesJs.Data.Integrity }}" crossorigin="anonymous"></script> + {{- else -}} + {{- $releaseBinariesJs := resources.Get "js/release_binaries.js" -}} +<script defer src="{{ $releaseBinariesJs.RelPermalink }}"></script> + {{- end -}} {{- end -}} \ No newline at end of file diff --git a/layouts/shortcodes/kat-button b/layouts/shortcodes/kat-button deleted file mode 100644 index 4dcdfa5653..0000000000 --- a/layouts/shortcodes/kat-button +++ /dev/null @@ -1,2 +0,0 @@ -<script defer src="https://katacoda.com/embed.js"></script> -<button class="button" onclick="window.katacoda.init(); ">Launch Terminal</button> diff --git a/layouts/shortcodes/kat-button.html b/layouts/shortcodes/kat-button.html new file mode 100644 index 0000000000..d987ff88e3 --- /dev/null +++ b/layouts/shortcodes/kat-button.html @@ -0,0 +1,2 @@ +{{/* placeholder */}} +{{/* See https://k8s.io/blog/2023/02/14/kubernetes-katacoda-tutorials-stop-from-2023-03-31/ */}} diff --git a/layouts/shortcodes/katacoda-removal.html b/layouts/shortcodes/katacoda-removal.html deleted file mode 100644 index a00899a2e7..0000000000 --- a/layouts/shortcodes/katacoda-removal.html +++ /dev/null @@ -1,3 +0,0 @@ -<div class="pageinfo pageinfo-secondary"> -{{ T "katacoda_message" | safeHTML }} -</div> diff --git a/layouts/shortcodes/katacoda-tutorial.html b/layouts/shortcodes/katacoda-tutorial.html index a17b4871a2..d987ff88e3 100644 --- a/layouts/shortcodes/katacoda-tutorial.html +++ b/layouts/shortcodes/katacoda-tutorial.html @@ -1 +1,2 @@ -<script defer src="https://katacoda.com/embed.js"></script> +{{/* placeholder */}} +{{/* See https://k8s.io/blog/2023/02/14/kubernetes-katacoda-tutorials-stop-from-2023-03-31/ */}}