Add --service-cidr server arg support

pull/171/head
Vladimir Zorin 6 years ago
parent 10be950df5
commit b8c3ff1dab

@ -65,6 +65,12 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
Destination: &ServerConfig.ClusterSecret, Destination: &ServerConfig.ClusterSecret,
EnvVar: "K3S_CLUSTER_SECRET", 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{ cli.StringSliceFlag{
Name: "no-deploy", Name: "no-deploy",
Usage: "Do not deploy packaged components (valid items: coredns, servicelb, traefik)", 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 { if err != nil {
return errors.Wrapf(err, "Invalid CIDR %s: %v", cfg.ClusterCIDR, err) 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 // TODO: support etcd
serverConfig.ControlConfig.NoLeaderElect = true serverConfig.ControlConfig.NoLeaderElect = true

Loading…
Cancel
Save