Skip to content

Commit

Permalink
fix: use default-gw as default-exclude-ips and expose args to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed May 21, 2019
1 parent 9361bb4 commit 3541b6c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
3 changes: 2 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ For high-available ovn db, see [high available](high-available.md)

```bash
--default-cidr: Default CIDR for Namespaces with no logical switch annotation, default: 10.16.0.0/16
--node-switch-cidr: The CIDR for the Node switch. Default: 100.64.0.0/16
--default-gateway: The gateway address for default cidr, default: 10.16.0.1
--node-switch-cidr: The CIDR for the Node switch, default: 100.64.0.0/16
```

## To uninstall
Expand Down
18 changes: 11 additions & 7 deletions pkg/controller/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ func ParseFlags() (*Configuration, error) {

argDefaultLogicalSwitch = pflag.String("default-ls", "ovn-default", "The default logical switch name, default: ovn-default")
argDefaultCIDR = pflag.String("default-cidr", "10.16.0.0/16", "Default cidr for namespace with no logical switch annotation, default: 10.16.0.0/16")
argDefaultGateway = pflag.String("default-gateway", "10.16.0.1", "Default gateway for default subnet. Default: 10.16.0.1")
argDefaultExcludeIps = pflag.String("default-exclude-ips", "10.16.0.0..10.16.0.10", "Exclude ips in default switch")
argDefaultGateway = pflag.String("default-gateway", "10.16.0.1", "Default gateway for default subnet, default: 10.16.0.1")
argDefaultExcludeIps = pflag.String("default-exclude-ips", "", "Exclude ips in default switch, default equals to gateway address")

argClusterRouter = pflag.String("cluster-router", "ovn-cluster", "The router name for cluster router.Default: cluster-router")
argNodeSwitch = pflag.String("node-switch", "join", "The name of node gateway switch which help node to access pod network. Default: join")
argNodeSwitchCIDR = pflag.String("node-switch-cidr", "100.64.0.0/16", "The cidr for node switch. Default: 100.64.0.0/16")
argNodeSwitchGateway = pflag.String("node-switch-gateway", "100.64.0.1", "The gateway for node switch. Default: 100.64.0.1")
argClusterRouter = pflag.String("cluster-router", "ovn-cluster", "The router name for cluster router, default: cluster-router")
argNodeSwitch = pflag.String("node-switch", "join", "The name of node gateway switch which help node to access pod network, default: join")
argNodeSwitchCIDR = pflag.String("node-switch-cidr", "100.64.0.0/16", "The cidr for node switch, default: 100.64.0.0/16")
argNodeSwitchGateway = pflag.String("node-switch-gateway", "100.64.0.1", "The gateway for node switch, default: 100.64.0.1")

argClusterTcpLoadBalancer = pflag.String("cluster-tcp-loadbalancer", "cluster-tcp-loadbalancer", "The name for cluster tcp loadbalancer")
argClusterUdpLoadBalancer = pflag.String("cluster-udp-loadbalancer", "cluster-udp-loadbalancer", "The name for cluster udp loadbalancer")

argWorkerNum = pflag.Int("worker-num", 3, "The parallelism of each worker. Default: 3")
argWorkerNum = pflag.Int("worker-num", 3, "The parallelism of each worker, default: 3")
)

flag.Set("alsologtostderr", "true")
Expand All @@ -82,6 +82,10 @@ func ParseFlags() (*Configuration, error) {
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.Parse()

if *argDefaultExcludeIps == "" {
argDefaultExcludeIps = argDefaultGateway
}

config := &Configuration{
OvnNbSocket: *argOvnNbSocket,
OvnNbHost: *argOvnNbHost,
Expand Down
1 change: 1 addition & 0 deletions yamls/kube-ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ spec:
- /kube-ovn/start-controller.sh
args:
- --default-cidr=10.16.0.0/16
- --default-gateway=10.16.0.1
- --node-switch-cidr=100.64.0.0/16
env:
- name: POD_NAME
Expand Down

0 comments on commit 3541b6c

Please sign in to comment.