mirror of https://github.com/k3s-io/k3s
Add --service-cidr server arg support
parent
10be950df5
commit
b8c3ff1dab
|
@ -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)",
|
||||
|
|
|
@ -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…
Reference in New Issue