Personalizzare i componenti di sistema sui cluster AKS
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive come personalizzare i componenti di sistema di proprietà di Google nei cluster GKE allegati applicando tolleranze ed etichette personalizzate. Quando
personalizzi questi componenti, hai una gestione più precisa di dove e come
operano all'interno del tuo ambiente.
Panoramica
Quando colleghi un cluster a Google Cloud, per impostazione predefinita, i componenti di sistema di proprietà di Google non includono campi personalizzabili come le tolleranze. Di conseguenza,
potresti riscontrare problemi come la mancata pianificazione dei pod sui nodi disponibili, il che
influisce sull'attestazione e sulla funzionalità complessive del cluster. Inoltre, potresti richiedere
il controllo del posizionamento e della gestione dei componenti su nodi specifici, inclusa la
possibilità di applicare etichette personalizzate per scopi organizzativi e operativi.
La personalizzazione dei componenti di sistema risolve questi problemi e ti consente di avere un maggiore
controllo e flessibilità sul modo in cui questi componenti operano nel tuo cluster. Puoi
applicare tolleranze ed etichette personalizzate ai componenti di sistema di proprietà di Google:
Le tolleranze consentono ai componenti di Google di pianificare nodi con taint Kubernetes specifici, il che ti consente di applicare la separazione dei workload o utilizzare pool di nodi specializzati. Le tolleranze personalizzate risolvono direttamente
i problemi in cui i taint non modificabili impediscono il corretto posizionamento dei componenti.
Le etichette offrono un modo flessibile per classificare e identificare i componenti di sistema di Google in base ai tuoi standard operativi. Le etichette personalizzate consentono una migliore integrazione con gli strumenti esistenti di monitoraggio, logging e applicazione delle norme.
Limitazioni e restrizioni
Si applicano le seguenti limitazioni e restrizioni:
Puoi aggiungere tolleranze ed etichette personalizzate solo quando registri il cluster.
Puoi aggiungere fino a 10 tolleranze personalizzate e 10 etichette personalizzate al cluster.
Non puoi utilizzare le seguenti etichette:
name
component
app
Qualsiasi etichetta che includa k8s.io o kubernetes.io, in quanto appartengono a
etichette riservate in Kubernetes
Qualsiasi etichetta che includa google
Qualsiasi etichetta che includa gke.io
Aggiungi tolleranze personalizzate
I pod dei componenti di sistema di proprietà di Google includono sempre la seguente tolleranza:
GOOGLE_CLOUD_REGION: la Google Cloud regione da cui amministrare il cluster.
COMPONENT_TOLERATION: l'elenco separato da virgole delle
tolleranze che vuoi aggiungere. Puoi fornire una chiave, un valore, un operatore e
un effetto nei seguenti formati:
Per l'operatore Equal: utilizza il formato key=value:operator:effect, ad esempio workload=hpc:Equal:NoSchedule. Questa impostazione indica che il pod
tollererà un'incompatibilità solo se questa ha la chiave e il valore esatti di
workload=hpc.
Per l'operatore Exists: utilizza il formato key:operator:effect, ad esempio workload:Exists:NoSchedule. Questa impostazione indica che il pod
tollererà qualsiasi incompatibilità con la chiave workload sul nodo, indipendentemente dal
valore.
Per la pianificazione su qualsiasi nodo: utilizza il formato :operator:effect, ad esempio :Exists:NoSchedule. Questa impostazione indica che il pod tollera qualsiasi
incompatibilità sul nodo con l'effetto NoSchedule e
ignora la chiave o il valore dell'incompatibilità.
Per un elenco degli operatori e degli effetti che puoi utilizzare, consulta Incompatibilità e tolleranze nella documentazione di Kubernetes.
Aggiungere etichette personalizzate
Per specificare etichette personalizzate, aggiungi il flag --system-component-labels al comando gcloud container attached clusters register:
GOOGLE_CLOUD_REGION: la Google Cloud regione da cui amministrare il cluster.
COMPONENT_LABEL: l'elenco separato da virgole di una o più
etichette che vuoi aggiungere. Fornisci un'etichetta e un valore nel formato
key=value. Ad esempio: env=production,region=us-east-1. Sebbene ogni etichetta
debba avere una chiave, il valore associato a questa chiave può essere vuoto. Ad esempio,
backend="".
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-14 UTC."],[],[],null,["# Customize system components on AKS clusters\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page describes how to customize Google-owned system components in your\nGKE attached clusters by applying custom tolerations and labels. When you\ncustomize these components, you have more precise management of where and how\nthese components operate within your environment.\n\nOverview\n--------\n\nWhen you attach a cluster to Google Cloud, by default, Google-owned system\ncomponents don't include customizable fields such as tolerations. As a result,\nyou might experience issues such as Pods failing to schedule on available nodes, which\nimpact overall cluster attachment and functionality. Additionally, you might require\ncontrol over placing and managing components on specific nodes that include the\nability to apply custom labels for organizational and operational purposes.\n\nCustomizing system components resolves these issues and lets you have more\ncontrol and flexibility over how these components operate in your cluster. You\ncan apply custom *tolerations* and *labels* to Google-owned system components:\n\n- **Tolerations** provide the ability for Google's components to schedule onto\n nodes that have specific Kubernetes taints, which lets you enforce workload\n separation or use specialized node pools. Custom tolerations directly resolve\n issues where unmodifiable taints prevent proper component placement.\n\n- **Labels** offer a flexible way for you to categorize and identify Google's\n system components according to your own operational standards. Custom labels\n enable better integration with your existing monitoring, logging, and policy\n enforcement tools.\n\nRestrictions and limitations\n----------------------------\n\nThe following restrictions and limitations apply:\n\n- You can only add custom tolerations and labels when you [register your cluster](/kubernetes-engine/multi-cloud/docs/attached/aks/how-to/attach-cluster#attach_your_aks_cluster).\n- You can add up to 10 custom tolerations and 10 custom labels to your cluster.\n- You *can't* use the following labels:\n\n - `name`\n - `component`\n - `app`\n - Any label which includes `k8s.io` or `kubernetes.io` since they belong to reserved labels in Kubernetes\n - Any label which includes `google`\n - Any label which includes `gke.io`\n\nAdd custom tolerations\n----------------------\n\nGoogle-owned system component Pods always include the following toleration: \n\n - key: components.gke.io/gke-managed-components\n operator: Exists\n\nTo specify custom tolerations, add the `--system-component-tolerations` flag to the\n[`gcloud container attached clusters register`](/sdk/gcloud/reference/container/attached/clusters/register) command: \n\n gcloud container attached clusters register \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_REGION\u003c/var\u003e \\\n ...\n --system-component-tolerations=\u003cvar translate=\"no\"\u003eCOMPONENT_TOLERATION\u003c/var\u003e \\\\\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of your cluster.\n- \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_REGION\u003c/var\u003e: the Google Cloud region to administer your cluster from.\n- \u003cvar translate=\"no\"\u003eCOMPONENT_TOLERATION\u003c/var\u003e: the comma-separated list of the\n tolerations that you want to add. You can provide a key, value, operator, and\n effect in the following formats:\n\n - **For the `Equal` operator** : use the format `key=value:operator:effect`, for example, `workload=hpc:Equal:NoSchedule`. This setting means that the Pod tolerates a taint only if the taint has the exact key and value of `workload=hpc`.\n - **For the `Exists` operator** : use the format `key:operator:effect`, for example, `workload:Exists:NoSchedule`. This setting means that the Pod tolerates any taint with the `workload` key on the node, regardless of the value.\n - **For scheduling on any node** : use the format `:operator:effect`, for example, `:Exists:NoSchedule`. This setting means that the Pod tolerates any taint on the node that has the effect `NoSchedule`, and ignores the key or value of the taint.\n\n For a list of operators and effects that you\n can use, see [Taints and Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)\n in the Kubernetes documentation.\n\nAdd custom labels\n-----------------\n\nTo specify custom labels, add the `--system-component-labels` flag to the\n`gcloud container attached clusters register` command: \n\n gcloud container attached clusters register \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_REGION\u003c/var\u003e \\\n ...\n --system-component-labels=\u003cvar translate=\"no\"\u003eCOMPONENT_LABEL\u003c/var\u003e \\\\\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of your cluster.\n- \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_REGION\u003c/var\u003e: the Google Cloud region to administer your cluster from.\n- \u003cvar translate=\"no\"\u003eCOMPONENT_LABEL\u003c/var\u003e: the comma-separated list of one or more labels that you want to add. You provide a label and value in the format of `key=value`. For example, `env=production,region=us-east-1`. Although every label must have a key, the value associated with that key can be empty. For example, `backend=\"\"`.\n\nWhat's next\n-----------\n\n- Learn more about [Taints and Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) in the Kubernetes documentation.\n- Learn how to [attach your AKS cluster](/kubernetes-engine/multi-cloud/docs/attached/aks/how-to/attach-cluster)."]]