É possível identificar clusters inativos do Google Kubernetes Engine (GKE) usando insights e recomendações do Recomendador de cluster inativo.
Depois de verificar se os clusters inativos identificados não estão sendo usados, exclua-os para economizar custos. O Recomendador de cluster inativo não é relevante para clusters do Autopilot, que geram custos operacionais mínimos, porque você paga apenas pelos recursos solicitados pelas cargas de trabalho. Para saber mais, consulte Preços do Autopilot.
O GKE monitora seus clusters e fornece orientações para otimizar o
uso com o Recommender, um serviço que fornece insights e
recomendações para usar recursos no Google Cloud.
Para identificar clusters inativos, visualize insights e
recomendações
gerados pelo Recomendador de cluster inativo usando o console do Google Cloud,
a Google Cloud CLI ou a API Recommender. Use os subtipos de insight mostrados
na tabela na seção a seguir e o
subtipo de recomendação CLUSTER_IDLE. No console, esses insights aparecem na guia Otimização de custos da página Clusters.
Esse recomendador usa sinais de utilização para determinar se você receberá um insight ou uma recomendação.
A tabela a seguir descreve os sinais que o Recomendador de cluster inativo usa e o limite de cada sinal. Cada indicador aciona um insight independente. Se houver vários insights para o mesmo cluster, o GKE exibirá uma única recomendação.
Subtipo de insight
Sinal
Limite
Detalhes
CLUSTER_IDLE_NO_RUNNING_PODS
Nenhum pod de cliente em execução
Últimos 30 dias
Não há pods no estado Running fora do namespace kube-system e gmp-system nos logs de eventos de métricas do cluster nos últimos 30 dias.
CLUSTER_IDLE_NO_NODES
Nenhum nó ou pool de nós
Últimos 30 dias
Não há nós ou pools de nós nos logs de eventos de métricas do cluster nos últimos 30 dias.
CLUSTER_IDLE_LOW_CPU_UTILIZATION
Baixa utilização da CPU e nenhum novo objeto
Abaixo da média de 7% durante 1 hora e nos últimos 30 dias
O uso da CPU (média durante 1 hora) está abaixo de 7%, e não houve alteração na contagem de objetos nos últimos 30 dias.
Considerações ao excluir clusters inativos
Antes de excluir um cluster inativo indicado pelo Recomendador de cluster inativo, pense nas possibilidades a seguir:
Alguém usa o cluster? Por exemplo, um cluster pode estar intencionalmente inativo se o objetivo dele é manter a capacidade de failover.
O cluster pode ter redução de escala vertical em vez de ser excluído? Por exemplo, um cluster que executa uma carga de trabalho útil pode ter baixa utilização e ser identificado como inativo porque mais recursos foram provisionados do que o necessário.
Implementar a recomendação para excluir clusters inativos
Se você recebeu um insight e uma recomendação de que tem um cluster inativo que pode ser excluído e excluiu as considerações para manter o cluster em execução, siga as instruções na recomendação e exclua o cluster.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2024-08-30 UTC."],[],[],null,["# Identify idle GKE clusters\n\n[Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nYou can identify idle Google Kubernetes Engine (GKE) Standard clusters\nusing insights and recommendations. After you verify that the identified idle\nclusters are unused, you can delete them to save costs. If possible, the\nrecommendation includes projected monthly savings for deleting a cluster. For\nmore information, see [Understand cost estimation for idle\nclusters](#cost-estimate).\n\nGKE provides insights and recommendations for cost optimization\nscenarios such as underprovisioned clusters, overprovisioned clusters, and idle\nclusters, with corresponding recommendations to scale up, scale down, or delete\nthe clusters. This page explains how to identify idle clusters. See also,\n[Identify underprovisioned and overprovisioned GKE\nclusters](/kubernetes-engine/docs/how-to/optimize-cluster-utilization).\n\nGKE doesn't provide insights for Autopilot\nclusters, which incur minimal operational costs as you only pay for the\nresources that your workloads request. For more information, see\n[Autopilot\nPricing](/kubernetes-engine/docs/concepts/autopilot-overview#pricing).\n\nGKE monitors your clusters and delivers guidance to optimize your\nusage through [Active Assist](/recommender/docs/whatis-activeassist), a\nservice that provides recommenders that generate insights and recommendations\nfor using resources on Google Cloud.\n\nFor more information about how to manage insights and recommendations, see\n[Optimize your usage of GKE with insights and recommendations](/kubernetes-engine/docs/how-to/optimize-with-recommenders).\n\nIdentify idle clusters\n----------------------\n\nTo identify idle clusters, [view insights and\nrecommendations](/kubernetes-engine/docs/how-to/optimize-with-recommenders#view-insights-recs)\nusing the Google Cloud console, the Google Cloud CLI, or the Recommender API. Use\nthe insight subtypes shown in [the table in the following\nsection](#how-idle-clusters) and the `CLUSTER_IDLE` recommendation subtype. In\nthe console, these insights appear in the **Cost Optimization**\ntab on the **Clusters** page.\n\nAfter you identify idle clusters, see the [considerations when deleting idle\nclusters](#idle-cluster-considerations).\n\nHow GKE identifies idle clusters\n--------------------------------\n\nGKE uses utilization signals to determine whether you receive an\ninsight and recommendation.\n\nThe following table describes the signals that GKE uses and the\nthreshold for each signal. Each signal triggers an independent insight. If a\ncluster has multiple insights, GKE displays a single\nrecommendation.\n\nGKE doesn't send recommendations for clusters that were created\nless than 30 days ago.\n\nUnderstand cost estimation for idle clusters\n--------------------------------------------\n\nIf possible, GKE includes with the recommendation an estimated\nmonthly cost of the idle cluster, projecting how much money you'd save each\nmonth if you deleted the cluster. This estimate is derived from the cluster\ncosts over the past 30 days.\n\nAny estimated savings are projections based on previous spending, and are not a\nguarantee of future cost or savings.\n\nTo see these estimates, ensure that you have the required\n`billing.accounts.getSpendingInformation` permission to get spending\ninformation. For details, see [Cloud Billing\naccess](/billing/docs/how-to/billing-access#billing-access).\n\nTo get more information about the cost of all of your GKE\nclusters, including a more granular breakdown based on namespaces and workloads,\nsee [Get key spending insights for your GKE resource allocation\nand cluster costs](/kubernetes-engine/docs/how-to/cost-allocations).\n\nFor more information about the costs of running a GKE cluster,\nsee [GKE pricing](/kubernetes-engine/pricing).\n\nConsiderations when deleting idle clusters\n------------------------------------------\n\nBefore you delete a cluster that GKE determines is idle,\nconsider the following possibilities:\n\n- Does anyone use the cluster? For example, a cluster might be intentionally idle if its purpose is to maintain failover capacity.\n- Should the cluster be scaled down instead of deleted? For example, a cluster running a useful workload might have low utilization and be identified as idle because more resources were provisioned than necessary.\n\nImplement the recommendation to delete idle clusters\n----------------------------------------------------\n\nIf you've received an insight and recommendation that you have an idle cluster\nthat can be deleted and have ruled out the [considerations](#idle-cluster-considerations)\nfor keeping the cluster running, follow the instructions in the recommendation\nand delete the cluster.\n\nWhat's next\n-----------\n\n- [Optimize your usage of GKE with insights and recommendations](/kubernetes-engine/docs/how-to/optimize-with-recommenders).\n- [Best practices for running cost-optimized Kubernetes applications on GKE](/architecture/best-practices-for-running-cost-effective-kubernetes-applications-on-gke)."]]