Las definiciones de recursos personalizados (CRD) son herramientas eficaces para extender las capacidades de Kubernetes.
Sin embargo, si una CRD contiene un paquete de entidades de certificación (CA) no válido o con formato incorrecto dentro de su configuración de webhook de conversión spec.conversion.webhook.clientConfig.caBundle, puede interrumpir las operaciones del clúster. Esto puede manifestarse como errores durante la creación, actualización o eliminación de recursos. Google Kubernetes Engine (GKE) supervisa tus clústeres y usa el servicio de recomendador para brindar orientación sobre cómo optimizar el uso de la plataforma.
Para ayudarte a garantizar que tu clúster permanezca estable y tenga un buen rendimiento, consulta las recomendaciones de GKE para los CRD que funcionan, pero tienen un paquete de CA no válido. Usa esta guía para verificar tus CRD potencialmente mal configuradas y actualizarlas, si es necesario. Para obtener más información sobre cómo administrar las estadísticas y las recomendaciones de recomendadores, consulta Optimiza el uso de GKE con estadísticas y recomendaciones.
Identifica los clústeres afectados
Para obtener estadísticas que identifiquen los clústeres afectados por CRD con paquetes de CA no válidos, sigue las instrucciones para ver estadísticas y recomendaciones para el subtipo K8S_CRD_WITH_INVALID_CA_BUNDLE. Puedes obtener estadísticas de las siguientes maneras:
Usa la Google Cloud consola.
Usa Google Cloud CLI o la API de Recommender y filtra con el subtipo K8S_CRD_WITH_INVALID_CA_BUNDLE.
GKE genera una estadística y una recomendación con el subtipo K8S_CRD_WITH_INVALID_CA_BUNDLE si el clúster de GKE tiene uno o más CRD que informan un caBundle mal configurado para la configuración del cliente de webhook en spec.conversion.webhook.clientConfig.
En las siguientes secciones, se incluyen instrucciones para solucionar problemas de los CRD que GKE detectó como potencialmente mal configurados.
Después de que implementes las instrucciones y los CRD se configuren de forma correcta, la recomendación se resuelve en un plazo de 24 horas y ya no aparece en la consola.
Si transcurrieron menos de 24 horas desde que implementaste la guía de la recomendación, puedes marcarla como resuelta.
Si no deseas implementar la recomendación, puedes descartarla.
Identifica los CRD afectados en un clúster
Consulta las estadísticas y recomendaciones para el subtipo K8S_CRD_WITH_INVALID_CA_BUNDLE y elige una estadística a la vez para solucionar problemas. GKE genera una estadística por cada clúster que tiene un CRD dañado.
Ejecuta el siguiente comando para describir el servicio y encontrar CRD con paquetes de CA potencialmente problemáticos:
CaBundle: Es el paquete de CA asociado con el webhook de conversión del CRD, si está presente. Examina el resultado. Si la columna caBundle está vacía para un CRD que sabes que utiliza un webhook de conversión, esto indica un posible problema con caBundle.
Vuelve a crear la CRD
Para resolver este error, vuelve a crear el CRD afectado con un paquete de CA válido:
Haz una copia de seguridad de los recursos personalizados existentes asociados con este CRD problemático, si tienes alguno. Ejecuta el siguiente comando para exportar los recursos existentes:
kubectlget<crd-name>-oyaml > backup.yaml
Borra el CRD existente:
kubectldeletecrd<crd-name>
Asegúrate de que el campo caBundle de la CRD contenga un certificado PEM con codificación base64 y con el formato correcto. Para ello, edita la CRD directamente o comunícate con sus autores.
Modifica la definición YAML de la CRD y actualiza el campo spec.conversion.webhook.clientConfig.caBundle con los datos válidos del paquete de la CA. El resultado debería ser similar a lo siguiente:
[[["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-09-01 (UTC)"],[],[],null,["# Troubleshoot CRDs with an invalid CA bundle\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview) [Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\n[Custom Resource\nDefinitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/)\n(CRDs) are powerful tools for [extending Kubernetes\ncapabilities](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/).\nHowever, if a CRD contains an invalid or malformed Certificate Authority (CA)\nbundle within its conversion webhook configuration\n`spec.conversion.webhook.clientConfig.caBundle`, it can disrupt cluster\noperations. This can manifest as errors during resource creation, updates, or\ndeletions. Google Kubernetes Engine (GKE) monitors your clusters and uses the\nRecommender service to deliver guidance for how you can optimize your usage of\nthe platform.\n\nTo help you ensure that your cluster remains stable and\nperformant, see recommendations from GKE for CRDs that operate but\nhave an invalid CA bundle. Use this guidance to check your potentially misconfigured CRDs and update them, if necessary. To learn more about how to manage insights and recommendations from\nRecommenders, see [Optimize your usage of GKE with insights and\nrecommendations](/kubernetes-engine/docs/how-to/optimize-with-recommenders).\n\nIdentify impacted clusters\n--------------------------\n\nTo get insights identifying clusters that are affected by CRDs with invalid CA bundles, follow\nthe instructions to [view insights and recommendations](/kubernetes-engine/docs/how-to/optimize-with-recommenders#view-insights-recs) for subtype `K8S_CRD_WITH_INVALID_CA_BUNDLE`. You can get insights in\nthe following ways:\n\n- Use the Google Cloud console.\n- Use the Google Cloud CLI, or the Recommender API, filtering with the subtype `K8S_CRD_WITH_INVALID_CA_BUNDLE`.\n\nAfter you identify the CRDs using the insights, follow the instructions to\n[troubleshoot the misconfigured CA bundle](#troubleshoot-crds).\n\nWhen GKE detects misconfigured CRDs\n-----------------------------------\n\nGKE generates an insight and recommendation with the\n`K8S_CRD_WITH_INVALID_CA_BUNDLE` subtype if the GKE cluster has\none or more CRDs reporting a misconfigured `caBundle` for the webhook client\nconfiguration in `spec.conversion.webhook.clientConfig`.\n\nFollow the instructions to [check CRDs with misconfigured CA bundle](#check-invalid-caBundle).\n\nTroubleshoot the detected CRDs\n------------------------------\n\nThe following sections have instructions for you to troubleshoot the CRDs that\nGKE detected as potentially misconfigured.\n\nAfter you implement the instructions and the CRDs are correctly configured, the\nrecommendation is resolved within 24 hours and no longer appears in the console.\nIf it has been less than 24 hours since you've implemented the guidance of the\nrecommendation, you can [mark the recommendation as\nresolved](/kubernetes-engine/docs/how-to/optimize-with-recommenders#resolve-recommendation).\nIf you don't want to implement the recommendation, you can [dismiss\nit](/kubernetes-engine/docs/how-to/optimize-with-recommenders#dismiss-recommendation).\n\n### Identify affected CRDs in a cluster\n\n1. [View insights and\n recommendations](/kubernetes-engine/docs/how-to/optimize-with-recommenders#view-insights-recs) for subtype `K8S_CRD_WITH_INVALID_CA_BUNDLE`,\n choosing one insight at a time to troubleshoot. GKE generates\n one insight per cluster which has a broken CRD.\n\n2. Run the following command to describe the Service to find CRDs with\n potentially problematic CA bundles:\n\n kubectl get crd -o custom-columns=NAME:.metadata.name,CABUNDLE:.spec.conversion.webhook.clientConfig.caBundle\n\n The output includes the following:\n - **Name**: The name of the CRD.\n - **CaBundle**: The CA bundle associated with the CRD's conversion webhook, if present. Examine the output. If the caBundle column is empty for a CRD that you know utilizes a conversion webhook, this signals a potential issue with the caBundle.\n\n### Recreate the CRD\n\nTo resolve this error, recreate the affected CRD with a valid CA bundle:\n\n1. Back up existing custom resources associated with this problematic\n CRD, if you have any. Run the following command to export the existing\n resources:\n\n kubectl get \u003ccrd-name\u003e -o yaml \u003e backup.yaml\n\n2. Delete the existing CRD:\n\n kubectl delete crd \u003ccrd-name\u003e\n\n3. Ensure that the `caBundle` field of the CRD contains a well-formed,\n base-64-encoded PEM certificate. You can do this either by editing the\n CRD directly or by reaching out to its authors.\n\n4. Modify the CRD YAML definition, updating the\n `spec.conversion.webhook.clientConfig.caBundle` field with the valid\n CA bundle data. The result should look something like the following:\n\n spec:\n conversion:\n webhook:\n clientConfig:\n caBundle: \u003cbase64-encoded-ca-bundle\u003e\n\n5. Apply the corrected CRD:\n\n kubectl apply -f \u003ccorrected-crd-file.yaml\u003e\n\n6. Restore your custom resources:\n\n kubectl apply -f backup.yaml\n\nWhat's next\n-----------\n\n- [Optimize your usage of GKE with insights and\n recommendations](/kubernetes-engine/docs/how-to/optimize-with-recommenders)\n- [Troubleshooting common issues](/kubernetes-engine/docs/troubleshooting)"]]