Skip to content

Commit

Permalink
docs: new feat for disable-ic, regex iface and pod bind subnet
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Nov 4, 2020
1 parent bb99e7a commit cbe0ad5
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/images/install-pre-1.16.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IPv6=${IPv6:-false}
ENABLE_SSL=${ENABLE_SSL:-false}
ENABLE_MIRROR=${ENABLE_MIRROR:-false}
HW_OFFLOAD=${HW_OFFLOAD:-false}
IFACE="" # The nic to support container network, if empty will use the nic that the default route use
IFACE="" # The nic to support container network can be a nic name or a group of regex separated by comma, if empty will use the nic that the default route use

REGISTRY="kubeovn"
VERSION="v1.6.0"
Expand Down
4 changes: 3 additions & 1 deletion dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ IPv6=${IPv6:-false}
ENABLE_SSL=${ENABLE_SSL:-false}
ENABLE_MIRROR=${ENABLE_MIRROR:-false}
HW_OFFLOAD=${HW_OFFLOAD:-false}
IFACE="" # The nic to support container network, if empty will use the nic that the default route use
IFACE="" # The nic to support container network can be a nic name or a group of regex separated by comma, if empty will use the nic that the default route use

REGISTRY="kubeovn"
VERSION="v1.6.0"
Expand Down Expand Up @@ -359,6 +359,8 @@ spec:
type: string
underlayGateway:
type: boolean
disableInterConnection:
type: boolean
scope: Cluster
names:
plural: subnets
Expand Down
11 changes: 11 additions & 0 deletions docs/cluster-interconnection.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ IPv4 Routes

If Pods cannot communicate with each other, please check the log of kube-ovn-controller.

For some specific subnet that you don't want to advertise to another cluster, you can disable the auto route advertise on the specific subnet by editing the subnet spec.
```
apiVersion: kubeovn.io/v1
kind: Subnet
metadata:
name: no-advertise
spec:
cidrBlock: 10.199.0.0/16
disableInterConnection: false
```

For manually adding routes, you need to find the

## Manually Route Step
Expand Down
6 changes: 4 additions & 2 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ If you want to try the latest developing Kube-OVN, try the script below
SVC_CIDR="10.96.0.0/12" # Do NOT overlap with NODE/POD/JOIN CIDR
JOIN_CIDR="100.64.0.0/16" # Do NOT overlap with NODE/POD/SVC CIDR
LABEL="node-role.kubernetes.io/master" # The node label to deploy OVN DB
IFACE="" # The nic to support container network, if empty will use the nic that the default route use
IFACE="" # The nic to support container network can be a nic name or a group of regex separated by comma, if empty will use the nic that the default route use
VERSION="v1.5.0"
```

After v1.6.0 `IFACE` support regex, e.g. `IFACE=enp6s0f0,eth.*`

3. Execute the script

`bash install.sh`
Expand Down Expand Up @@ -131,7 +133,7 @@ You can use `--default-cidr` flags below to config default Pod CIDR or create a
--default-provider-name string The vlan or xvlan type default provider interface name, default: provider (default "provider")
--enable-mirror Enable traffic mirror, default: false
--encap-checksum Enable checksum, default: true (default true)
--iface string The iface used to inter-host pod communication, default: the default route iface
--iface string The iface used to inter-host pod communication, can be a nic name or a group of regex separated by comma, default: the default route iface
--kubeconfig string Path to kubeconfig file with authorization and master location information. If not set use the inCluster token.
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory
Expand Down
19 changes: 19 additions & 0 deletions docs/subnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,22 @@ For a centralized gateway, outgoing traffic from Pods within the OVN network to
- `gatewayType`: `distributed` or `centralized`, default is `distributed`.
- `gatewayNode`: when `gatewayType` is `centralized` used this field to specify which node act as the namespace gateway. This field can be a comma separated string, like `node1,node2` and kube-ovn will automatically apply an active-backup failover strategy.
- `natOutgoing`: `true` or `false`, whether pod ip need to be masqueraded when go through gateway. When `false`, pod ip will be exposed to external network directly, default `false`.

## Advance Options

- `vlan`: if enable vlan network, use this field to specific which vlan the subnet should bind to.
- `underlayGateway`: if enable vlan network, use this field to use underlay network gateway directly, instead of ovs virtual gateway
- `disableInterConnection`: if enable cluster-interconnection, use this field to disable auto route.

## Bind Pod to Subnet

By default, Pod will automatically inherit subnet from Namespace, From 1.5.1 users can bind Pod to another Subnet by manually setup the `logical_switch` annotation for a Pod.
```
apiVersion: v1
kind: Pod
metadata:
annotations:
ovn.kubernetes.io/logical_switch: another-subnet
namespace: default
name: another-subnet-pod
```
2 changes: 1 addition & 1 deletion pkg/controller/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (c *Controller) initNodeSwitch() error {
nodeSubnet := kubeovnv1.Subnet{
ObjectMeta: v1.ObjectMeta{Name: c.config.NodeSwitch},
Spec: kubeovnv1.SubnetSpec{
Vpc: util.DefaultVpc,
Vpc: util.DefaultVpc,
Default: false,
Provider: util.OvnProvider,
CIDRBlock: c.config.NodeSwitchCIDR,
Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type Configuration struct {
// TODO: validate configuration
func ParseFlags() (*Configuration, error) {
var (
argIface = pflag.String("iface", "", "The iface used to inter-host pod communication, default: the default route iface")
argIface = pflag.String("iface", "", "The iface used to inter-host pod communication can be a nic name or a group of regex separated by comma, default: the default route iface")
argMTU = pflag.Int("mtu", 0, "The MTU used by pod iface, default: iface MTU - 55")
argEnableMirror = pflag.Bool("enable-mirror", false, "Enable traffic mirror, default: false")
argMirrorNic = pflag.String("mirror-iface", "mirror0", "The mirror nic name that will be created by kube-ovn, default: mirror0")
Expand Down
2 changes: 2 additions & 0 deletions yamls/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ spec:
type: string
underlayGateway:
type: boolean
disableInterConnection:
type: boolean
scope: Cluster
names:
plural: subnets
Expand Down

0 comments on commit cbe0ad5

Please sign in to comment.