# Kube-proxy settings in custom RKE2 cluster

**URL:** <https://forums.suse.com/t/kube-proxy-settings-in-custom-rke2-cluster/40107>\
**Category:** SUSE Rancher Prime\
**Created:** [February 24, 2023, 9:35am UTC](https://forums.suse.com/t/kube-proxy-settings-in-custom-rke2-cluster/40107 "2023-02-24T09:35:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lolhax1337](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/lolhax1337/32/4967_2.png) [@lolhax1337](https://forums.suse.com/u/lolhax1337)\
**Post date:** [February 24, 2023, 9:35am UTC](https://forums.suse.com/t/kube-proxy-settings-in-custom-rke2-cluster/40107/1 "2023-02-24T09:35:49Z")

</div>

Hi!

I would like to set up this configuration for MetaLB:

```auto
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: "ipvs"
ipvs:
  strictARP: true

```

[https://metallb.universe.tf/installation/](https://metallb.universe.tf/installation/)

I’ve found instruction for RKE1: [How to enable IPVS proxy mode for kube-proxy | Support | SUSE](https://www.suse.com/support/kb/doc/?id=000020035).

For RKE2 I can’t find any instructions. I suspect it should be set in cluster.yaml, but no idea how.

Additional question: Is it possible to add two configs in " Additional Manifest" field? When I try to do it, I see error. I don’t believe I can’t add two CMs or resources, just one.  
Cluster Configuration → AddOn config → Additional Manifest

![image](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/0/023c6b2a88d6de028d2e586720d1b94157f4cb75.png)

When I try to add second cfg using apiversion: v1:  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/a/a7e1b98bf8f96aa532779a9fd2c58522f14b35ff.png)

---

<div class="post-metadata">

**Author:** ![lolhax1337](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/lolhax1337/32/4967_2.png) [@lolhax1337](https://forums.suse.com/u/lolhax1337)\
**Post date:** [February 24, 2023, 10:03am UTC](https://forums.suse.com/t/kube-proxy-settings-in-custom-rke2-cluster/40107/2 "2023-02-24T10:03:37Z")

</div>

This is exactly my case:

> <https://github.com/rancher/rke2/issues/3710>
>
> \*\*Environmental Info:\*\*
> RKE2 Version: v1.24.8+rke2r1
> 
> 
> Node(s) CPU architect…ure, OS, and Version: 
> 
> On ESXi/intel Centos 7.9
> Cluster Configuration:
> 
> 3 servers and 3 agents
> \*\*Describe the bug:\*\*
> 
> Im trying to install and configure metallb in layer 2mode. Which requires proxy mode ipvs and strict arp. When I try to apply these configuration changes to /var/lib/rancher/rke2/agent/pod-manifests/kube-proxy.yaml I get the following error in the kube-proxy pod.
> 
> "Can't use the IPVS proxier" err="IPVS proxier will not be used because the following required kernel modules are not loaded: \[ip\_vs\_wrr ip\_vs\_sh ip\_vs ip\_vs\_rr\]"
> 
> \*\*Steps To Reproduce:\*\*
> 
> \- Installed RKE2: I used the documentation with the only override being selinux: true. Edit /var/lib/rancher/rke2/agent/pod-manifests/kube-proxy.yaml to include --proxy-mode=ipvs --ipvs-strict-arp flags.
> 
> \*\*Expected behavior:\*\*
> 
> I expect to use proxy mode ipvs with strict arp
> \*\*Actual behavior:\*\*
> 
> Looks like hardened-kubernetes:v1.24.8-rke2r1-build20221110 does not have the correct kernel modules included
> 
> \*\*Additional context / logs:\*\*
> 
> I think I provided all thats needed. Let me know if more logs are needed.

But I dont know in which section of cluster.yaml should I add:

```auto
kube-proxy-arg:
  - proxy-mode=ipvs
  - ipvs-strict-arp=true

```

---

<div class="post-metadata">

**Author:** ![lolhax1337](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/lolhax1337/32/4967_2.png) [@lolhax1337](https://forums.suse.com/u/lolhax1337)\
**Post date:** [February 25, 2023, 5:51am UTC](https://forums.suse.com/t/kube-proxy-settings-in-custom-rke2-cluster/40107/3 "2023-02-25T05:51:44Z")

</div>

Ok, so looks like it works:

> **[RKE2 Cluster Configuration Reference](https://rancher.com/docs/rancher/v2.6/en/cluster-admin/editing-clusters/rke2-config-reference/)**

You can add arguments from rke2:

> **[Server Configuration Reference | RKE 2](https://docs.rke2.io/reference/server_config)**
>
> This is a reference to all parameters that can be used to configure the rke2 server. Note that while this is a reference to the command line arguments, the best way to configure RKE2 is using the configuration file.

under: `machineGlobalConfig:`, so for me in GUI in cluster.yaml:

```auto
machineGlobalConfig:
  kube-proxy-arg:
    - proxy-mode=ipvs
    - ipvs-strict-arp=true

```

And after this change, on my rancher-node:  
`root 3751955 3751907 0 05:42 ? 00:00:00 kube-proxy --cluster-cidr=10.42.0.0/16 --conntrack-max-per-core=0 --conntrack-tcp-timeout-close-wait=0s --conntrack-tcp-timeout-established=0s --healthz-bind-address=127.0.0.1 --hostname-override=worker-2 --ipvs-strict-arp=true --kubeconfig=/var/lib/rancher/rke2/agent/kubeproxy.kubeconfig --proxy-mode=ipvs`

Unfortunately, the documentation is unclear and support couldn’t distinguish between a RKE2 cluster imported into rancher and a cluster created from GUI (custom RKE2). They proposed to manually create config.yaml on node, and in this case after RKE2 restart the configuration would be deleted (becouse in custom RKE2 clusters created from GUI, every change should be done in cluster.yaml file)
