Customizing Kube-proxy on an OVHcloud Managed Kubernetes cluster
Objective
The OVHcloud Managed Kubernetes service provides you with Kubernetes clusters without the hassle of installing or operating them.
The kube-proxy Kubernete's component (which runs on each Node and allows network communication to Pods) with iptables is actually a bottleneck to scale the cluster to a high number of Nodes so at OVHcloud we decided to reduce this bottleneck and allow you to use kube-proxy with IPVS.
IPVS (IP Virtual Server) is built on top of the Netfilter and implements transport-layer Load Balancing as part of the Linux kernel.
At OVHcloud, we listen to our users and improve our products and services accordingly, which is why we give you the ability to customize the kube-proxy configuration.
Requirements
- An OVHcloud Managed Kubernetes cluster
Instructions
Configure kube-proxy through the API
The API Explorer
To simplify things, we are using the API Explorer which allows to explore, learn and interact with the API in an interactive way.
Log in to the API Explorer using your OVHcloud NIC handle.

If you go to the Kubernetes section of the API Explorer, you will see the available endpoints:

API endpoints
- Get an existing cluster's customization:
Result:
- Create a Kubernetes cluster in the GRA5 region with IPVS kube-proxy mode:
This API call generate a configMap that will be used by the kube-proxy component.
To access this configMap you can execute the kubectl get cm kube-proxy -n kube-system -o yaml command.
The kube-proxy configMap in new Kubernetes clusters includes config.conf entry.
Both IPVS and iptables specific configuration can be set at the same time and kube-proxy will select the one to use according to the mode value.
If a field is not specified in the API payload, it will not be present in the config file and let kube-proxy use its default value (kubeProxyMode default is 'iptables').
You can take a look to the Kube-proxy default values for more information.
- Reset a Kubernetes cluster (all Kubernetes data will be erased (pods, services, configuration, etc), nodes will be either deleted or reinstalled)
kubeProxyMode cannot be modified, you need to reset your Kubernetes cluster.
Both kubeProxyMode and customization fields can be modified on cluster reset with the same payload used for creation.
If these fields are not specified, it will reset to default value (ipvs for kubeProxyMode and empty customization).
- Update only
kubeProxyand keep existingapiServercustomization if any:
kubeProxyMode cannot be modified by updating an existing cluster, it can only be set on cluster creation and reset.
- Update both apiServer and override kubeProxy configuration:
Updating the customization.kubeProxy field will trigger the following actions:
- apply updated configMap
- then rollout restart kube-proxy so it uses the new configuration
Configure kube-proxy through Terraform
Since the version 0.28.1+ of our OVH Terraform provider, you can configure the kube proxy of your Kubernetes cluster through Terraform.
Getting your cluster/API tokens information
The "OVH provider" needs to be configured with a set of credentials:
- an
application_key - an
application_secret - a
consumer_key
Why?
Because, behind the scenes, the "OVH Terraform provider" is doing requests to OVHcloud APIs.
In order to retrieve this necessary information, please follow our First steps with the OVHcloud APIs tutorial.
Specifically, you have to generate these credentials via the OVHcloud token generation page with the following rights:

When you have successfully generated your OVHcloud tokens, please save them as you will need to use them very soon.
The last needed information is the service_name: it is the ID of your Public Cloud project.
How to get it?
In the Public Cloud section, you can retrieve your service name ID thanks to the Copy to clipboard button.

You will also use this information in Terraform resources definition files.
Terraform instructions
First, create a provider.tf file with the minimum version, european endpoint ("ovh-eu") and the keys previously retrieved in this guide.
Terraform 0.13 and later:
Terraform 0.12 and earlier:
Alternatively the secret keys can be retrieved from your environment.
OVH_ENDPOINTOVH_APPLICATION_KEYOVH_APPLICATION_SECRETOVH_CONSUMER_KEY
This later method (or a similar alternative) is recommended to avoid storing secret data in a source repository.
Here, we defined the ovh-eu endpoint because we want to call the OVHcloud Europe API, but other endpoints exist, depending on your needs:
ovh-eufor OVHcloud Europe APIovh-usfor OVHcloud US APIovh-cafor OVHcloud North-America API
Then, create a variables.tf file with the service_name:
Define the resources you want to create in a new file called ovh_kube_cluster.tf:
In this resources configuration, we ask Terraform to create a Kubernetes cluster, in the GRA5 region, using the latest version of Kubernetes, with Kube proxy configuration, by specifying ipvs for the kube proxy mode.
Now we need to initialise Terraform, generate a plan, and apply it.
The init command will initialize your working directory which contains .tf configuration files.
It’s the first command to execute for a new configuration, or after doing a checkout of an existing configuration in a given git repository for example.
The init command will:
- Download and install Terraform providers/plugins
- Initialize the backend (if defined)
- Download and install modules (if defined)
Now, we can generate our plan:
Thanks to the plan command, we can check what Terraform wants to create, modify or remove.
The plan is OK for us, so let's apply it:
Destroy
If you want to delete the Kubernetes cluster you added through Terraform, you have to execute the terraform destroy command:
Go further
To have an overview of OVHcloud Managed Kubernetes service, you can go to the OVHcloud Managed Kubernetes page.
-
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for assisting you on your specific use case of your project.
-
Join our community of users.