mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Actually pass cluster-cidr on to server
This commit is contained in:
parent
10f48f4f3f
commit
e5b7d36c55
@ -57,6 +57,7 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
|
||||
Name: "cluster-cidr",
|
||||
Usage: "Network CIDR to use for pod IPs",
|
||||
Destination: &ServerConfig.ClusterCIDR,
|
||||
Value: "10.42.0.0/16",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "cluster-secret",
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
net2 "net"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@ -11,6 +12,7 @@ import (
|
||||
systemd "github.com/coreos/go-systemd/daemon"
|
||||
"github.com/docker/docker/pkg/reexec"
|
||||
"github.com/natefinch/lumberjack"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/rancher/k3s/pkg/agent"
|
||||
"github.com/rancher/k3s/pkg/cli/cmds"
|
||||
"github.com/rancher/k3s/pkg/server"
|
||||
@ -56,6 +58,10 @@ func Run(app *cli.Context) error {
|
||||
}
|
||||
|
||||
func run(app *cli.Context, cfg *cmds.Server) error {
|
||||
var (
|
||||
err error
|
||||
)
|
||||
|
||||
if cfg.Log != "" && os.Getenv("_RIO_REEXEC_") == "" {
|
||||
return runWithLogging(app, cfg)
|
||||
}
|
||||
@ -75,6 +81,11 @@ func run(app *cli.Context, cfg *cmds.Server) error {
|
||||
serverConfig.TLSConfig.HTTPPort = cfg.HTTPPort
|
||||
serverConfig.TLSConfig.KnownIPs = knownIPs()
|
||||
|
||||
_, serverConfig.ControlConfig.ClusterIPRange, err = net2.ParseCIDR(cfg.ClusterCIDR)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "Invalid CIDR %s: %v", cfg.ClusterCIDR, err)
|
||||
}
|
||||
|
||||
// TODO: support etcd
|
||||
serverConfig.ControlConfig.NoLeaderElect = true
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user