Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Es gibt mehrere Kubernetes-Releases, in denen APIs eingestellt und entfernt wurden. Wenn Sie einen Google Distributed Cloud-Cluster auf eine neue Kubernetes-Version aktualisieren und Ihre Arbeitslasten APIs verwenden, die entfernt wurden, kann es zu Unterbrechungen kommen. Führen Sie die Schritte in diesem Dokument aus, um festzustellen, ob Ihre Arbeitslasten eine der entfernten APIs für eine bestimmte Kubernetes-Version verwenden, bevor Sie Ihren Cluster aktualisieren.
Prüfen, ob Sie von der API-Löschung betroffen sind
Für die folgenden Schritte muss in Ihren Google Distributed Cloud-Clustern das Audit-Logging aktiviert sein und die Audit-Logs müssen an Google Cloud Observability gestreamt werden, wobei es sich um das Standardverhalten handelt.
Wenn Sie feststellen möchten, ob die von Ihnen verwendeten Kubernetes-Dienstkonten gelöschte APIs aufrufen, führen Sie die folgende Abfrage im Log-Explorer aus:
Rufen Sie in der Google Cloud Console im Menü Logging die Seite Log-Explorer auf.
CLUSTER_NAME: der Name des Clusters, der die zu prüfenden Arbeitslasten enthält.
PROJECT_ID: die ID des Google Cloud-Projekts, das Ihr Cluster für Logs und Messwerte verwendet (clusterOperations.projectID).
KUBERNETES_MINOR_VERSION: die Kubernetes-Nebenversion, z. B. 1.25, aus der APIs entfernt wurden.
Die Ausgabe dieser Abfrage zeigt, ob eines Ihrer Kubernetes-Dienstkonten API-Aufrufe ausführt, die für die angegebene Kubernetes-Nebenversion entfernt wurden.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-04-29 (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."]]