En esta página, se explica cómo funcionan los interruptores de función de Kubernetes en Google Kubernetes Engine (GKE). Los interruptores de funciones son un conjunto de pares clave-valor que describen las funciones de Kubernetes. No puedes modificar los interruptores de funciones de Kubernetes en los clústeres de GKE.
El proyecto de Kubernetes lanza funciones nuevas en las etapas con el tiempo. Las características pueden estar en las etapas Alfa, Beta o DG.
Alternativamente, para verificar la etapa de una característica correspondiente a la versión del plano de control o los nodos de tu clúster, verifica la tabla de interruptores de función para funciones alfa o beta en la documentación de Kubernetes.
Funciones de GA de Kubernetes en GKE
La DG (también conocida como estable) de Kubernetes están habilitadas en GKE de forma predeterminada y no se pueden inhabilitar.
Funciones Beta de Kubernetes en GKE
Las funciones Beta suelen estar habilitadas de forma predeterminada en GKE.
GKE puede inhabilitar una función Beta específica para una versión en particular para mitigar un problema conocido con la función, garantizar la compatibilidad con versiones anteriores o porque la integración y calificación de la función en GKE aún no se completaron.
Si deseas usar una función beta de Kubernetes en tu clúster de GKE que ejecute la versión 1.26 o una posterior, verifica el estado del interruptor de función para comprobar que esté habilitada. Si tu clúster ejecuta una versión anterior a la 1.26, puedes verificar si la función está habilitada si la pruebas.
Las funciones de Kubernetes Alfa están inhabilitadas de forma predeterminada en todos los clústeres de GKE. GKE podría habilitar una función Alfa específica en una versión específica del plano de control.
Para habilitar todas las funciones Alfa de Kubernetes, crea un clúster Standard Alfa.
Verifica el estado del interruptor de función
Con los clústeres que ejecutan la versión 1.26 o posterior, puedes ejecutar un comando kubectl para verificar qué funciones están habilitadas.
Verifica el estado del interruptor de función para tu clúster de GKE:
El resultado, como en el siguiente ejemplo, muestra el nombre del interruptor de función, la etapa correspondiente ("" es DG) y si el interruptor de función está habilitada. 1 significa habilitado y 0 inhabilitado.
Consulta el siguiente resultado de ejemplo:
# HELP kubernetes_feature_enabled [BETA] This metric records the data about the stage and enablement of a k8s feature.
# TYPE kubernetes_feature_enabled gauge
kubernetes_feature_enabled{name="APIListChunking",stage=""} 1
kubernetes_feature_enabled{name="APIPriorityAndFairness",stage=""} 1
kubernetes_feature_enabled{name="APIResponseCompression",stage="BETA"} 1
kubernetes_feature_enabled{name="APISelfSubjectReview",stage=""} 1
kubernetes_feature_enabled{name="APIServerIdentity",stage="BETA"} 1
kubernetes_feature_enabled{name="APIServerTracing",stage="BETA"} 1
kubernetes_feature_enabled{name="AdmissionWebhookMatchConditions",stage="BETA"} 1
...
Este resultado indica que, por ejemplo, la función APIResponseCompression está habilitada y en la etapa beta.
¿Qué sigue?
Para obtener una lista completa de las características actuales de Kubernetes, consulta interruptores de funciones.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-05-01 (UTC)"],[],[],null,["# Feature gates\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview) [Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nThis page explains how Kubernetes\n[feature gates](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/)\nfunction in Google Kubernetes Engine (GKE). Feature gates are a set of key-value\npairs that toggle Kubernetes features. You can modify Kubernetes feature\ngates in GKE only with alpha clusters. For more information, see\n[Alpha clusters](/kubernetes-engine/docs/concepts/alpha-clusters).\n\nThe Kubernetes project releases new features in\n[stages](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-stages)\nover time. Features can be in the *alpha* , *beta* , or *GA* stage.\n\nTo see what features are enabled for your cluster running version 1.26 or later,\n[check the feature gate state](#check-feature-gate-state).\n\nAlternatively, to verify the stage of a feature corresponding to the version of\nyour cluster's control plane or nodes, check the [Feature gates for Alpha or\nBeta\nfeatures](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features)\ntable in the Kubernetes documentation.\n\n### GA Kubernetes features in GKE\n\nGA (also referred to as *stable* ) Kubernetes features are *enabled* on\nGKE by default and *cannot be disabled*.\n\n### Beta Kubernetes features in GKE\n\nBeta features are usually *enabled* by default in GKE.\nGKE might disable a specific beta feature for a particular\nversion to mitigate a known issue with the feature, to ensure backwards\ncompatibility, or because integration and qualification of the feature in\nGKE is not yet complete.\n\nIf you want to use a beta Kubernetes feature in your GKE cluster\nrunning version 1.26 or later, check that this feature is enabled by [checking\nthe feature gate state](#check-feature-gate-state). If your cluster is running a\nversion earlier than 1.26, you can check if the feature is enabled by testing\nthe feature.\n\n[Contact Cloud Customer Care](/support) if you can't verify whether the beta\nfeature is enabled for your GKE cluster's control plane or node\nversion.\n\n#### Kubernetes beta APIs with GKE clusters\n\nIn addition to beta Kubernetes features, you can also use Kubernetes beta APIs\nwith GKE clusters. For beta APIs that were introduced with\nversion 1.24 or later, you must configure beta APIs per resource per cluster.\nFor more information, see [Use Kubernetes beta APIs with GKE\nclusters](/kubernetes-engine/docs/how-to/use-beta-apis).\n\n### Alpha Kubernetes features in GKE\n\nAlpha Kubernetes features are disabled by default in all GKE\nclusters, except for [alpha\nclusters](/kubernetes-engine/docs/concepts/alpha-clusters). GKE\nmight enable a specific alpha feature in a specific control plane version.\n\nWith alpha clusters, all alpha feature gates available with the Kubernetes\nversion are enabled, and some beta feature gates, depending on the default\nvalue, are enabled. For more information about which feature gates are available\nwith specific versions, and which beta features are enabled by default, see\n[Feature gates for Alpha or Beta features](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features)\nin the Kubernetes documentation. You can also selectively modify specific\nfeature gates. For more information, see [Feature gates and alpha\nclusters](/kubernetes-engine/docs/concepts/alpha-clusters#feature-gates).\n\nTo enable all alpha Kubernetes features, create an\n[alpha Standard cluster](/kubernetes-engine/docs/concepts/alpha-clusters).\n| **Warning:** Alpha clusters are intended for experimental purposes and not for production workloads.\n\nCheck feature gate state\n------------------------\n\nWith clusters running version 1.26 or later, you can run a `kubectl` command\nto check what features are enabled.\n\nCheck the feature gate state for your GKE cluster:\n\n1. [Install and configure kubectl access](/kubernetes-engine/docs/how-to/cluster-access-for-kubectl)\n2. Run the following command:\n\n kubectl get --raw /metrics | grep kubernetes_feature_enabled\n\n The output, like in the following example, shows you the name of the feature\n gate, the corresponding stage (`\"\"` is GA), and whether the feature gate is\n enabled. `1` means enabled and `0` means disabled.\n\n See the following example output: \n\n # HELP kubernetes_feature_enabled [BETA] This metric records the data about the stage and enablement of a k8s feature.\n # TYPE kubernetes_feature_enabled gauge\n kubernetes_feature_enabled{name=\"APIListChunking\",stage=\"\"} 1\n kubernetes_feature_enabled{name=\"APIPriorityAndFairness\",stage=\"\"} 1\n kubernetes_feature_enabled{name=\"APIResponseCompression\",stage=\"BETA\"} 1\n kubernetes_feature_enabled{name=\"APISelfSubjectReview\",stage=\"\"} 1\n kubernetes_feature_enabled{name=\"APIServerIdentity\",stage=\"BETA\"} 1\n kubernetes_feature_enabled{name=\"APIServerTracing\",stage=\"BETA\"} 1\n kubernetes_feature_enabled{name=\"AdmissionWebhookMatchConditions\",stage=\"BETA\"} 1\n ...\n\n This output indicates that, for example, the `APIResponseCompression`\n feature is enabled and in the beta stage.\n\nWhat's next\n-----------\n\n- For a complete list of current Kubernetes features, see [Feature\n gates](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features).\n- For a full list of GKE features, refer to the [GKE release notes](/kubernetes-engine/docs/release-notes)."]]