<button class="button button-with-icon cloud-select-dropdown__button button-primary" aria-haspopup="true">Version 1.16 </button>

- [Latest](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/latest/how-to/no-kube-proxy)
- [Version 1.16](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/how-to/no-kube-proxy.md.txt)
- [Earlier versions (unsupported)](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/getting-support.md.txt#version-support)

<br />

> [!WARNING]
>
> **Preview**
>
>
> This feature is
>
> subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
> [Service Specific
> Terms](https://docs.cloud.google.com/terms/service-terms#1).
>
> Pre-GA features are available "as is" and might have limited support.
>
> For more information, see the
> [launch stage descriptions](https://cloud.google.com/products/#product-launch-stages).

This document shows how to create a cluster that does not use `kube-proxy`.

`kube-proxy` is a controller that runs on each worker node in a cluster. It
watches Kubernetes Service objects, and creates
[iptables](https://help.ubuntu.com/community/IptablesHowTo?action=show&redirect=Iptables)
rules to forward packets that are sent to Service addresses. An alternative to
using `kube-proxy` and iptables for this purpose is to use Dataplane V2 in
kube-proxy-replacement mode. This allows for the removal of `kube-proxy` from
the cluster.

## Supported operating systems

To create a cluster that does not use `kube-proxy`, use one of the supported
[Red Hat Enterprise Linux](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/installing/configure-os/rhel.md.txt)
operating systems or a supported
[Ubuntu](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/installing/configure-os/ubuntu.md.txt)
operating system with kernel version 5.7.0 or later. If your cluster uses an
Ubuntu operating system with kernel version earlier than 5.7.0, this feature is
not supported.

## Advantages of removing `kube-proxy`

- Avoid the resource consumption required for maintaining a large set of
  iptables rules.

- Improve performance. Creating iptables rules is time consuming, especially
  for large clusters.

## Create a cluster without `kube-proxy`

> [!WARNING]
> **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.

Follow the instructions in one of the
[cluster creation](https://docs.cloud.google.com/anthos/clusters/docs/bare-metal/1.16/installing/creating-clusters/create-clusters-overview.md.txt)
topics.

As you fill in your cluster configuration file, include the following
annotation:

```
preview.baremetal.cluster.gke.io/kube-proxy-free: "enable"
```

For example:

```
apiVersion: baremetal.cluster.gke.io/v1
kind: Cluster
metadata:
  name: alice
  namespace: cluster-alice
  annotations:
    preview.baremetal.cluster.gke.io/kube-proxy-free: "enable"
...
```

## Verify that `kube-proxy` is not in your cluster

List the DaemonSets in the cluster:

```
kubectl --kubeconfig CLUSTER_KUBECONFIG \
    get deamonsets --all-namespaces
```

Replace <var translate="no">CLUSTER_KUBECONFIG</var> with the path of the cluster
kubeconfig file.

Verify that `kube-proxy` is not in the list. For example:

<br />

```
kube-system   anetd
kube-system   audit-proxy
kube-system   etcd-defrag
kube-system   gke-metrics-agent
kube-system   kube-control-plane-metrics-proxy
kube-system   localpv
kube-system   metallb-speaker
kube-system   node-exporter
kube-system   stackdriver-log-forwarder
```

<br />