Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Esistono diverse release di Kubernetes che hanno API deprecate e rimosse. Se esegui l'upgrade di un cluster Google Distributed Cloud a una nuova versione di Kubernetes e i tuoi carichi di lavoro utilizzano API rimosse, i carichi di lavoro possono essere interrotti. Segui i passaggi descritti in questo documento per determinare se i tuoi carichi di lavoro utilizzano una delle API rimosse per una determinata versione di Kubernetes prima di eseguire l'upgrade del cluster.
Determinare se l'eliminazione dell'API ti riguarda
I passaggi che seguono richiedono che nei cluster Google Distributed Cloud sia attivata la registrazione degli audit del cluster e che gli audit log vengano trasmessi in streaming a Google Cloud Observability, che è il comportamento predefinito.
Per determinare se gli account di servizio Kubernetes che utilizzi effettuano chiamate a API eliminate, esegui la query fornita in Esplora log:
Nella Google Cloud console, vai alla pagina Esplora log nel menu Logging.
CLUSTER_NAME: il nome del cluster che contiene
i carichi di lavoro che stai controllando.
PROJECT_ID: l'ID del Google Cloud progetto utilizzato dal tuo cluster per i log e le metriche (clusterOperations.projectID).
KUBERNETES_MINOR_VERSION: la versione secondaria di Kubernetes, ad esempio 1.25, che ha rimosso le API.
L'output di questa query mostra se uno dei tuoi account di servizio Kubernetes effettua chiamate all'API che sono state rimosse per la release minore Kubernetes specificata.
[[["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-09-04 UTC."],[],[],null,["There are several Kubernetes releases that have deprecated and removed APIs. If\nyou upgrade a Google Distributed Cloud cluster to a new Kubernetes version, and\nyour workloads use any APIs that have been removed, your workloads can be\ndisrupted. Follow the steps in this document to determine whether your workloads\nuse any of the removed APIs for a given Kubernetes version before you upgrade\nyour cluster.\n\nFor a list of removed APIs by Kubernetes release, see [Deprecated API Migration\nGuide](https://kubernetes.io/docs/reference/using-api/deprecation-guide/) in the\nKubernetes documentation.\n\nDetermine if the API deletion affects you\n\nThe following steps require that your Google Distributed Cloud clusters have\ncluster [audit logging](/kubernetes-engine/distributed-cloud/bare-metal/docs/how-to/audit-logging) enabled and that\naudit logs are streamed to [Google Cloud Observability](/stackdriver/docs), which is the\ndefault behavior.\n\nTo determine if the Kubernetes Service Accounts you use make calls to any\ndeleted APIs, run the supplied query in\n[Logs Explorer](/logging/docs/view/logs-explorer-interface):\n\n1. In the Google Cloud console, go to the **Logs Explorer** page in the\n **Logging** menu.\n\n [Go to Logs Explorer](https://console.cloud.google.com/logs/query)\n2. In the **Query** field, enter the following query:\n\n resource.labels.cluster_name = \"\u003cvar label=\"name of the cluster\" translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e\" AND\n logName = \"projects/\u003cvar label=\"the project ID\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/externalaudit.googleapis.com%2Factivity\" AND\n protoPayload.authenticationInfo.principalEmail:(\"system:serviceaccount\" OR \"@\") AND\n protoPayload.authenticationInfo.principalEmail!~(\"system:serviceaccount:kube-system:\") AND\n protoPayload.authenticationInfo.principalEmail!~(\"system:serviceaccount:cert-manager:\") AND\n protoPayload.authenticationInfo.principalEmail!~(\"system:serviceaccount:capi-kubeadm-bootstrap-system:\") AND\n protoPayload.authenticationInfo.principalEmail!~(\"system:serviceaccount:capi-kubeadm-bootstrap-system-webhook:\") AND\n protoPayload.authenticationInfo.principalEmail!~(\"system:serviceaccount:capi-system:\") AND\n protoPayload.authenticationInfo.principalEmail!~(\"system:serviceaccount:capi-system-webhook:\") AND\n labels.\"k8s.io/removed-release\"=\"\u003cvar label=\"k8s minor version\" translate=\"no\"\u003eKUBERNETES_MINOR_VERSION\u003c/var\u003e\"\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: the name of the cluster that contains\n the workloads that you're checking.\n\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the Google Cloud project that\n your cluster uses for logs and metrics (`clusterOperations.projectID`).\n\n - \u003cvar translate=\"no\"\u003eKUBERNETES_MINOR_VERSION\u003c/var\u003e: the minor Kubernetes\n version, such as 1.25, that has removed APIs.\n\n The output from this query shows if any of your Kubernetes Service Accounts\n make calls to API that have been removed for the given Kubernetes minor\n release."]]