Merge pull request #54741 from m1093782566/ipvs-readme

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update ipvs proxy local up way in README.md

**What this PR does / why we need it**:

Update ipvs proxy local up way in README.md, since https://github.com/kubernetes/kubernetes/pull/54288 which support specify proxy mode for local-up.sh is already in.

**Which issue this PR fixes**: fixes #54742

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-10-30 13:00:03 -07:00 committed by GitHub
commit a55eeb9259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@
This document shows how to use kube-proxy ipvs mode. This document shows how to use kube-proxy ipvs mode.
### What is IPVS ## What is IPVS
**IPVS (IP Virtual Server)** implements transport-layer load balancing, usually called Layer 4 LAN switching, as part of **IPVS (IP Virtual Server)** implements transport-layer load balancing, usually called Layer 4 LAN switching, as part of
Linux kernel. Linux kernel.
@ -10,9 +10,9 @@ Linux kernel.
IPVS runs on a host and acts as a load balancer in front of a cluster of real servers. IPVS can direct requests for TCP IPVS runs on a host and acts as a load balancer in front of a cluster of real servers. IPVS can direct requests for TCP
and UDP-based services to the real servers, and make services of real servers appear as irtual services on a single IP address. and UDP-based services to the real servers, and make services of real servers appear as irtual services on a single IP address.
### How to use ## How to use
##### Load IPVS kernel modules #### Load IPVS kernel modules
Currently the IPVS kernel module can't be loaded automatically, so first we should use the following command to load IPVS kernel Currently the IPVS kernel module can't be loaded automatically, so first we should use the following command to load IPVS kernel
modules manually. modules manually.
@ -27,27 +27,17 @@ modprobe nf_conntrack_ipv4
After that, use `lsmod | grep ip_vs` to make sure kernel modules are loaded. After that, use `lsmod | grep ip_vs` to make sure kernel modules are loaded.
##### Run kube-proxy in ipvs mode #### Run kube-proxy in ipvs mode
First, [run cluster locally](https://github.com/kubernetes/community/blob/master/contributors/devel/running-locally.md). #### Local UP Cluster
By default kube-proxy will run in iptables mode, with configuration file `/tmp/kube-proxy.yaml`. so we need to change the Kube-proxy will run in iptables mode by default in a [local-up cluster](https://github.com/kubernetes/community/blob/master/contributors/devel/running-locally.md).
configuration file and restart it. Here is a yaml file for reference.
```yaml Users should export the env `KUBEPROXY_MODE=ipvs` to specify the ipvs mode before deploying the cluster if want to run kube-proxy in ipvs mode.
apiVersion: componentconfig/v1alpha1
kind: KubeProxyConfiguration
clientConnection:
kubeconfig: /var/run/kubernetes/kube-proxy.kubeconfig
hostnameOverride: 127.0.0.1
mode: ipvs
featureGates: AllAlpha=true
ipvs:
minSyncPeriod: 10s
syncPeriod: 60s
```
##### Test // TODO: Kubeadm
#### Test
Use `ipvsadm` tool to test whether the kube-proxy start succeed. By default we may get result like: Use `ipvsadm` tool to test whether the kube-proxy start succeed. By default we may get result like: