Merge pull request #2044 from briandowns/add_cis_server_flag

update cis flag implementation to propogate the rest of the way
This commit is contained in:
Brian Downs 2020-07-20 16:56:07 -07:00 committed by GitHub
commit 04f57e5e1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 1 deletions

View File

@ -485,6 +485,7 @@ func get(envInfo *cmds.Agent, proxy proxy.Proxy) (*config.Node, error) {
nodeConfig.AgentConfig.Rootless = envInfo.Rootless
nodeConfig.AgentConfig.PodManifests = filepath.Join(envInfo.DataDir, DefaultPodManifestPath)
nodeConfig.DisableSELinux = envInfo.DisableSELinux
nodeConfig.AgentConfig.ProtectKernelDefaults = envInfo.ProtectKernelDefaults
return nodeConfig, nil
}

View File

@ -56,7 +56,6 @@ func Run(ctx *cli.Context) error {
cfg := cmds.AgentConfig
cfg.Debug = ctx.Bool("debug")
cfg.DataDir = dataDir
cfg.ProtectKernelDefaults = true
contextCtx := signals.SetupSignalHandler(context.Background())

View File

@ -247,6 +247,7 @@ func NewServerCommand(action func(*cli.Context) error) *cli.Command {
&FlannelConfFlag,
&ExtraKubeletArgs,
&ExtraKubeProxyArgs,
&ProtectKernelDefaultsFlag,
&cli.BoolFlag{
Name: "rootless",
Usage: "(experimental) Run rootless",

View File

@ -155,6 +155,10 @@ func startKubelet(cfg *config.Agent) error {
argsMap["enforce-node-allocatable"] = ""
}
if cfg.ProtectKernelDefaults {
argsMap["protect-kernel-defaults"] = "true"
}
args := config.GetArgsList(argsMap, cfg.ExtraKubeletArgs)
logrus.Infof("Running kubelet %s", config.ArgString(args))

View File

@ -83,6 +83,7 @@ type Agent struct {
DisableNPC bool
DisableKubeProxy bool
Rootless bool
ProtectKernelDefaults bool
}
type Control struct {