Browse Source

Add agent command to server command

pull/111/head^2
Darren Shepherd 6 years ago
parent
commit
3d113ceb2d
  1. 26
      pkg/cli/cmds/agent.go
  2. 2
      pkg/cli/cmds/server.go

26
pkg/cli/cmds/agent.go

@ -29,15 +29,25 @@ var (
AgentConfig Agent
NodeIPFlag = cli.StringFlag{
Name: "node-ip,i",
Usage: "IP address to advertise for node",
Usage: "(agent) IP address to advertise for node",
Destination: &AgentConfig.NodeIP,
}
NodeNameFlag = cli.StringFlag{
Name: "node-name",
Usage: "Node name",
Usage: "(agent) Node name",
EnvVar: "K3S_NODE_NAME",
Destination: &AgentConfig.NodeName,
}
DockerFlag = cli.BoolFlag{
Name: "docker",
Usage: "(agent) Use docker instead of containerd",
Destination: &AgentConfig.Docker,
}
FlannelFlag = cli.BoolFlag{
Name: "no-flannel",
Usage: "(agent) Disable embedded flannel",
Destination: &AgentConfig.NoFlannel,
}
)
func NewAgentCommand(action func(ctx *cli.Context) error) cli.Command {
@ -65,22 +75,14 @@ func NewAgentCommand(action func(ctx *cli.Context) error) cli.Command {
Destination: &AgentConfig.DataDir,
Value: "/var/lib/rancher/k3s",
},
cli.BoolFlag{
Name: "docker",
Usage: "Use docker instead of containerd",
Destination: &AgentConfig.Docker,
},
cli.BoolFlag{
Name: "no-flannel",
Usage: "Disable embedded flannel",
Destination: &AgentConfig.NoFlannel,
},
cli.StringFlag{
Name: "cluster-secret",
Usage: "Shared secret used to bootstrap a cluster",
Destination: &AgentConfig.ClusterSecret,
EnvVar: "K3S_CLUSTER_SECRET",
},
DockerFlag,
FlannelFlag,
NodeNameFlag,
NodeIPFlag,
},

2
pkg/cli/cmds/server.go

@ -83,6 +83,8 @@ func NewServerCommand(action func(*cli.Context) error) cli.Command {
},
NodeIPFlag,
NodeNameFlag,
DockerFlag,
FlannelFlag,
},
}
}

Loading…
Cancel
Save