Skip to content

Commit 30cefca

Browse files
authored
Merge pull request kubernetes#89128 from vincent178/move-runonce-kubeletconfiguration
move runonce from flag to config
2 parents 0acf2f0 + 745b742 commit 30cefca

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

cmd/kubelet/app/options/options.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@ type KubeletFlags struct {
6161
// Crash immediately, rather than eating panics.
6262
ReallyCrashForTesting bool
6363

64-
// TODO(mtaufen): It is increasingly looking like nobody actually uses the
65-
// Kubelet's runonce mode anymore, so it may be a candidate
66-
// for deprecation and removal.
67-
// If runOnce is true, the Kubelet will check the API server once for pods,
68-
// run those in addition to the pods specified by static pod files, and exit.
69-
RunOnce bool
70-
7164
// enableServer enables the Kubelet's server
7265
EnableServer bool
7366

@@ -356,7 +349,6 @@ func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet) {
356349
fs.BoolVar(&f.ReallyCrashForTesting, "really-crash-for-testing", f.ReallyCrashForTesting, "If true, when panics occur crash. Intended for testing.")
357350
fs.Float64Var(&f.ChaosChance, "chaos-chance", f.ChaosChance, "If > 0.0, introduce random client errors and latency. Intended for testing.")
358351

359-
fs.BoolVar(&f.RunOnce, "runonce", f.RunOnce, "If true, exit after spawning pods from static pod files or remote urls. Exclusive with --enable-server")
360352
fs.BoolVar(&f.EnableServer, "enable-server", f.EnableServer, "Enable the Kubelet's server")
361353

362354
fs.StringVar(&f.HostnameOverride, "hostname-override", f.HostnameOverride, "If non-empty, will use this string as identification instead of the actual hostname. If --cloud-provider is set, the cloud provider determines the name of the node (consult cloud provider documentation to determine if and how the hostname is used).")
@@ -524,6 +516,9 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig
524516
fs.Int64Var(&c.PodPidsLimit, "pod-max-pids", c.PodPidsLimit, "Set the maximum number of processes per pod. If -1, the kubelet defaults to the node allocatable pid capacity.")
525517

526518
fs.StringVar(&c.ResolverConfig, "resolv-conf", c.ResolverConfig, "Resolver configuration file used as the basis for the container DNS resolution configuration.")
519+
520+
fs.BoolVar(&c.RunOnce, "runonce", c.RunOnce, "If true, exit after spawning pods from static pod files or remote urls. Exclusive with --enable-server")
521+
527522
fs.BoolVar(&c.CPUCFSQuota, "cpu-cfs-quota", c.CPUCFSQuota, "Enable CPU CFS quota enforcement for containers that specify CPU limits")
528523
fs.DurationVar(&c.CPUCFSQuotaPeriod.Duration, "cpu-cfs-quota-period", c.CPUCFSQuotaPeriod.Duration, "Sets CPU CFS quota period value, cpu.cfs_period_us, defaults to Linux Kernel default")
529524
fs.BoolVar(&c.EnableControllerAttachDetach, "enable-controller-attach-detach", c.EnableControllerAttachDetach, "Enables the Attach/Detach controller to manage attachment/detachment of volumes scheduled to this node, and disables kubelet from executing any attach/detach operations")

pkg/kubelet/apis/config/helpers_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ var (
214214
"RegistryPullQPS",
215215
"ReservedSystemCPUs",
216216
"RuntimeRequestTimeout.Duration",
217+
"RunOnce",
217218
"SerializeImagePulls",
218219
"ShowHiddenMetricsForVersion",
219220
"StreamingConnectionIdleTimeout.Duration",

pkg/kubelet/apis/config/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ type KubeletConfiguration struct {
241241
// ResolverConfig is the resolver configuration file used as the basis
242242
// for the container DNS resolution configuration.
243243
ResolverConfig string
244+
// RunOnce causes the Kubelet to check the API server once for pods,
245+
// run those in addition to the pods specified by static pod files, and exit.
246+
RunOnce bool
244247
// cpuCFSQuota enables CPU CFS quota enforcement for containers that
245248
// specify CPU limits
246249
CPUCFSQuota bool

pkg/kubelet/apis/config/v1beta1/zz_generated.conversion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

staging/src/k8s.io/kubelet/config/v1beta1/types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,11 @@ type KubeletConfiguration struct {
490490
// Default: "/etc/resolv.conf"
491491
// +optional
492492
ResolverConfig string `json:"resolvConf,omitempty"`
493+
// RunOnce causes the Kubelet to check the API server once for pods,
494+
// run those in addition to the pods specified by static pod files, and exit.
495+
// Default: false
496+
// +optional
497+
RunOnce bool `json:"runOnce,omitempty"`
493498
// cpuCFSQuota enables CPU CFS quota enforcement for containers that
494499
// specify CPU limits.
495500
// Dynamic Kubelet Config (beta): If dynamically updating this field, consider that

0 commit comments

Comments
 (0)