update ipvs proxy readme

pull/6/head
m1093782566 2017-10-28 11:33:11 +08:00
parent 5ad34ac60a
commit bf2776eb3f
1 changed files with 10 additions and 20 deletions

View File

@ -2,7 +2,7 @@
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
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
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
modules manually.
@ -27,27 +27,17 @@ modprobe nf_conntrack_ipv4
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
configuration file and restart it. Here is a yaml file for reference.
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).
```yaml
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
```
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.
##### Test
// TODO: Kubeadm
#### Test
Use `ipvsadm` tool to test whether the kube-proxy start succeed. By default we may get result like: