mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor updates
This commit is contained in:
63
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/BUILD
generated
vendored
63
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/BUILD
generated
vendored
@ -10,25 +10,79 @@ go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"container_runtime.go",
|
||||
"globalflags.go",
|
||||
"options.go",
|
||||
],
|
||||
] + select({
|
||||
"@io_bazel_rules_go//go/platform:android": [
|
||||
"globalflags_other.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:darwin": [
|
||||
"globalflags_other.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:dragonfly": [
|
||||
"globalflags_other.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:freebsd": [
|
||||
"globalflags_other.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:linux": [
|
||||
"globalflags_linux.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:nacl": [
|
||||
"globalflags_other.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:netbsd": [
|
||||
"globalflags_other.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:openbsd": [
|
||||
"globalflags_other.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:plan9": [
|
||||
"globalflags_other.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:solaris": [
|
||||
"globalflags_other.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:windows": [
|
||||
"globalflags_other.go",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
importpath = "k8s.io/kubernetes/cmd/kubelet/app/options",
|
||||
deps = [
|
||||
"//pkg/apis/componentconfig:go_default_library",
|
||||
"//pkg/apis/core:go_default_library",
|
||||
"//pkg/credentialprovider/azure:go_default_library",
|
||||
"//pkg/credentialprovider/gcp:go_default_library",
|
||||
"//pkg/features:go_default_library",
|
||||
"//pkg/kubelet/apis/kubeletconfig:go_default_library",
|
||||
"//pkg/kubelet/apis/kubeletconfig/scheme:go_default_library",
|
||||
"//pkg/kubelet/apis/kubeletconfig/v1alpha1:go_default_library",
|
||||
"//pkg/kubelet/apis/kubeletconfig/v1beta1:go_default_library",
|
||||
"//pkg/kubelet/apis/kubeletconfig/validation:go_default_library",
|
||||
"//pkg/kubelet/config:go_default_library",
|
||||
"//pkg/kubelet/types:go_default_library",
|
||||
"//pkg/master/ports:go_default_library",
|
||||
"//pkg/util/taints:go_default_library",
|
||||
"//pkg/version/verflag:go_default_library",
|
||||
"//vendor/github.com/golang/glog:go_default_library",
|
||||
"//vendor/github.com/spf13/pflag:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/validation:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/util/feature:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/util/flag:go_default_library",
|
||||
],
|
||||
"//vendor/k8s.io/apiserver/pkg/util/logs:go_default_library",
|
||||
] + select({
|
||||
"@io_bazel_rules_go//go/platform:linux": [
|
||||
"//vendor/github.com/google/cadvisor/container/common:go_default_library",
|
||||
"//vendor/github.com/google/cadvisor/container/containerd:go_default_library",
|
||||
"//vendor/github.com/google/cadvisor/container/docker:go_default_library",
|
||||
"//vendor/github.com/google/cadvisor/container/raw:go_default_library",
|
||||
"//vendor/github.com/google/cadvisor/machine:go_default_library",
|
||||
"//vendor/github.com/google/cadvisor/manager:go_default_library",
|
||||
"//vendor/github.com/google/cadvisor/storage:go_default_library",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
|
||||
filegroup(
|
||||
@ -47,8 +101,7 @@ filegroup(
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["options_test.go"],
|
||||
importpath = "k8s.io/kubernetes/cmd/kubelet/app/options",
|
||||
library = ":go_default_library",
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
"//vendor/github.com/spf13/pflag:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/util/diff:go_default_library",
|
||||
|
4
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/container_runtime.go
generated
vendored
4
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/container_runtime.go
generated
vendored
@ -27,8 +27,8 @@ import (
|
||||
|
||||
const (
|
||||
// When these values are updated, also update test/e2e/framework/util.go
|
||||
defaultPodSandboxImageName = "gcr.io/google_containers/pause"
|
||||
defaultPodSandboxImageVersion = "3.0"
|
||||
defaultPodSandboxImageName = "k8s.gcr.io/pause"
|
||||
defaultPodSandboxImageVersion = "3.1"
|
||||
// From pkg/kubelet/rkt/rkt.go to avoid circular import
|
||||
defaultRktAPIServiceEndpoint = "localhost:15441"
|
||||
)
|
||||
|
118
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/globalflags.go
generated
vendored
Normal file
118
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/globalflags.go
generated
vendored
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package options
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
// libs that provide registration functions
|
||||
"k8s.io/apiserver/pkg/util/logs"
|
||||
"k8s.io/kubernetes/pkg/version/verflag"
|
||||
|
||||
// ensure libs have a chance to globally register their flags
|
||||
_ "github.com/golang/glog"
|
||||
_ "k8s.io/kubernetes/pkg/credentialprovider/azure"
|
||||
_ "k8s.io/kubernetes/pkg/credentialprovider/gcp"
|
||||
)
|
||||
|
||||
// AddGlobalFlags explicitly registers flags that libraries (glog, verflag, etc.) register
|
||||
// against the global flagsets from "flag" and "github.com/spf13/pflag".
|
||||
// We do this in order to prevent unwanted flags from leaking into the Kubelet's flagset.
|
||||
func AddGlobalFlags(fs *pflag.FlagSet) {
|
||||
addGlogFlags(fs)
|
||||
addCadvisorFlags(fs)
|
||||
addCredentialProviderFlags(fs)
|
||||
verflag.AddFlags(fs)
|
||||
logs.AddFlags(fs)
|
||||
}
|
||||
|
||||
// normalize replaces underscores with hyphens
|
||||
// we should always use hyphens instead of underscores when registering kubelet flags
|
||||
func normalize(s string) string {
|
||||
return strings.Replace(s, "_", "-", -1)
|
||||
}
|
||||
|
||||
// register adds a flag to local that targets the Value associated with the Flag named globalName in global
|
||||
func register(global *flag.FlagSet, local *pflag.FlagSet, globalName string) {
|
||||
if f := global.Lookup(globalName); f != nil {
|
||||
pflagFlag := pflag.PFlagFromGoFlag(f)
|
||||
pflagFlag.Name = normalize(pflagFlag.Name)
|
||||
local.AddFlag(pflagFlag)
|
||||
} else {
|
||||
panic(fmt.Sprintf("failed to find flag in global flagset (flag): %s", globalName))
|
||||
}
|
||||
}
|
||||
|
||||
// pflagRegister adds a flag to local that targets the Value associated with the Flag named globalName in global
|
||||
func pflagRegister(global, local *pflag.FlagSet, globalName string) {
|
||||
if f := global.Lookup(globalName); f != nil {
|
||||
f.Name = normalize(f.Name)
|
||||
local.AddFlag(f)
|
||||
} else {
|
||||
panic(fmt.Sprintf("failed to find flag in global flagset (pflag): %s", globalName))
|
||||
}
|
||||
}
|
||||
|
||||
// registerDeprecated registers the flag with register, and then marks it deprecated
|
||||
func registerDeprecated(global *flag.FlagSet, local *pflag.FlagSet, globalName, deprecated string) {
|
||||
register(global, local, globalName)
|
||||
local.Lookup(normalize(globalName)).Deprecated = deprecated
|
||||
}
|
||||
|
||||
// pflagRegisterDeprecated registers the flag with pflagRegister, and then marks it deprecated
|
||||
func pflagRegisterDeprecated(global, local *pflag.FlagSet, globalName, deprecated string) {
|
||||
pflagRegister(global, local, globalName)
|
||||
local.Lookup(normalize(globalName)).Deprecated = deprecated
|
||||
}
|
||||
|
||||
// addCredentialProviderFlags adds flags from k8s.io/kubernetes/pkg/credentialprovider
|
||||
func addCredentialProviderFlags(fs *pflag.FlagSet) {
|
||||
// lookup flags in global flag set and re-register the values with our flagset
|
||||
global := pflag.CommandLine
|
||||
local := pflag.NewFlagSet(os.Args[0], pflag.ExitOnError)
|
||||
|
||||
// Note this is deprecated in the library that provides it, so we just allow that deprecation
|
||||
// notice to pass through our registration here.
|
||||
pflagRegister(global, local, "google-json-key")
|
||||
// TODO(#58034): This is not a static file, so it's not quite as straightforward as --google-json-key.
|
||||
// We need to figure out how ACR users can dynamically provide pull credentials before we can deprecate this.
|
||||
pflagRegister(global, local, "azure-container-registry-config")
|
||||
|
||||
fs.AddFlagSet(local)
|
||||
}
|
||||
|
||||
// addGlogFlags adds flags from github.com/golang/glog
|
||||
func addGlogFlags(fs *pflag.FlagSet) {
|
||||
// lookup flags in global flag set and re-register the values with our flagset
|
||||
global := flag.CommandLine
|
||||
local := pflag.NewFlagSet(os.Args[0], pflag.ExitOnError)
|
||||
|
||||
register(global, local, "logtostderr")
|
||||
register(global, local, "alsologtostderr")
|
||||
register(global, local, "v")
|
||||
register(global, local, "stderrthreshold")
|
||||
register(global, local, "vmodule")
|
||||
register(global, local, "log_backtrace_at")
|
||||
register(global, local, "log_dir")
|
||||
|
||||
fs.AddFlagSet(local)
|
||||
}
|
79
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/globalflags_linux.go
generated
vendored
Normal file
79
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/globalflags_linux.go
generated
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
// +build linux
|
||||
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package options
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
// ensure libs have a chance to globally register their flags
|
||||
_ "github.com/google/cadvisor/container/common"
|
||||
_ "github.com/google/cadvisor/container/containerd"
|
||||
_ "github.com/google/cadvisor/container/docker"
|
||||
_ "github.com/google/cadvisor/container/raw"
|
||||
_ "github.com/google/cadvisor/machine"
|
||||
_ "github.com/google/cadvisor/manager"
|
||||
_ "github.com/google/cadvisor/storage"
|
||||
)
|
||||
|
||||
// addCadvisorFlags adds flags from cadvisor
|
||||
func addCadvisorFlags(fs *pflag.FlagSet) {
|
||||
// lookup flags in global flag set and re-register the values with our flagset
|
||||
global := flag.CommandLine
|
||||
local := pflag.NewFlagSet(os.Args[0], pflag.ExitOnError)
|
||||
|
||||
// These flags were also implicit from cadvisor, but are actually used by something in the core repo:
|
||||
// TODO(mtaufen): This one is stil used by our salt, but for heaven's sake it's even deprecated in cadvisor
|
||||
register(global, local, "docker_root")
|
||||
// e2e node tests rely on this
|
||||
register(global, local, "housekeeping_interval")
|
||||
|
||||
// These flags were implicit from cadvisor, and are mistakes that should be registered deprecated:
|
||||
const deprecated = "This is a cadvisor flag that was mistakenly registered with the Kubelet. Due to legacy concerns, it will follow the standard CLI deprecation timeline before being removed."
|
||||
|
||||
registerDeprecated(global, local, "application_metrics_count_limit", deprecated)
|
||||
registerDeprecated(global, local, "boot_id_file", deprecated)
|
||||
registerDeprecated(global, local, "container_hints", deprecated)
|
||||
registerDeprecated(global, local, "containerd", deprecated)
|
||||
registerDeprecated(global, local, "docker", deprecated)
|
||||
registerDeprecated(global, local, "docker_env_metadata_whitelist", deprecated)
|
||||
registerDeprecated(global, local, "docker_only", deprecated)
|
||||
registerDeprecated(global, local, "docker-tls", deprecated)
|
||||
registerDeprecated(global, local, "docker-tls-ca", deprecated)
|
||||
registerDeprecated(global, local, "docker-tls-cert", deprecated)
|
||||
registerDeprecated(global, local, "docker-tls-key", deprecated)
|
||||
registerDeprecated(global, local, "enable_load_reader", deprecated)
|
||||
registerDeprecated(global, local, "event_storage_age_limit", deprecated)
|
||||
registerDeprecated(global, local, "event_storage_event_limit", deprecated)
|
||||
registerDeprecated(global, local, "global_housekeeping_interval", deprecated)
|
||||
registerDeprecated(global, local, "log_cadvisor_usage", deprecated)
|
||||
registerDeprecated(global, local, "machine_id_file", deprecated)
|
||||
registerDeprecated(global, local, "storage_driver_user", deprecated)
|
||||
registerDeprecated(global, local, "storage_driver_password", deprecated)
|
||||
registerDeprecated(global, local, "storage_driver_host", deprecated)
|
||||
registerDeprecated(global, local, "storage_driver_db", deprecated)
|
||||
registerDeprecated(global, local, "storage_driver_table", deprecated)
|
||||
registerDeprecated(global, local, "storage_driver_secure", deprecated)
|
||||
registerDeprecated(global, local, "storage_driver_buffer_duration", deprecated)
|
||||
|
||||
// finally, add cadvisor flags to the provided flagset
|
||||
fs.AddFlagSet(local)
|
||||
}
|
26
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/globalflags_other.go
generated
vendored
Normal file
26
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/globalflags_other.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
// +build !linux
|
||||
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package options
|
||||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
)
|
||||
|
||||
func addCadvisorFlags(fs *pflag.FlagSet) {
|
||||
}
|
152
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go
generated
vendored
152
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go
generated
vendored
@ -27,6 +27,7 @@ import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
utilvalidation "k8s.io/apimachinery/pkg/util/validation"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
"k8s.io/apiserver/pkg/util/flag"
|
||||
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||
@ -34,12 +35,16 @@ import (
|
||||
"k8s.io/kubernetes/pkg/features"
|
||||
"k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig"
|
||||
kubeletscheme "k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/scheme"
|
||||
"k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1alpha1"
|
||||
"k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1beta1"
|
||||
kubeletconfigvalidation "k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/validation"
|
||||
"k8s.io/kubernetes/pkg/kubelet/config"
|
||||
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
|
||||
"k8s.io/kubernetes/pkg/master/ports"
|
||||
utiltaints "k8s.io/kubernetes/pkg/util/taints"
|
||||
)
|
||||
|
||||
const defaultRootDir = "/var/lib/kubelet"
|
||||
|
||||
// A configuration field should go in KubeletFlags instead of KubeletConfiguration if any of these are true:
|
||||
// - its value will never, or cannot safely be changed during the lifetime of a node
|
||||
// - its value cannot be safely shared between nodes at the same time (e.g. a hostname)
|
||||
@ -47,7 +52,7 @@ import (
|
||||
// In general, please try to avoid adding flags or configuration fields,
|
||||
// we already have a confusingly large amount of them.
|
||||
type KubeletFlags struct {
|
||||
KubeConfig flag.StringFlag
|
||||
KubeConfig string
|
||||
BootstrapKubeconfig string
|
||||
RotateCertificates bool
|
||||
|
||||
@ -60,9 +65,12 @@ type KubeletFlags struct {
|
||||
// Kubelet's runonce mode anymore, so it may be a candidate
|
||||
// for deprecation and removal.
|
||||
// If runOnce is true, the Kubelet will check the API server once for pods,
|
||||
// run those in addition to the pods specified by the local manifest, and exit.
|
||||
// run those in addition to the pods specified by static pod files, and exit.
|
||||
RunOnce bool
|
||||
|
||||
// enableServer enables the Kubelet's server
|
||||
EnableServer bool
|
||||
|
||||
// HostnameOverride is the hostname used to identify the kubelet instead
|
||||
// of the actual hostname.
|
||||
HostnameOverride string
|
||||
@ -101,11 +109,10 @@ type KubeletFlags struct {
|
||||
// To use this flag, the DynamicKubeletConfig feature gate must be enabled.
|
||||
DynamicConfigDir flag.StringFlag
|
||||
|
||||
// The Kubelet will look in this directory for an init configuration.
|
||||
// The Kubelet will load its initial configuration from this file.
|
||||
// The path may be absolute or relative; relative paths are under the Kubelet's current working directory.
|
||||
// Omit this flag to use the combination of built-in default configuration values and flags.
|
||||
// To use this flag, the KubeletConfigFile feature gate must be enabled.
|
||||
InitConfigDir flag.StringFlag
|
||||
KubeletConfigFile string
|
||||
|
||||
// registerNode enables automatic registration with the apiserver.
|
||||
RegisterNode bool
|
||||
@ -115,6 +122,9 @@ type KubeletFlags struct {
|
||||
// is true and upon the initial registration of the node.
|
||||
RegisterWithTaints []core.Taint
|
||||
|
||||
// cAdvisorPort is the port of the localhost cAdvisor endpoint (set to 0 to disable)
|
||||
CAdvisorPort int32
|
||||
|
||||
// EXPERIMENTAL FLAGS
|
||||
// Whitelist of unsafe sysctls or sysctl patterns (ending in *).
|
||||
// +optional
|
||||
@ -178,8 +188,6 @@ type KubeletFlags struct {
|
||||
// schedulable. Won't have any effect if register-node is false.
|
||||
// DEPRECATED: use registerWithTaints instead
|
||||
RegisterSchedulable bool
|
||||
// RequireKubeConfig is deprecated! A valid KubeConfig is now required if --kubeconfig is provided.
|
||||
RequireKubeConfig bool
|
||||
// nonMasqueradeCIDR configures masquerading: traffic to IPs outside this range will use IP masquerade.
|
||||
NonMasqueradeCIDR string
|
||||
// This flag, if set, instructs the kubelet to keep volumes from terminated pods mounted to the node.
|
||||
@ -187,6 +195,19 @@ type KubeletFlags struct {
|
||||
KeepTerminatedPodVolumes bool
|
||||
// enable gathering custom metrics.
|
||||
EnableCustomMetrics bool
|
||||
// allowPrivileged enables containers to request privileged mode.
|
||||
// Defaults to false.
|
||||
AllowPrivileged bool
|
||||
// hostNetworkSources is a comma-separated list of sources from which the
|
||||
// Kubelet allows pods to use of host network. Defaults to "*". Valid
|
||||
// options are "file", "http", "api", and "*" (all sources).
|
||||
HostNetworkSources []string
|
||||
// hostPIDSources is a comma-separated list of sources from which the
|
||||
// Kubelet allows pods to use the host pid namespace. Defaults to "*".
|
||||
HostPIDSources []string
|
||||
// hostIPCSources is a comma-separated list of sources from which the
|
||||
// Kubelet allows pods to use the host ipc namespace. Defaults to "*".
|
||||
HostIPCSources []string
|
||||
}
|
||||
|
||||
// NewKubeletFlags will create a new KubeletFlags with default values
|
||||
@ -199,12 +220,10 @@ func NewKubeletFlags() *KubeletFlags {
|
||||
}
|
||||
|
||||
return &KubeletFlags{
|
||||
// TODO(#41161:v1.10.0): Remove the default kubeconfig path and --require-kubeconfig.
|
||||
RequireKubeConfig: false,
|
||||
KubeConfig: flag.NewStringFlag("/var/lib/kubelet/kubeconfig"),
|
||||
EnableServer: true,
|
||||
ContainerRuntimeOptions: *NewContainerRuntimeOptions(),
|
||||
CertDirectory: "/var/lib/kubelet/pki",
|
||||
RootDirectory: v1alpha1.DefaultRootDir,
|
||||
RootDirectory: defaultRootDir,
|
||||
MasterServiceNamespace: metav1.NamespaceDefault,
|
||||
MaxContainerCount: -1,
|
||||
MaxPerPodContainerCount: 1,
|
||||
@ -220,7 +239,12 @@ func NewKubeletFlags() *KubeletFlags {
|
||||
NodeLabels: make(map[string]string),
|
||||
VolumePluginDir: "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/",
|
||||
RegisterNode: true,
|
||||
SeccompProfileRoot: filepath.Join(v1alpha1.DefaultRootDir, "seccomp"),
|
||||
SeccompProfileRoot: filepath.Join(defaultRootDir, "seccomp"),
|
||||
HostNetworkSources: []string{kubetypes.AllSource},
|
||||
HostPIDSources: []string{kubetypes.AllSource},
|
||||
HostIPCSources: []string{kubetypes.AllSource},
|
||||
// TODO(#56523): default CAdvisorPort to 0 (disabled) and deprecate it
|
||||
CAdvisorPort: 4194,
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,9 +253,8 @@ func ValidateKubeletFlags(f *KubeletFlags) error {
|
||||
if f.DynamicConfigDir.Provided() && !utilfeature.DefaultFeatureGate.Enabled(features.DynamicKubeletConfig) {
|
||||
return fmt.Errorf("the DynamicKubeletConfig feature gate must be enabled in order to use the --dynamic-config-dir flag")
|
||||
}
|
||||
// ensure that nobody sets InitConfigDir if the KubeletConfigFile feature gate is turned off
|
||||
if f.InitConfigDir.Provided() && !utilfeature.DefaultFeatureGate.Enabled(features.KubeletConfigFile) {
|
||||
return fmt.Errorf("the KubeletConfigFile feature gate must be enabled in order to use the --init-config-dir flag")
|
||||
if f.CAdvisorPort != 0 && utilvalidation.IsValidPortNum(int(f.CAdvisorPort)) != nil {
|
||||
return fmt.Errorf("invalid configuration: CAdvisorPort (--cadvisor-port) %v must be between 0 and 65535, inclusive", f.CAdvisorPort)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@ -242,15 +265,30 @@ func NewKubeletConfiguration() (*kubeletconfig.KubeletConfiguration, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
versioned := &v1alpha1.KubeletConfiguration{}
|
||||
versioned := &v1beta1.KubeletConfiguration{}
|
||||
scheme.Default(versioned)
|
||||
config := &kubeletconfig.KubeletConfiguration{}
|
||||
if err := scheme.Convert(versioned, config, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
applyLegacyDefaults(config)
|
||||
return config, nil
|
||||
}
|
||||
|
||||
// applyLegacyDefaults applies legacy default values to the KubeletConfiguration in order to
|
||||
// preserve the command line API. This is used to construct the baseline default KubeletConfiguration
|
||||
// before the first round of flag parsing.
|
||||
func applyLegacyDefaults(kc *kubeletconfig.KubeletConfiguration) {
|
||||
// --anonymous-auth
|
||||
kc.Authentication.Anonymous.Enabled = true
|
||||
// --authentication-token-webhook
|
||||
kc.Authentication.Webhook.Enabled = false
|
||||
// --authorization-mode
|
||||
kc.Authorization.Mode = kubeletconfig.KubeletAuthorizationModeAlwaysAllow
|
||||
// --read-only-port
|
||||
kc.ReadOnlyPort = ports.KubeletReadOnlyPort
|
||||
}
|
||||
|
||||
// KubeletServer encapsulates all of the parameters necessary for starting up
|
||||
// a kubelet. These can either be set via command line or directly.
|
||||
type KubeletServer struct {
|
||||
@ -292,10 +330,8 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
|
||||
func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
f.ContainerRuntimeOptions.AddFlags(fs)
|
||||
|
||||
fs.Var(&f.KubeConfig, "kubeconfig", "Path to a kubeconfig file, specifying how to connect to the API server.")
|
||||
// TODO(#41161:v1.10.0): Remove the default kubeconfig path and --require-kubeconfig.
|
||||
fs.BoolVar(&f.RequireKubeConfig, "require-kubeconfig", f.RequireKubeConfig, "This flag is no longer necessary. It has been deprecated and will be removed in a future version.")
|
||||
fs.MarkDeprecated("require-kubeconfig", "You no longer need to use --require-kubeconfig. This will be removed in a future version. Providing --kubeconfig enables API server mode, omitting --kubeconfig enables standalone mode unless --require-kubeconfig=true is also set. In the latter case, the legacy default kubeconfig path will be used until --require-kubeconfig is removed.")
|
||||
fs.StringVar(&f.KubeletConfigFile, "config", f.KubeletConfigFile, "The Kubelet will load its initial configuration from this file. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Omit this flag to use the built-in default configuration values. Command-line flags override configuration from this file.")
|
||||
fs.StringVar(&f.KubeConfig, "kubeconfig", f.KubeConfig, "Path to a kubeconfig file, specifying how to connect to the API server. Providing --kubeconfig enables API server mode, omitting --kubeconfig enables standalone mode.")
|
||||
|
||||
fs.MarkDeprecated("experimental-bootstrap-kubeconfig", "Use --bootstrap-kubeconfig")
|
||||
fs.StringVar(&f.BootstrapKubeconfig, "experimental-bootstrap-kubeconfig", f.BootstrapKubeconfig, "deprecated: use --bootstrap-kubeconfig")
|
||||
@ -308,7 +344,8 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.BoolVar(&f.ReallyCrashForTesting, "really-crash-for-testing", f.ReallyCrashForTesting, "If true, when panics occur crash. Intended for testing.")
|
||||
fs.Float64Var(&f.ChaosChance, "chaos-chance", f.ChaosChance, "If > 0.0, introduce random client errors and latency. Intended for testing.")
|
||||
|
||||
fs.BoolVar(&f.RunOnce, "runonce", f.RunOnce, "If true, exit after spawning pods from local manifests or remote urls. Exclusive with --enable-server")
|
||||
fs.BoolVar(&f.RunOnce, "runonce", f.RunOnce, "If true, exit after spawning pods from static pod files or remote urls. Exclusive with --enable-server")
|
||||
fs.BoolVar(&f.EnableServer, "enable-server", f.EnableServer, "Enable the Kubelet's server")
|
||||
|
||||
fs.StringVar(&f.HostnameOverride, "hostname-override", f.HostnameOverride, "If non-empty, will use this string as identification instead of the actual hostname.")
|
||||
|
||||
@ -325,30 +362,31 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.StringVar(&f.RootDirectory, "root-dir", f.RootDirectory, "Directory path for managing kubelet files (volume mounts,etc).")
|
||||
|
||||
fs.Var(&f.DynamicConfigDir, "dynamic-config-dir", "The Kubelet will use this directory for checkpointing downloaded configurations and tracking configuration health. The Kubelet will create this directory if it does not already exist. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Providing this flag enables dynamic Kubelet configuration. Presently, you must also enable the DynamicKubeletConfig feature gate to pass this flag.")
|
||||
fs.Var(&f.InitConfigDir, "init-config-dir", "The Kubelet will look in this directory for the init configuration. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Omit this argument to use the built-in default configuration values. Presently, you must also enable the KubeletConfigFile feature gate to pass this flag.")
|
||||
|
||||
fs.BoolVar(&f.RegisterNode, "register-node", f.RegisterNode, "Register the node with the apiserver. If --kubeconfig is not provided, this flag is irrelevant, as the Kubelet won't have an apiserver to register with. Default=true.")
|
||||
fs.Var(utiltaints.NewTaintsVar(&f.RegisterWithTaints), "register-with-taints", "Register the node with the given list of taints (comma separated \"<key>=<value>:<effect>\"). No-op if register-node is false.")
|
||||
fs.BoolVar(&f.Containerized, "containerized", f.Containerized, "Running kubelet in a container.")
|
||||
|
||||
// EXPERIMENTAL FLAGS
|
||||
fs.StringVar(&f.ExperimentalMounterPath, "experimental-mounter-path", f.ExperimentalMounterPath, "[Experimental] Path of mounter binary. Leave empty to use the default mount.")
|
||||
fs.StringSliceVar(&f.AllowedUnsafeSysctls, "experimental-allowed-unsafe-sysctls", f.AllowedUnsafeSysctls, "Comma-separated whitelist of unsafe sysctls or unsafe sysctl patterns (ending in *). Use these at your own risk.")
|
||||
fs.BoolVar(&f.Containerized, "containerized", f.Containerized, "Experimental support for running kubelet in a container. Intended for testing.")
|
||||
fs.BoolVar(&f.ExperimentalKernelMemcgNotification, "experimental-kernel-memcg-notification", f.ExperimentalKernelMemcgNotification, "If enabled, the kubelet will integrate with the kernel memcg notification to determine if memory eviction thresholds are crossed rather than polling.")
|
||||
fs.StringVar(&f.RemoteRuntimeEndpoint, "container-runtime-endpoint", f.RemoteRuntimeEndpoint, "[Experimental] The endpoint of remote runtime service. Currently unix socket is supported on Linux, and tcp is supported on windows. Examples:'unix:///var/run/dockershim.sock', 'tcp://localhost:3735'")
|
||||
fs.StringVar(&f.RemoteImageEndpoint, "image-service-endpoint", f.RemoteImageEndpoint, "[Experimental] The endpoint of remote image service. If not specified, it will be the same with container-runtime-endpoint by default. Currently unix socket is supported on Linux, and tcp is supported on windows. Examples:'unix:///var/run/dockershim.sock', 'tcp://localhost:3735'")
|
||||
fs.BoolVar(&f.ExperimentalCheckNodeCapabilitiesBeforeMount, "experimental-check-node-capabilities-before-mount", f.ExperimentalCheckNodeCapabilitiesBeforeMount, "[Experimental] if set true, the kubelet will check the underlying node for required componenets (binaries, etc.) before performing the mount")
|
||||
fs.BoolVar(&f.ExperimentalCheckNodeCapabilitiesBeforeMount, "experimental-check-node-capabilities-before-mount", f.ExperimentalCheckNodeCapabilitiesBeforeMount, "[Experimental] if set true, the kubelet will check the underlying node for required components (binaries, etc.) before performing the mount")
|
||||
fs.BoolVar(&f.ExperimentalNodeAllocatableIgnoreEvictionThreshold, "experimental-allocatable-ignore-eviction", f.ExperimentalNodeAllocatableIgnoreEvictionThreshold, "When set to 'true', Hard Eviction Thresholds will be ignored while calculating Node Allocatable. See https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/ for more details. [default=false]")
|
||||
fs.Var(flag.NewMapStringString(&f.ExperimentalQOSReserved), "experimental-qos-reserved", "A set of ResourceName=Percentage (e.g. memory=50%) pairs that describe how pod resource requests are reserved at the QoS level. Currently only memory is supported. [default=none]")
|
||||
bindableNodeLabels := flag.ConfigurationMap(f.NodeLabels)
|
||||
fs.Var(&bindableNodeLabels, "node-labels", "<Warning: Alpha feature> Labels to add when registering the node in the cluster. Labels must be key=value pairs separated by ','.")
|
||||
fs.StringVar(&f.VolumePluginDir, "volume-plugin-dir", f.VolumePluginDir, "<Warning: Alpha feature> The full path of the directory in which to search for additional third party volume plugins")
|
||||
fs.StringVar(&f.VolumePluginDir, "volume-plugin-dir", f.VolumePluginDir, "The full path of the directory in which to search for additional third party volume plugins")
|
||||
fs.StringVar(&f.LockFilePath, "lock-file", f.LockFilePath, "<Warning: Alpha feature> The path to file for kubelet to use as a lock file.")
|
||||
fs.BoolVar(&f.ExitOnLockContention, "exit-on-lock-contention", f.ExitOnLockContention, "Whether kubelet should exit upon lock-file contention.")
|
||||
fs.StringVar(&f.SeccompProfileRoot, "seccomp-profile-root", f.SeccompProfileRoot, "<Warning: Alpha feature> Directory path for seccomp profiles.")
|
||||
fs.StringVar(&f.BootstrapCheckpointPath, "bootstrap-checkpoint-path", f.BootstrapCheckpointPath, "<Warning: Alpha feature> Path to to the directory where the checkpoints are stored")
|
||||
|
||||
// DEPRECATED FLAGS
|
||||
fs.Int32Var(&f.CAdvisorPort, "cadvisor-port", f.CAdvisorPort, "The port of the localhost cAdvisor endpoint (set to 0 to disable)")
|
||||
fs.MarkDeprecated("cadvisor-port", "The default will change to 0 (disabled) in 1.12, and the cadvisor port will be removed entirely in 1.13")
|
||||
fs.DurationVar(&f.MinimumGCAge.Duration, "minimum-container-ttl-duration", f.MinimumGCAge.Duration, "Minimum age for a finished container before it is garbage collected. Examples: '300ms', '10s' or '2h45m'")
|
||||
fs.MarkDeprecated("minimum-container-ttl-duration", "Use --eviction-hard or --eviction-soft instead. Will be removed in a future version.")
|
||||
fs.Int32Var(&f.MaxPerPodContainerCount, "maximum-dead-containers-per-container", f.MaxPerPodContainerCount, "Maximum number of old instances to retain per container. Each container takes up some disk space.")
|
||||
@ -366,22 +404,48 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
// TODO(#54161:v1.11.0): Remove --enable-custom-metrics flag, it is deprecated.
|
||||
fs.BoolVar(&f.EnableCustomMetrics, "enable-custom-metrics", f.EnableCustomMetrics, "Support for gathering custom metrics.")
|
||||
fs.MarkDeprecated("enable-custom-metrics", "will be removed in a future version")
|
||||
// TODO(#58010:v1.12.0): Remove --allow-privileged, it is deprecated
|
||||
fs.BoolVar(&f.AllowPrivileged, "allow-privileged", f.AllowPrivileged, "If true, allow containers to request privileged mode.")
|
||||
fs.MarkDeprecated("allow-privileged", "will be removed in a future version")
|
||||
// TODO(#58010:v1.12.0): Remove --host-network-sources, it is deprecated
|
||||
fs.StringSliceVar(&f.HostNetworkSources, "host-network-sources", f.HostNetworkSources, "Comma-separated list of sources from which the Kubelet allows pods to use of host network.")
|
||||
fs.MarkDeprecated("host-network-sources", "will be removed in a future version")
|
||||
// TODO(#58010:v1.12.0): Remove --host-pid-sources, it is deprecated
|
||||
fs.StringSliceVar(&f.HostPIDSources, "host-pid-sources", f.HostPIDSources, "Comma-separated list of sources from which the Kubelet allows pods to use the host pid namespace.")
|
||||
fs.MarkDeprecated("host-pid-sources", "will be removed in a future version")
|
||||
// TODO(#58010:v1.12.0): Remove --host-ipc-sources, it is deprecated
|
||||
fs.StringSliceVar(&f.HostIPCSources, "host-ipc-sources", f.HostIPCSources, "Comma-separated list of sources from which the Kubelet allows pods to use the host ipc namespace.")
|
||||
fs.MarkDeprecated("host-ipc-sources", "will be removed in a future version")
|
||||
|
||||
}
|
||||
|
||||
// AddKubeletConfigFlags adds flags for a specific kubeletconfig.KubeletConfiguration to the specified FlagSet
|
||||
func AddKubeletConfigFlags(fs *pflag.FlagSet, c *kubeletconfig.KubeletConfiguration) {
|
||||
fs.BoolVar(&c.FailSwapOn, "fail-swap-on", true, "Makes the Kubelet fail to start if swap is enabled on the node. ")
|
||||
fs.BoolVar(&c.FailSwapOn, "experimental-fail-swap-on", true, "DEPRECATED: please use --fail-swap-on instead.")
|
||||
func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfiguration) {
|
||||
fs := pflag.NewFlagSet("", pflag.ExitOnError)
|
||||
defer func() {
|
||||
// All KubeletConfiguration flags are now deprecated, and any new flags that point to
|
||||
// KubeletConfiguration fields are deprecated-on-creation. When removing flags at the end
|
||||
// of their deprecation period, be careful to check that they have *actually* been deprecated
|
||||
// members of the KubeletConfiguration for the entire deprecation period:
|
||||
// e.g. if a flag was added after this deprecation function, it may not be at the end
|
||||
// of its lifetime yet, even if the rest are.
|
||||
deprecated := "This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information."
|
||||
fs.VisitAll(func(f *pflag.Flag) {
|
||||
f.Deprecated = deprecated
|
||||
})
|
||||
mainfs.AddFlagSet(fs)
|
||||
}()
|
||||
|
||||
fs.BoolVar(&c.FailSwapOn, "fail-swap-on", c.FailSwapOn, "Makes the Kubelet fail to start if swap is enabled on the node. ")
|
||||
fs.BoolVar(&c.FailSwapOn, "experimental-fail-swap-on", c.FailSwapOn, "DEPRECATED: please use --fail-swap-on instead.")
|
||||
fs.MarkDeprecated("experimental-fail-swap-on", "This flag is deprecated and will be removed in future releases. please use --fail-swap-on instead.")
|
||||
|
||||
fs.StringVar(&c.PodManifestPath, "pod-manifest-path", c.PodManifestPath, "Path to the directory containing pod manifest files to run, or the path to a single pod manifest file. Files starting with dots will be ignored.")
|
||||
fs.StringVar(&c.StaticPodPath, "pod-manifest-path", c.StaticPodPath, "Path to the directory containing static pod files to run, or the path to a single static pod file. Files starting with dots will be ignored.")
|
||||
fs.DurationVar(&c.SyncFrequency.Duration, "sync-frequency", c.SyncFrequency.Duration, "Max period between synchronizing running containers and config")
|
||||
fs.DurationVar(&c.FileCheckFrequency.Duration, "file-check-frequency", c.FileCheckFrequency.Duration, "Duration between checking config files for new data")
|
||||
fs.DurationVar(&c.HTTPCheckFrequency.Duration, "http-check-frequency", c.HTTPCheckFrequency.Duration, "Duration between checking http for new data")
|
||||
fs.StringVar(&c.ManifestURL, "manifest-url", c.ManifestURL, "URL for accessing the container manifest")
|
||||
fs.Var(flag.NewColonSeparatedMultimapStringString(&c.ManifestURLHeader), "manifest-url-header", "Comma-separated list of HTTP headers to use when accessing the manifest URL. Multiple headers with the same name will be added in the same order provided. This flag can be repeatedly invoked. For example: `--manifest-url-header 'a:hello,b:again,c:world' --manifest-url-header 'b:beautiful'`")
|
||||
fs.BoolVar(&c.EnableServer, "enable-server", c.EnableServer, "Enable the Kubelet's server")
|
||||
fs.StringVar(&c.StaticPodURL, "manifest-url", c.StaticPodURL, "URL for accessing additional Pod specifications to run")
|
||||
fs.Var(flag.NewColonSeparatedMultimapStringString(&c.StaticPodURLHeader), "manifest-url-header", "Comma-separated list of HTTP headers to use when accessing the url provided to --manifest-url. Multiple headers with the same name will be added in the same order provided. This flag can be repeatedly invoked. For example: `--manifest-url-header 'a:hello,b:again,c:world' --manifest-url-header 'b:beautiful'`")
|
||||
fs.Var(componentconfig.IPVar{Val: &c.Address}, "address", "The IP address for the Kubelet to serve on (set to `0.0.0.0` for all IPv4 interfaces and `::` for all IPv6 interfaces)")
|
||||
fs.Int32Var(&c.Port, "port", c.Port, "The port for the Kubelet to serve on.")
|
||||
fs.Int32Var(&c.ReadOnlyPort, "read-only-port", c.ReadOnlyPort, "The read-only port for the Kubelet to serve on with no authentication/authorization (set to 0 to disable)")
|
||||
@ -413,19 +477,21 @@ func AddKubeletConfigFlags(fs *pflag.FlagSet, c *kubeletconfig.KubeletConfigurat
|
||||
"If --tls-cert-file and --tls-private-key-file are not provided, a self-signed certificate and key "+
|
||||
"are generated for the public address and saved to the directory passed to --cert-dir.")
|
||||
fs.StringVar(&c.TLSPrivateKeyFile, "tls-private-key-file", c.TLSPrivateKeyFile, "File containing x509 private key matching --tls-cert-file.")
|
||||
fs.StringSliceVar(&c.TLSCipherSuites, "tls-cipher-suites", c.TLSCipherSuites,
|
||||
"Comma-separated list of cipher suites for the server. "+
|
||||
"Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants). "+
|
||||
"If omitted, the default Go cipher suites will be used")
|
||||
fs.StringVar(&c.TLSMinVersion, "tls-min-version", c.TLSMinVersion,
|
||||
"Minimum TLS version supported. "+
|
||||
"Value must match version names from https://golang.org/pkg/crypto/tls/#pkg-constants.")
|
||||
|
||||
fs.BoolVar(&c.AllowPrivileged, "allow-privileged", c.AllowPrivileged, "If true, allow containers to request privileged mode.")
|
||||
fs.StringSliceVar(&c.HostNetworkSources, "host-network-sources", c.HostNetworkSources, "Comma-separated list of sources from which the Kubelet allows pods to use of host network.")
|
||||
fs.StringSliceVar(&c.HostPIDSources, "host-pid-sources", c.HostPIDSources, "Comma-separated list of sources from which the Kubelet allows pods to use the host pid namespace.")
|
||||
fs.StringSliceVar(&c.HostIPCSources, "host-ipc-sources", c.HostIPCSources, "Comma-separated list of sources from which the Kubelet allows pods to use the host ipc namespace.")
|
||||
fs.Int32Var(&c.RegistryPullQPS, "registry-qps", c.RegistryPullQPS, "If > 0, limit registry pull QPS to this value. If 0, unlimited.")
|
||||
fs.Int32Var(&c.RegistryBurst, "registry-burst", c.RegistryBurst, "Maximum size of a bursty pulls, temporarily allows pulls to burst to this number, while still not exceeding registry-qps. Only used if --registry-qps > 0")
|
||||
fs.Int32Var(&c.EventRecordQPS, "event-qps", c.EventRecordQPS, "If > 0, limit event creations per second to this value. If 0, unlimited.")
|
||||
fs.Int32Var(&c.EventBurst, "event-burst", c.EventBurst, "Maximum size of a bursty event records, temporarily allows event records to burst to this number, while still not exceeding event-qps. Only used if --event-qps > 0")
|
||||
|
||||
fs.BoolVar(&c.EnableDebuggingHandlers, "enable-debugging-handlers", c.EnableDebuggingHandlers, "Enables server endpoints for log collection and local running of containers and commands")
|
||||
fs.BoolVar(&c.EnableContentionProfiling, "contention-profiling", false, "Enable lock contention profiling, if profiling is enabled")
|
||||
fs.Int32Var(&c.CAdvisorPort, "cadvisor-port", c.CAdvisorPort, "The port of the localhost cAdvisor endpoint (set to 0 to disable)")
|
||||
fs.BoolVar(&c.EnableContentionProfiling, "contention-profiling", c.EnableContentionProfiling, "Enable lock contention profiling, if profiling is enabled")
|
||||
fs.Int32Var(&c.HealthzPort, "healthz-port", c.HealthzPort, "The port of the localhost healthz endpoint (set to 0 to disable)")
|
||||
fs.Var(componentconfig.IPVar{Val: &c.HealthzBindAddress}, "healthz-bind-address", "The IP address for the healthz server to serve on (set to `0.0.0.0` for all IPv4 interfaces and `::` for all IPv6 interfaces)")
|
||||
fs.Int32Var(&c.OOMScoreAdj, "oom-score-adj", c.OOMScoreAdj, "The oom-score-adj value for kubelet process. Values must be within the range [-1000, 1000]")
|
||||
@ -452,13 +518,17 @@ func AddKubeletConfigFlags(fs *pflag.FlagSet, c *kubeletconfig.KubeletConfigurat
|
||||
fs.StringVar(&c.HairpinMode, "hairpin-mode", c.HairpinMode, "How should the kubelet setup hairpin NAT. This allows endpoints of a Service to loadbalance back to themselves if they should try to access their own Service. Valid values are \"promiscuous-bridge\", \"hairpin-veth\" and \"none\".")
|
||||
fs.Int32Var(&c.MaxPods, "max-pods", c.MaxPods, "Number of Pods that can run on this Kubelet.")
|
||||
|
||||
fs.StringVar(&c.PodCIDR, "pod-cidr", "", "The CIDR to use for pod IP addresses, only used in standalone mode. In cluster mode, this is obtained from the master.")
|
||||
fs.StringVar(&c.PodCIDR, "pod-cidr", c.PodCIDR, "The CIDR to use for pod IP addresses, only used in standalone mode. In cluster mode, this is obtained from the master. For IPv6, the minimum length of the cluster or pod CIDR is /66.")
|
||||
fs.Int64Var(&c.PodPidsLimit, "pod-max-pids", c.PodPidsLimit, "<Warning: Alpha feature> Set the maximum number of processes per pod.")
|
||||
|
||||
fs.StringVar(&c.ResolverConfig, "resolv-conf", c.ResolverConfig, "Resolver configuration file used as the basis for the container DNS resolution configuration.")
|
||||
fs.BoolVar(&c.CPUCFSQuota, "cpu-cfs-quota", c.CPUCFSQuota, "Enable CPU CFS quota enforcement for containers that specify CPU limits")
|
||||
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")
|
||||
fs.BoolVar(&c.MakeIPTablesUtilChains, "make-iptables-util-chains", c.MakeIPTablesUtilChains, "If true, kubelet will ensure iptables utility rules are present on host.")
|
||||
fs.Int32Var(&c.IPTablesMasqueradeBit, "iptables-masquerade-bit", c.IPTablesMasqueradeBit, "The bit of the fwmark space to mark packets for SNAT. Must be within the range [0, 31]. Please match this parameter with corresponding parameter in kube-proxy.")
|
||||
fs.Int32Var(&c.IPTablesDropBit, "iptables-drop-bit", c.IPTablesDropBit, "The bit of the fwmark space to mark packets for dropping. Must be within the range [0, 31].")
|
||||
fs.StringVar(&c.ContainerLogMaxSize, "container-log-max-size", c.ContainerLogMaxSize, "<Warning: Alpha feature> Set the maximum size (e.g. 10Mi) of container log file before it is rotated.")
|
||||
fs.Int32Var(&c.ContainerLogMaxFiles, "container-log-max-files", c.ContainerLogMaxFiles, "<Warning: Alpha feature> Set the maximum number of container log files that can be present for a container. The number must be >= 2.")
|
||||
|
||||
// Flags intended for testing, not recommended used in production environments.
|
||||
fs.Int64Var(&c.MaxOpenFiles, "max-open-files", c.MaxOpenFiles, "Number of files that can be opened by Kubelet process.")
|
||||
@ -480,7 +550,7 @@ func AddKubeletConfigFlags(fs *pflag.FlagSet, c *kubeletconfig.KubeletConfigurat
|
||||
// Node Allocatable Flags
|
||||
fs.Var(flag.NewMapStringString(&c.SystemReserved), "system-reserved", "A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=500Mi,ephemeral-storage=1Gi) pairs that describe resources reserved for non-kubernetes components. Currently only cpu and memory are supported. See http://kubernetes.io/docs/user-guide/compute-resources for more detail. [default=none]")
|
||||
fs.Var(flag.NewMapStringString(&c.KubeReserved), "kube-reserved", "A set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=500Mi,ephemeral-storage=1Gi) pairs that describe resources reserved for kubernetes system components. Currently cpu, memory and local ephemeral storage for root file system are supported. See http://kubernetes.io/docs/user-guide/compute-resources for more detail. [default=none]")
|
||||
fs.StringSliceVar(&c.EnforceNodeAllocatable, "enforce-node-allocatable", c.EnforceNodeAllocatable, "A comma separated list of levels of node allocatable enforcement to be enforced by kubelet. Acceptible options are 'pods', 'system-reserved' & 'kube-reserved'. If the latter two options are specified, '--system-reserved-cgroup' & '--kube-reserved-cgroup' must also be set respectively. See https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/ for more details.")
|
||||
fs.StringSliceVar(&c.EnforceNodeAllocatable, "enforce-node-allocatable", c.EnforceNodeAllocatable, "A comma separated list of levels of node allocatable enforcement to be enforced by kubelet. Acceptable options are 'none', 'pods', 'system-reserved', and 'kube-reserved'. If the latter two options are specified, '--system-reserved-cgroup' and '--kube-reserved-cgroup' must also be set, respectively. If 'none' is specified, no additional options should be set. See https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/ for more details.")
|
||||
fs.StringVar(&c.SystemReservedCgroup, "system-reserved-cgroup", c.SystemReservedCgroup, "Absolute name of the top level cgroup that is used to manage non-kubernetes components for which compute resources were reserved via '--system-reserved' flag. Ex. '/system-reserved'. [default='']")
|
||||
fs.StringVar(&c.KubeReservedCgroup, "kube-reserved-cgroup", c.KubeReservedCgroup, "Absolute name of the top level cgroup that is used to manage kubernetes components for which compute resources were reserved via '--kube-reserved' flag. Ex. '/kube-reserved'. [default='']")
|
||||
}
|
||||
|
2
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options_test.go
generated
vendored
2
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options_test.go
generated
vendored
@ -36,9 +36,7 @@ func newKubeletServerOrDie() *KubeletServer {
|
||||
}
|
||||
|
||||
func cleanFlags(s *KubeletServer) {
|
||||
s.KubeConfig = utilflag.NewStringFlag(s.KubeConfig.Value())
|
||||
s.DynamicConfigDir = utilflag.NewStringFlag(s.DynamicConfigDir.Value())
|
||||
s.InitConfigDir = utilflag.NewStringFlag(s.InitConfigDir.Value())
|
||||
}
|
||||
|
||||
// TestRoundTrip ensures that flag values from the Kubelet can be serialized
|
||||
|
Reference in New Issue
Block a user