Browse Source

Add --service-cidr server arg support

pull/171/head
Vladimir Zorin 6 years ago
parent
commit
b8c3ff1dab
  1. 6
      pkg/cli/cmds/server.go
  2. 4
      pkg/cli/server/server.go

6
pkg/cli/cmds/server.go

@ -65,6 +65,12 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
Destination: &ServerConfig.ClusterSecret,
EnvVar: "K3S_CLUSTER_SECRET",
},
cli.StringFlag{
Name: "service-cidr",
Usage: "Network CIDR to use for services IPs",
Destination: &ServerConfig.ServiceCIDR,
Value: "10.43.0.0/16",
},
cli.StringSliceFlag{
Name: "no-deploy",
Usage: "Do not deploy packaged components (valid items: coredns, servicelb, traefik)",

4
pkg/cli/server/server.go

@ -82,6 +82,10 @@ func run(app *cli.Context, cfg *cmds.Server) error {
if err != nil {
return errors.Wrapf(err, "Invalid CIDR %s: %v", cfg.ClusterCIDR, err)
}
_, serverConfig.ControlConfig.ServiceIPRange, err = net2.ParseCIDR(cfg.ServiceCIDR)
if err != nil {
return errors.Wrapf(err, "Invalid CIDR %s: %v", cfg.ServiceCIDR, err)
}
// TODO: support etcd
serverConfig.ControlConfig.NoLeaderElect = true

Loading…
Cancel
Save