Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
25372689
Commit
25372689
authored
Sep 05, 2017
by
Lion-Wei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add readme file of ipvs
parent
52ac2652
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
README.md
pkg/proxy/ipvs/README.md
+64
-0
No files found.
pkg/proxy/ipvs/README.md
0 → 100644
View file @
25372689
# How to use IPVS
This document shows how to use kube-proxy ipvs mode.
### What is IPVS
**IPVS (IP Virtual Server)**
implements transport-layer load balancing, usually called Layer 4 LAN switching, as part of
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
##### 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.
```
shell
modprobe ip_vs
modprobe ip_vs_rr
modprobe ip_vs_wrr
modprobe ip_vs_sh
modprobe nf_conntrack_ipv4
```
After that, use
`lsmod | grep ip_vs`
to make sure kernel modules are loaded.
##### Run kube-proxy in ipvs mode
First,
[
run cluster locally
](
https://github.com/kubernetes/community/blob/master/contributors/devel/running-locally.md
)
.
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.
```
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
```
##### Test
Use
`ipvsadm`
tool to test whether the kube-proxy start succeed. By default we may get result like:
```
shell
# ipvsadm -ln
IP Virtual Server version 1.2.1
(
size
=
4096
)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 10.0.0.1:443 rr persistent 10800
-> 10.229.43.2:6443 Masq 1 0 0
TCP 10.0.0.10:53 rr
UDP 10.0.0.10:53 rr
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment