Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
In diesem Dokument wird gezeigt, wie Sie einen Cluster erstellen, der kube-proxy nicht verwendet.
kube-proxy ist ein Controller, der auf jedem Worker-Knoten in einem Cluster ausgeführt wird. Er beobachtet Kubernetes-Serviceobjekte und erstellt
iptables-
Regeln zum Weiterleiten von Paketen, die an Dienstadressen gesendet werden. Eine Alternative zur Verwendung von kube-proxy und iptables zu diesem Zweck
ist die Verwendung von Dataplane V2 im kube-proxy-Ersatzmodus. Dies ermöglicht das Entfernen von kube-proxy aus
dem Cluster.
Unterstützte Betriebssysteme
Wenn Sie einen Cluster ohne kube-proxy erstellen möchten, verwenden Sie eine der unterstützten
Red Hat Enterprise Linux
oder einem unterstützten
Ubuntu-
Betriebssystem mit Kernel-Version 5.7.0 oder höher. Wenn Ihr Cluster ein
Ubuntu-Betriebssystem mit einer Kernel-Version vor 5.7.0 ist, wird diese Funktion nicht unterstützt.
Vorteile des Entfernens von kube-proxy
Vermeiden Sie den Ressourcenverbrauch, der zum Verwalten einer großen Reihe von iptables-Regeln erforderlich ist.
Optimieren Sie die Leistung. Das Erstellen von iptables-Regeln ist zeitaufwendig, insbesondere bei großen Clustern.
Cluster ohne kube-proxy erstellen
Folgen Sie der Anleitung in einem der Dokumente zur Clustererstellung.
Fügen Sie beim Ausfüllen Ihrer Clusterkonfigurationsdatei die folgende Annotation ein:
[[["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-09-03 (UTC)."],[],[],null,["| **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 document shows how to create a cluster that does not use `kube-proxy`.\n\n`kube-proxy` is a controller that runs on each worker node in a cluster. It\nwatches Kubernetes Service objects, and creates\n[iptables](https://help.ubuntu.com/community/IptablesHowTo?action=show&redirect=Iptables)\nrules to forward packets that are sent to Service addresses. An alternative to\nusing `kube-proxy` and iptables for this purpose is to use Dataplane V2 in\nkube-proxy-replacement mode. This allows for the removal of `kube-proxy` from\nthe cluster.\n\nSupported operating systems\n\nTo create a cluster that does not use `kube-proxy`, use one of the supported\n[Red Hat Enterprise Linux](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/configure-os/rhel)\noperating systems or a supported\n[Ubuntu](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/configure-os/ubuntu)\noperating system with kernel version 5.7.0 or later. If your cluster uses an\nUbuntu operating system with kernel version earlier than 5.7.0, this feature is\nnot supported.\n\nAdvantages of removing `kube-proxy`\n\n- Avoid the resource consumption required for maintaining a large set of\n iptables rules.\n\n- Improve performance. Creating iptables rules is time consuming, especially\n for large clusters.\n\nCreate a cluster without `kube-proxy` **Warning:** If you create a cluster that has `kube-proxy` removed, you cannot reverse that decision. That is, you cannot add `kube-proxy` to the cluster at a later time.\n\nFollow the instructions in one of the\n[cluster creation](/kubernetes-engine/distributed-cloud/bare-metal/docs/installing/creating-clusters/create-clusters-overview)\ntopics.\n\nAs you fill in your cluster configuration file, include the following\nannotation:\n\n```\npreview.baremetal.cluster.gke.io/kube-proxy-free: \"enable\"\n```\n\nFor example:\n\n```\napiVersion: baremetal.cluster.gke.io/v1\nkind: Cluster\nmetadata:\n name: alice\n namespace: cluster-alice\n annotations:\n preview.baremetal.cluster.gke.io/kube-proxy-free: \"enable\"\n...\n```\n\nVerify that `kube-proxy` is not in your cluster\n\nList the DaemonSets in the cluster:\n\n```\nkubectl --kubeconfig CLUSTER_KUBECONFIG \\\n get daemonsets --all-namespaces\n```\n\nReplace \u003cvar translate=\"no\"\u003eCLUSTER_KUBECONFIG\u003c/var\u003e with the path of the cluster\nkubeconfig file.\n\nVerify that `kube-proxy` is not in the list. For example:\n\n\u003cbr /\u003e\n\n```\nkube-system anetd\nkube-system audit-proxy\nkube-system etcd-defrag\nkube-system gke-metrics-agent\nkube-system kube-control-plane-metrics-proxy\nkube-system localpv\nkube-system metallb-speaker\nkube-system node-exporter\nkube-system stackdriver-log-forwarder\n```\n\n\u003cbr /\u003e"]]