mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
vendor update for CSI 0.3.0
This commit is contained in:
1
vendor/k8s.io/kubernetes/cmd/kubelet/BUILD
generated
vendored
1
vendor/k8s.io/kubernetes/cmd/kubelet/BUILD
generated
vendored
@ -21,6 +21,7 @@ go_library(
|
||||
"//cmd/kubelet/app:go_default_library",
|
||||
"//pkg/client/metrics/prometheus:go_default_library",
|
||||
"//pkg/version/prometheus:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/server:go_default_library",
|
||||
"//vendor/k8s.io/apiserver/pkg/util/logs:go_default_library",
|
||||
],
|
||||
)
|
||||
|
24
vendor/k8s.io/kubernetes/cmd/kubelet/app/BUILD
generated
vendored
24
vendor/k8s.io/kubernetes/cmd/kubelet/app/BUILD
generated
vendored
@ -20,36 +20,47 @@ go_library(
|
||||
"server.go",
|
||||
] + select({
|
||||
"@io_bazel_rules_go//go/platform:android": [
|
||||
"init_others.go",
|
||||
"server_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:darwin": [
|
||||
"init_others.go",
|
||||
"server_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:dragonfly": [
|
||||
"init_others.go",
|
||||
"server_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:freebsd": [
|
||||
"init_others.go",
|
||||
"server_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:linux": [
|
||||
"init_others.go",
|
||||
"server_linux.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:nacl": [
|
||||
"init_others.go",
|
||||
"server_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:netbsd": [
|
||||
"init_others.go",
|
||||
"server_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:openbsd": [
|
||||
"init_others.go",
|
||||
"server_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:plan9": [
|
||||
"init_others.go",
|
||||
"server_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:solaris": [
|
||||
"init_others.go",
|
||||
"server_unsupported.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:windows": [
|
||||
"init_windows.go",
|
||||
"server_unsupported.go",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
@ -73,6 +84,7 @@ go_library(
|
||||
"//pkg/kubelet/apis/kubeletconfig:go_default_library",
|
||||
"//pkg/kubelet/apis/kubeletconfig/scheme:go_default_library",
|
||||
"//pkg/kubelet/apis/kubeletconfig/v1beta1:go_default_library",
|
||||
"//pkg/kubelet/apis/kubeletconfig/validation:go_default_library",
|
||||
"//pkg/kubelet/cadvisor:go_default_library",
|
||||
"//pkg/kubelet/certificate:go_default_library",
|
||||
"//pkg/kubelet/certificate/bootstrap:go_default_library",
|
||||
@ -80,14 +92,14 @@ go_library(
|
||||
"//pkg/kubelet/config:go_default_library",
|
||||
"//pkg/kubelet/container:go_default_library",
|
||||
"//pkg/kubelet/dockershim:go_default_library",
|
||||
"//pkg/kubelet/dockershim/network:go_default_library",
|
||||
"//pkg/kubelet/dockershim/network/cni:go_default_library",
|
||||
"//pkg/kubelet/dockershim/network/kubenet:go_default_library",
|
||||
"//pkg/kubelet/dockershim/remote:go_default_library",
|
||||
"//pkg/kubelet/eviction:go_default_library",
|
||||
"//pkg/kubelet/eviction/api:go_default_library",
|
||||
"//pkg/kubelet/kubeletconfig:go_default_library",
|
||||
"//pkg/kubelet/kubeletconfig/configfiles:go_default_library",
|
||||
"//pkg/kubelet/network:go_default_library",
|
||||
"//pkg/kubelet/network/cni:go_default_library",
|
||||
"//pkg/kubelet/network/kubenet:go_default_library",
|
||||
"//pkg/kubelet/server:go_default_library",
|
||||
"//pkg/kubelet/server/streaming:go_default_library",
|
||||
"//pkg/kubelet/types:go_default_library",
|
||||
@ -98,6 +110,7 @@ go_library(
|
||||
"//pkg/util/io:go_default_library",
|
||||
"//pkg/util/mount:go_default_library",
|
||||
"//pkg/util/node:go_default_library",
|
||||
"//pkg/util/nsenter:go_default_library",
|
||||
"//pkg/util/oom:go_default_library",
|
||||
"//pkg/util/rlimit:go_default_library",
|
||||
"//pkg/version:go_default_library",
|
||||
@ -131,6 +144,7 @@ go_library(
|
||||
"//pkg/volume/secret:go_default_library",
|
||||
"//pkg/volume/storageos:go_default_library",
|
||||
"//pkg/volume/vsphere_volume:go_default_library",
|
||||
"//vendor/github.com/coreos/go-systemd/daemon:go_default_library",
|
||||
"//vendor/github.com/golang/glog:go_default_library",
|
||||
"//vendor/github.com/spf13/cobra:go_default_library",
|
||||
"//vendor/github.com/spf13/pflag:go_default_library",
|
||||
@ -157,10 +171,14 @@ go_library(
|
||||
"//vendor/k8s.io/client-go/tools/record:go_default_library",
|
||||
"//vendor/k8s.io/client-go/util/cert:go_default_library",
|
||||
"//vendor/k8s.io/client-go/util/certificate:go_default_library",
|
||||
"//vendor/k8s.io/utils/exec:go_default_library",
|
||||
] + select({
|
||||
"@io_bazel_rules_go//go/platform:linux": [
|
||||
"//vendor/golang.org/x/exp/inotify:go_default_library",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:windows": [
|
||||
"//pkg/windows/service:go_default_library",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
|
23
vendor/k8s.io/kubernetes/cmd/kubelet/app/init_others.go
generated
vendored
Normal file
23
vendor/k8s.io/kubernetes/cmd/kubelet/app/init_others.go
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
// +build !windows
|
||||
|
||||
/*
|
||||
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 app
|
||||
|
||||
func initForOS(service bool) error {
|
||||
return nil
|
||||
}
|
34
vendor/k8s.io/kubernetes/cmd/kubelet/app/init_windows.go
generated
vendored
Normal file
34
vendor/k8s.io/kubernetes/cmd/kubelet/app/init_windows.go
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
// +build windows
|
||||
|
||||
/*
|
||||
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 app
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/windows/service"
|
||||
)
|
||||
|
||||
const (
|
||||
serviceName = "kubelet"
|
||||
)
|
||||
|
||||
func initForOS(windowsService bool) error {
|
||||
if windowsService {
|
||||
return service.InitService(serviceName)
|
||||
}
|
||||
return nil
|
||||
}
|
11
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/BUILD
generated
vendored
11
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/BUILD
generated
vendored
@ -15,36 +15,47 @@ go_library(
|
||||
] + select({
|
||||
"@io_bazel_rules_go//go/platform:android": [
|
||||
"globalflags_other.go",
|
||||
"osflags_others.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:darwin": [
|
||||
"globalflags_other.go",
|
||||
"osflags_others.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:dragonfly": [
|
||||
"globalflags_other.go",
|
||||
"osflags_others.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:freebsd": [
|
||||
"globalflags_other.go",
|
||||
"osflags_others.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:linux": [
|
||||
"globalflags_linux.go",
|
||||
"osflags_others.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:nacl": [
|
||||
"globalflags_other.go",
|
||||
"osflags_others.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:netbsd": [
|
||||
"globalflags_other.go",
|
||||
"osflags_others.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:openbsd": [
|
||||
"globalflags_other.go",
|
||||
"osflags_others.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:plan9": [
|
||||
"globalflags_other.go",
|
||||
"osflags_others.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:solaris": [
|
||||
"globalflags_other.go",
|
||||
"osflags_others.go",
|
||||
],
|
||||
"@io_bazel_rules_go//go/platform:windows": [
|
||||
"globalflags_other.go",
|
||||
"osflags_windows.go",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
|
21
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/container_runtime.go
generated
vendored
21
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/container_runtime.go
generated
vendored
@ -29,14 +29,11 @@ const (
|
||||
// When these values are updated, also update test/e2e/framework/util.go
|
||||
defaultPodSandboxImageName = "k8s.gcr.io/pause"
|
||||
defaultPodSandboxImageVersion = "3.1"
|
||||
// From pkg/kubelet/rkt/rkt.go to avoid circular import
|
||||
defaultRktAPIServiceEndpoint = "localhost:15441"
|
||||
)
|
||||
|
||||
var (
|
||||
defaultPodSandboxImage = defaultPodSandboxImageName +
|
||||
"-" + runtime.GOARCH + ":" +
|
||||
defaultPodSandboxImageVersion
|
||||
":" + defaultPodSandboxImageVersion
|
||||
)
|
||||
|
||||
// NewContainerRuntimeOptions will create a new ContainerRuntimeOptions with
|
||||
@ -48,13 +45,13 @@ func NewContainerRuntimeOptions() *config.ContainerRuntimeOptions {
|
||||
}
|
||||
|
||||
return &config.ContainerRuntimeOptions{
|
||||
ContainerRuntime: kubetypes.DockerContainerRuntime,
|
||||
DockerEndpoint: dockerEndpoint,
|
||||
DockershimRootDirectory: "/var/lib/dockershim",
|
||||
DockerDisableSharedPID: true,
|
||||
PodSandboxImage: defaultPodSandboxImage,
|
||||
ImagePullProgressDeadline: metav1.Duration{Duration: 1 * time.Minute},
|
||||
RktAPIEndpoint: defaultRktAPIServiceEndpoint,
|
||||
ExperimentalDockershim: false,
|
||||
ContainerRuntime: kubetypes.DockerContainerRuntime,
|
||||
RedirectContainerStreaming: false,
|
||||
DockerEndpoint: dockerEndpoint,
|
||||
DockershimRootDirectory: "/var/lib/dockershim",
|
||||
DockerDisableSharedPID: true,
|
||||
PodSandboxImage: defaultPodSandboxImage,
|
||||
ImagePullProgressDeadline: metav1.Duration{Duration: 1 * time.Minute},
|
||||
ExperimentalDockershim: false,
|
||||
}
|
||||
}
|
||||
|
109
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go
generated
vendored
109
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/options.go
generated
vendored
@ -54,7 +54,6 @@ const defaultRootDir = "/var/lib/kubelet"
|
||||
type KubeletFlags struct {
|
||||
KubeConfig string
|
||||
BootstrapKubeconfig string
|
||||
RotateCertificates bool
|
||||
|
||||
// Insert a probability of random errors during calls to the master.
|
||||
ChaosChance float64
|
||||
@ -125,6 +124,10 @@ type KubeletFlags struct {
|
||||
// cAdvisorPort is the port of the localhost cAdvisor endpoint (set to 0 to disable)
|
||||
CAdvisorPort int32
|
||||
|
||||
// WindowsService should be set to true if kubelet is running as a service on Windows.
|
||||
// Its corresponding flag only gets registered in Windows builds.
|
||||
WindowsService bool
|
||||
|
||||
// EXPERIMENTAL FLAGS
|
||||
// Whitelist of unsafe sysctls or sysctl patterns (ending in *).
|
||||
// +optional
|
||||
@ -147,10 +150,6 @@ type KubeletFlags struct {
|
||||
// This flag, if set, will avoid including `EvictionHard` limits while computing Node Allocatable.
|
||||
// Refer to [Node Allocatable](https://git.k8s.io/community/contributors/design-proposals/node-allocatable.md) doc for more information.
|
||||
ExperimentalNodeAllocatableIgnoreEvictionThreshold bool
|
||||
// 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]"
|
||||
ExperimentalQOSReserved map[string]string
|
||||
// Node Labels are the node labels to add when registering the node in the cluster
|
||||
NodeLabels map[string]string
|
||||
// volumePluginDir is the full path of the directory in which to search
|
||||
@ -170,6 +169,9 @@ type KubeletFlags struct {
|
||||
// bootstrapCheckpointPath is the path to the directory containing pod checkpoints to
|
||||
// run on restore
|
||||
BootstrapCheckpointPath string
|
||||
// NodeStatusMaxImages caps the number of images reported in Node.Status.Images.
|
||||
// This is an experimental, short-term flag to help with node scalability.
|
||||
NodeStatusMaxImages int32
|
||||
|
||||
// DEPRECATED FLAGS
|
||||
// minimumGCAge is the minimum age for a finished container before it is
|
||||
@ -193,10 +195,8 @@ type KubeletFlags struct {
|
||||
// This flag, if set, instructs the kubelet to keep volumes from terminated pods mounted to the node.
|
||||
// This can be useful for debugging volume related issues.
|
||||
KeepTerminatedPodVolumes bool
|
||||
// enable gathering custom metrics.
|
||||
EnableCustomMetrics bool
|
||||
// allowPrivileged enables containers to request privileged mode.
|
||||
// Defaults to false.
|
||||
// Defaults to true.
|
||||
AllowPrivileged bool
|
||||
// hostNetworkSources is a comma-separated list of sources from which the
|
||||
// Kubelet allows pods to use of host network. Defaults to "*". Valid
|
||||
@ -231,20 +231,20 @@ func NewKubeletFlags() *KubeletFlags {
|
||||
NonMasqueradeCIDR: "10.0.0.0/8",
|
||||
RegisterSchedulable: true,
|
||||
ExperimentalKernelMemcgNotification: false,
|
||||
ExperimentalQOSReserved: make(map[string]string),
|
||||
RemoteRuntimeEndpoint: remoteRuntimeEndpoint,
|
||||
RotateCertificates: false,
|
||||
// TODO(#54161:v1.11.0): Remove --enable-custom-metrics flag, it is deprecated.
|
||||
EnableCustomMetrics: false,
|
||||
NodeLabels: make(map[string]string),
|
||||
VolumePluginDir: "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/",
|
||||
RegisterNode: true,
|
||||
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,
|
||||
NodeLabels: make(map[string]string),
|
||||
VolumePluginDir: "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/",
|
||||
RegisterNode: true,
|
||||
SeccompProfileRoot: filepath.Join(defaultRootDir, "seccomp"),
|
||||
HostNetworkSources: []string{kubetypes.AllSource},
|
||||
HostPIDSources: []string{kubetypes.AllSource},
|
||||
HostIPCSources: []string{kubetypes.AllSource},
|
||||
// TODO(#56523:v1.12.0): Remove --cadvisor-port, it has been deprecated since v1.10
|
||||
CAdvisorPort: 0,
|
||||
// TODO(#58010:v1.13.0): Remove --allow-privileged, it is deprecated
|
||||
AllowPrivileged: true,
|
||||
// prior to the introduction of this flag, there was a hardcoded cap of 50 images
|
||||
NodeStatusMaxImages: 50,
|
||||
}
|
||||
}
|
||||
|
||||
@ -256,6 +256,9 @@ func ValidateKubeletFlags(f *KubeletFlags) error {
|
||||
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)
|
||||
}
|
||||
if f.NodeStatusMaxImages < -1 {
|
||||
return fmt.Errorf("invalid configuration: NodeStatusMaxImages (--node-status-max-images) must be -1 or greater")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -327,19 +330,30 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
|
||||
}
|
||||
|
||||
// AddFlags adds flags for a specific KubeletFlags to the specified FlagSet
|
||||
func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet) {
|
||||
fs := pflag.NewFlagSet("", pflag.ExitOnError)
|
||||
defer func() {
|
||||
// Unhide deprecated flags. We want deprecated flags to show in Kubelet help.
|
||||
// We have some hidden flags, but we might as well unhide these when they are deprecated,
|
||||
// as silently deprecating and removing (even hidden) things is unkind to people who use them.
|
||||
fs.VisitAll(func(f *pflag.Flag) {
|
||||
if len(f.Deprecated) > 0 {
|
||||
f.Hidden = false
|
||||
}
|
||||
})
|
||||
mainfs.AddFlagSet(fs)
|
||||
}()
|
||||
|
||||
f.ContainerRuntimeOptions.AddFlags(fs)
|
||||
f.addOSFlags(fs)
|
||||
|
||||
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")
|
||||
fs.StringVar(&f.BootstrapKubeconfig, "bootstrap-kubeconfig", f.BootstrapKubeconfig, "Path to a kubeconfig file that will be used to get client certificate for kubelet. "+
|
||||
"If the file specified by --kubeconfig does not exist, the bootstrap kubeconfig is used to request a client certificate from the API server. "+
|
||||
"On success, a kubeconfig file referencing the generated client certificate and key is written to the path specified by --kubeconfig. "+
|
||||
"The client certificate and key file will be stored in the directory pointed by --cert-dir.")
|
||||
fs.BoolVar(&f.RotateCertificates, "rotate-certificates", f.RotateCertificates, "<Warning: Beta feature> Auto rotate the kubelet client certificates by requesting new certificates from the kube-apiserver when the certificate expiration approaches.")
|
||||
|
||||
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.")
|
||||
@ -347,7 +361,7 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
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.")
|
||||
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).")
|
||||
|
||||
fs.StringVar(&f.NodeIP, "node-ip", f.NodeIP, "IP address of the node. If set, kubelet will use this IP address for the node")
|
||||
|
||||
@ -356,12 +370,12 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.StringVar(&f.CertDirectory, "cert-dir", f.CertDirectory, "The directory where the TLS certs are located. "+
|
||||
"If --tls-cert-file and --tls-private-key-file are provided, this flag will be ignored.")
|
||||
|
||||
fs.StringVar(&f.CloudProvider, "cloud-provider", f.CloudProvider, "The provider for cloud services. Specify empty string for running with no cloud provider.")
|
||||
fs.StringVar(&f.CloudProvider, "cloud-provider", f.CloudProvider, "The provider for cloud services. Specify empty string for running with no cloud provider. If set, the cloud provider determines the name of the node (consult cloud provider documentation to determine if and how the hostname is used).")
|
||||
fs.StringVar(&f.CloudConfigFile, "cloud-config", f.CloudConfigFile, "The path to the cloud provider configuration file. Empty string for no configuration file.")
|
||||
|
||||
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.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. The DynamicKubeletConfig feature gate must be enabled to pass this flag; this gate currently defaults to true because the feature is beta.")
|
||||
|
||||
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.")
|
||||
@ -369,13 +383,12 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
|
||||
// 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.StringSliceVar(&f.AllowedUnsafeSysctls, "allowed-unsafe-sysctls", f.AllowedUnsafeSysctls, "Comma-separated whitelist of unsafe sysctls or unsafe sysctl patterns (ending in *). Use these at your own risk. Sysctls feature gate is enabled by default.")
|
||||
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 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, "The full path of the directory in which to search for additional third party volume plugins")
|
||||
@ -383,10 +396,13 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
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")
|
||||
fs.Int32Var(&f.NodeStatusMaxImages, "node-status-max-images", f.NodeStatusMaxImages, "<Warning: Alpha feature> The maximum number of images to report in Node.Status.Images. If -1 is specified, no cap will be applied. Default: 50")
|
||||
|
||||
// DEPRECATED FLAGS
|
||||
fs.StringVar(&f.BootstrapKubeconfig, "experimental-bootstrap-kubeconfig", f.BootstrapKubeconfig, "")
|
||||
fs.MarkDeprecated("experimental-bootstrap-kubeconfig", "Use --bootstrap-kubeconfig")
|
||||
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.MarkDeprecated("cadvisor-port", "The default will change to 0 (disabled) in 1.11, and the cadvisor port will be removed entirely in 1.12")
|
||||
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.")
|
||||
@ -401,11 +417,8 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.MarkDeprecated("non-masquerade-cidr", "will be removed in a future version")
|
||||
fs.BoolVar(&f.KeepTerminatedPodVolumes, "keep-terminated-pod-volumes", f.KeepTerminatedPodVolumes, "Keep terminated pod volumes mounted to the node after the pod terminates. Can be useful for debugging volume related issues.")
|
||||
fs.MarkDeprecated("keep-terminated-pod-volumes", "will be removed in a future version")
|
||||
// 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.")
|
||||
// TODO(#58010:v1.13.0): Remove --allow-privileged, it is deprecated
|
||||
fs.BoolVar(&f.AllowPrivileged, "allow-privileged", f.AllowPrivileged, "If true, allow containers to request privileged mode. Default: true")
|
||||
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.")
|
||||
@ -438,7 +451,6 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig
|
||||
|
||||
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.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")
|
||||
@ -477,13 +489,17 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig
|
||||
"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.")
|
||||
|
||||
tlsCipherPossibleValues := flag.TLSCipherPossibleValues()
|
||||
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")
|
||||
"If omitted, the default Go cipher suites will be used. "+
|
||||
"Possible values: "+strings.Join(tlsCipherPossibleValues, ","))
|
||||
tlsPossibleVersions := flag.TLSPossibleVersions()
|
||||
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.")
|
||||
"Possible values: "+strings.Join(tlsPossibleVersions, ", "))
|
||||
fs.BoolVar(&c.RotateCertificates, "rotate-certificates", c.RotateCertificates, "<Warning: Beta feature> Auto rotate the kubelet client certificates by requesting new certificates from the kube-apiserver when the certificate expiration approaches.")
|
||||
|
||||
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")
|
||||
@ -501,8 +517,8 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig
|
||||
fs.DurationVar(&c.StreamingConnectionIdleTimeout.Duration, "streaming-connection-idle-timeout", c.StreamingConnectionIdleTimeout.Duration, "Maximum time a streaming connection can be idle before the connection is automatically closed. 0 indicates no timeout. Example: '5m'")
|
||||
fs.DurationVar(&c.NodeStatusUpdateFrequency.Duration, "node-status-update-frequency", c.NodeStatusUpdateFrequency.Duration, "Specifies how often kubelet posts node status to master. Note: be cautious when changing the constant, it must work with nodeMonitorGracePeriod in nodecontroller.")
|
||||
fs.DurationVar(&c.ImageMinimumGCAge.Duration, "minimum-image-ttl-duration", c.ImageMinimumGCAge.Duration, "Minimum age for an unused image before it is garbage collected. Examples: '300ms', '10s' or '2h45m'.")
|
||||
fs.Int32Var(&c.ImageGCHighThresholdPercent, "image-gc-high-threshold", c.ImageGCHighThresholdPercent, "The percent of disk usage after which image garbage collection is always run.")
|
||||
fs.Int32Var(&c.ImageGCLowThresholdPercent, "image-gc-low-threshold", c.ImageGCLowThresholdPercent, "The percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to.")
|
||||
fs.Int32Var(&c.ImageGCHighThresholdPercent, "image-gc-high-threshold", c.ImageGCHighThresholdPercent, "The percent of disk usage after which image garbage collection is always run. Values must be within the range [0, 100], To disable image garbage collection, set to 100. ")
|
||||
fs.Int32Var(&c.ImageGCLowThresholdPercent, "image-gc-low-threshold", c.ImageGCLowThresholdPercent, "The percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. Values must be within the range [0, 100] and should not be larger than that of --image-gc-high-threshold.")
|
||||
fs.DurationVar(&c.VolumeStatsAggPeriod.Duration, "volume-stats-agg-period", c.VolumeStatsAggPeriod.Duration, "Specifies interval for kubelet to calculate and cache the volume disk usage for all pods and volumes. To disable volume calculations, set to 0.")
|
||||
fs.Var(flag.NewMapStringBool(&c.FeatureGates), "feature-gates", "A set of key=value pairs that describe feature gates for alpha/experimental features. "+
|
||||
"Options are:\n"+strings.Join(utilfeature.DefaultFeatureGate.KnownFeatures(), "\n"))
|
||||
@ -512,13 +528,14 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig
|
||||
fs.BoolVar(&c.CgroupsPerQOS, "cgroups-per-qos", c.CgroupsPerQOS, "Enable creation of QoS cgroup hierarchy, if true top level QoS and pod cgroups are created.")
|
||||
fs.StringVar(&c.CgroupDriver, "cgroup-driver", c.CgroupDriver, "Driver that the kubelet uses to manipulate cgroups on the host. Possible values: 'cgroupfs', 'systemd'")
|
||||
fs.StringVar(&c.CgroupRoot, "cgroup-root", c.CgroupRoot, "Optional root cgroup to use for pods. This is handled by the container runtime on a best effort basis. Default: '', which means use the container runtime default.")
|
||||
fs.StringVar(&c.CPUManagerPolicy, "cpu-manager-policy", c.CPUManagerPolicy, "<Warning: Alpha feature> CPU Manager policy to use. Possible values: 'none', 'static'. Default: 'none'")
|
||||
fs.StringVar(&c.CPUManagerPolicy, "cpu-manager-policy", c.CPUManagerPolicy, "CPU Manager policy to use. Possible values: 'none', 'static'. Default: 'none'")
|
||||
fs.DurationVar(&c.CPUManagerReconcilePeriod.Duration, "cpu-manager-reconcile-period", c.CPUManagerReconcilePeriod.Duration, "<Warning: Alpha feature> CPU Manager reconciliation period. Examples: '10s', or '1m'. If not supplied, defaults to `NodeStatusUpdateFrequency`")
|
||||
fs.Var(flag.NewMapStringString(&c.QOSReserved), "qos-reserved", "<Warning: Alpha feature> 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. Requires the QOSReserved feature gate to be enabled.")
|
||||
fs.DurationVar(&c.RuntimeRequestTimeout.Duration, "runtime-request-timeout", c.RuntimeRequestTimeout.Duration, "Timeout of all runtime requests except long running request - pull, logs, exec and attach. When timeout exceeded, kubelet will cancel the request, throw out an error and retry later.")
|
||||
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", 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.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 maximum number of IP's allocated is 65536")
|
||||
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.")
|
||||
@ -527,8 +544,8 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig
|
||||
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.")
|
||||
fs.StringVar(&c.ContainerLogMaxSize, "container-log-max-size", c.ContainerLogMaxSize, "<Warning: Beta feature> Set the maximum size (e.g. 10Mi) of container log file before it is rotated. This flag can only be used with --container-runtime=remote.")
|
||||
fs.Int32Var(&c.ContainerLogMaxFiles, "container-log-max-files", c.ContainerLogMaxFiles, "<Warning: Beta feature> Set the maximum number of container log files that can be present for a container. The number must be >= 2. This flag can only be used with --container-runtime=remote.")
|
||||
|
||||
// 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.")
|
||||
|
26
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/osflags_others.go
generated
vendored
Normal file
26
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/osflags_others.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
// +build !windows
|
||||
|
||||
/*
|
||||
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 (f *KubeletFlags) addOSFlags(fs *pflag.FlagSet) {
|
||||
}
|
27
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/osflags_windows.go
generated
vendored
Normal file
27
vendor/k8s.io/kubernetes/cmd/kubelet/app/options/osflags_windows.go
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
// +build windows
|
||||
|
||||
/*
|
||||
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 (f *KubeletFlags) addOSFlags(fs *pflag.FlagSet) {
|
||||
fs.BoolVar(&f.WindowsService, "windows-service", f.WindowsService, "Enable Windows Service Control Manager API integration")
|
||||
}
|
12
vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins.go
generated
vendored
12
vendor/k8s.io/kubernetes/cmd/kubelet/app/plugins.go
generated
vendored
@ -24,9 +24,9 @@ import (
|
||||
_ "k8s.io/kubernetes/pkg/credentialprovider/gcp"
|
||||
_ "k8s.io/kubernetes/pkg/credentialprovider/rancher"
|
||||
// Network plugins
|
||||
"k8s.io/kubernetes/pkg/kubelet/network"
|
||||
"k8s.io/kubernetes/pkg/kubelet/network/cni"
|
||||
"k8s.io/kubernetes/pkg/kubelet/network/kubenet"
|
||||
"k8s.io/kubernetes/pkg/kubelet/dockershim/network"
|
||||
"k8s.io/kubernetes/pkg/kubelet/dockershim/network/cni"
|
||||
"k8s.io/kubernetes/pkg/kubelet/dockershim/network/kubenet"
|
||||
// Volume plugins
|
||||
"k8s.io/kubernetes/pkg/volume"
|
||||
"k8s.io/kubernetes/pkg/volume/aws_ebs"
|
||||
@ -114,12 +114,12 @@ func GetDynamicPluginProber(pluginDir string) volume.DynamicPluginProber {
|
||||
}
|
||||
|
||||
// ProbeNetworkPlugins collects all compiled-in plugins
|
||||
func ProbeNetworkPlugins(cniConfDir, cniBinDir string) []network.NetworkPlugin {
|
||||
func ProbeNetworkPlugins(cniConfDir string, cniBinDirs []string) []network.NetworkPlugin {
|
||||
allPlugins := []network.NetworkPlugin{}
|
||||
|
||||
// for each existing plugin, add to the list
|
||||
allPlugins = append(allPlugins, cni.ProbeNetworkPlugins(cniConfDir, cniBinDir)...)
|
||||
allPlugins = append(allPlugins, kubenet.NewPlugin(cniBinDir))
|
||||
allPlugins = append(allPlugins, cni.ProbeNetworkPlugins(cniConfDir, cniBinDirs)...)
|
||||
allPlugins = append(allPlugins, kubenet.NewPlugin(cniBinDirs))
|
||||
|
||||
return allPlugins
|
||||
}
|
||||
|
165
vendor/k8s.io/kubernetes/cmd/kubelet/app/server.go
generated
vendored
165
vendor/k8s.io/kubernetes/cmd/kubelet/app/server.go
generated
vendored
@ -31,8 +31,10 @@ import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/coreos/go-systemd/daemon"
|
||||
"github.com/golang/glog"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
@ -66,6 +68,7 @@ import (
|
||||
kubeletconfiginternal "k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig"
|
||||
kubeletscheme "k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/scheme"
|
||||
kubeletconfigv1beta1 "k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1beta1"
|
||||
kubeletconfigvalidation "k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/validation"
|
||||
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
|
||||
kubeletcertificate "k8s.io/kubernetes/pkg/kubelet/certificate"
|
||||
"k8s.io/kubernetes/pkg/kubelet/certificate/bootstrap"
|
||||
@ -88,10 +91,12 @@ import (
|
||||
kubeio "k8s.io/kubernetes/pkg/util/io"
|
||||
"k8s.io/kubernetes/pkg/util/mount"
|
||||
nodeutil "k8s.io/kubernetes/pkg/util/node"
|
||||
"k8s.io/kubernetes/pkg/util/nsenter"
|
||||
"k8s.io/kubernetes/pkg/util/oom"
|
||||
"k8s.io/kubernetes/pkg/util/rlimit"
|
||||
"k8s.io/kubernetes/pkg/version"
|
||||
"k8s.io/kubernetes/pkg/version/verflag"
|
||||
"k8s.io/utils/exec"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -100,8 +105,9 @@ const (
|
||||
)
|
||||
|
||||
// NewKubeletCommand creates a *cobra.Command object with default parameters
|
||||
func NewKubeletCommand() *cobra.Command {
|
||||
func NewKubeletCommand(stopCh <-chan struct{}) *cobra.Command {
|
||||
cleanFlagSet := pflag.NewFlagSet(componentKubelet, pflag.ContinueOnError)
|
||||
cleanFlagSet.SetNormalizeFunc(flag.WordSepNormalizeFunc)
|
||||
kubeletFlags := options.NewKubeletFlags()
|
||||
kubeletConfig, err := options.NewKubeletConfiguration()
|
||||
// programmer error
|
||||
@ -142,6 +148,13 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
|
||||
glog.Fatal(err)
|
||||
}
|
||||
|
||||
// check if there are non-flag arguments in the command line
|
||||
cmds := cleanFlagSet.Args()
|
||||
if len(cmds) > 0 {
|
||||
cmd.Usage()
|
||||
glog.Fatalf("unknown command: %s", cmds[0])
|
||||
}
|
||||
|
||||
// short-circuit on help
|
||||
help, err := cleanFlagSet.GetBool("help")
|
||||
if err != nil {
|
||||
@ -166,6 +179,10 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
|
||||
glog.Fatal(err)
|
||||
}
|
||||
|
||||
if kubeletFlags.ContainerRuntime == "remote" && cleanFlagSet.Changed("pod-infra-container-image") {
|
||||
glog.Warning("Warning: For remote container runtime, --pod-infra-container-image is ignored in kubelet, which should be set in that remote runtime instead")
|
||||
}
|
||||
|
||||
// load kubelet config file, if provided
|
||||
if configFile := kubeletFlags.KubeletConfigFile; len(configFile) > 0 {
|
||||
kubeletConfig, err = loadConfigFile(configFile)
|
||||
@ -184,22 +201,35 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
|
||||
}
|
||||
}
|
||||
|
||||
// We always validate the local configuration (command line + config file).
|
||||
// This is the default "last-known-good" config for dynamic config, and must always remain valid.
|
||||
if err := kubeletconfigvalidation.ValidateKubeletConfiguration(kubeletConfig); err != nil {
|
||||
glog.Fatal(err)
|
||||
}
|
||||
|
||||
// use dynamic kubelet config, if enabled
|
||||
var kubeletConfigController *dynamickubeletconfig.Controller
|
||||
if dynamicConfigDir := kubeletFlags.DynamicConfigDir.Value(); len(dynamicConfigDir) > 0 {
|
||||
kubeletConfig, kubeletConfigController, err = BootstrapKubeletConfigController(kubeletConfig, dynamicConfigDir)
|
||||
var dynamicKubeletConfig *kubeletconfiginternal.KubeletConfiguration
|
||||
dynamicKubeletConfig, kubeletConfigController, err = BootstrapKubeletConfigController(dynamicConfigDir,
|
||||
func(kc *kubeletconfiginternal.KubeletConfiguration) error {
|
||||
// Here, we enforce flag precedence inside the controller, prior to the controller's validation sequence,
|
||||
// so that we get a complete validation at the same point where we can decide to reject dynamic config.
|
||||
// This fixes the flag-precedence component of issue #63305.
|
||||
// See issue #56171 for general details on flag precedence.
|
||||
return kubeletConfigFlagPrecedence(kc, args)
|
||||
})
|
||||
if err != nil {
|
||||
glog.Fatal(err)
|
||||
}
|
||||
// We must enforce flag precedence by re-parsing the command line into the new object.
|
||||
// This is necessary to preserve backwards-compatibility across binary upgrades.
|
||||
// See issue #56171 for more details.
|
||||
if err := kubeletConfigFlagPrecedence(kubeletConfig, args); err != nil {
|
||||
glog.Fatal(err)
|
||||
}
|
||||
// update feature gates based on new config
|
||||
if err := utilfeature.DefaultFeatureGate.SetFromMap(kubeletConfig.FeatureGates); err != nil {
|
||||
glog.Fatal(err)
|
||||
// If we should just use our existing, local config, the controller will return a nil config
|
||||
if dynamicKubeletConfig != nil {
|
||||
kubeletConfig = dynamicKubeletConfig
|
||||
// Note: flag precedence was already enforced in the controller, prior to validation,
|
||||
// by our above transform function. Now we simply update feature gates from the new config.
|
||||
if err := utilfeature.DefaultFeatureGate.SetFromMap(kubeletConfig.FeatureGates); err != nil {
|
||||
glog.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,13 +250,15 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
|
||||
|
||||
// start the experimental docker shim, if enabled
|
||||
if kubeletServer.KubeletFlags.ExperimentalDockershim {
|
||||
if err := RunDockershim(&kubeletServer.KubeletFlags, kubeletConfig); err != nil {
|
||||
if err := RunDockershim(&kubeletServer.KubeletFlags, kubeletConfig, stopCh); err != nil {
|
||||
glog.Fatal(err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// run the kubelet
|
||||
if err := Run(kubeletServer, kubeletDeps); err != nil {
|
||||
glog.V(5).Infof("KubeletConfiguration: %#v", kubeletServer.KubeletConfiguration)
|
||||
if err := Run(kubeletServer, kubeletDeps, stopCh); err != nil {
|
||||
glog.Fatal(err)
|
||||
}
|
||||
},
|
||||
@ -331,8 +363,12 @@ func UnsecuredDependencies(s *options.KubeletServer) (*kubelet.Dependencies, err
|
||||
var writer kubeio.Writer = &kubeio.StdWriter{}
|
||||
if s.Containerized {
|
||||
glog.V(2).Info("Running kubelet in containerized mode")
|
||||
mounter = mount.NewNsenterMounter()
|
||||
writer = &kubeio.NsenterWriter{}
|
||||
ne, err := nsenter.NewNsenter(nsenter.DefaultHostRootFsPath, exec.New())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mounter = mount.NewNsenterMounter(s.RootDirectory, ne)
|
||||
writer = kubeio.NewNsenterWriter(ne)
|
||||
}
|
||||
|
||||
var dockerClientConfig *dockershim.ClientConfig
|
||||
@ -355,7 +391,6 @@ func UnsecuredDependencies(s *options.KubeletServer) (*kubelet.Dependencies, err
|
||||
ExternalKubeClient: nil,
|
||||
EventClient: nil,
|
||||
Mounter: mounter,
|
||||
NetworkPlugins: ProbeNetworkPlugins(s.CNIConfDir, s.CNIBinDir),
|
||||
OOMAdjuster: oom.NewOOMAdjuster(),
|
||||
OSInterface: kubecontainer.RealOS{},
|
||||
Writer: writer,
|
||||
@ -368,10 +403,13 @@ func UnsecuredDependencies(s *options.KubeletServer) (*kubelet.Dependencies, err
|
||||
// The kubeDeps argument may be nil - if so, it is initialized from the settings on KubeletServer.
|
||||
// Otherwise, the caller is assumed to have set up the Dependencies object and a default one will
|
||||
// not be generated.
|
||||
func Run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies) error {
|
||||
func Run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, stopCh <-chan struct{}) error {
|
||||
// To help debugging, immediately log version
|
||||
glog.Infof("Version: %+v", version.Get())
|
||||
if err := run(s, kubeDeps); err != nil {
|
||||
if err := initForOS(s.KubeletFlags.WindowsService); err != nil {
|
||||
return fmt.Errorf("failed OS init: %v", err)
|
||||
}
|
||||
if err := run(s, kubeDeps, stopCh); err != nil {
|
||||
return fmt.Errorf("failed to run Kubelet: %v", err)
|
||||
}
|
||||
return nil
|
||||
@ -428,7 +466,7 @@ func makeEventRecorder(kubeDeps *kubelet.Dependencies, nodeName types.NodeName)
|
||||
}
|
||||
}
|
||||
|
||||
func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies) (err error) {
|
||||
func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, stopCh <-chan struct{}) (err error) {
|
||||
// Set global feature gates based on the value on the initial KubeletServer
|
||||
err = utilfeature.DefaultFeatureGate.SetFromMap(s.KubeletConfiguration.FeatureGates)
|
||||
if err != nil {
|
||||
@ -527,13 +565,13 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies) (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// we set exitAfter to five minutes because we use this client configuration to request new certs - if we are unable
|
||||
// to request new certs, we will be unable to continue normal operation. Exiting the process allows a wrapper
|
||||
// or the bootstrapping credentials to potentially lay down new initial config.
|
||||
if err := kubeletcertificate.UpdateTransport(wait.NeverStop, clientConfig, clientCertificateManager, 5*time.Minute); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// we set exitAfter to five minutes because we use this client configuration to request new certs - if we are unable
|
||||
// to request new certs, we will be unable to continue normal operation. Exiting the process allows a wrapper
|
||||
// or the bootstrapping credentials to potentially lay down new initial config.
|
||||
closeAllConns, err := kubeletcertificate.UpdateTransport(wait.NeverStop, clientConfig, clientCertificateManager, 5*time.Minute)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
kubeClient, err = clientset.NewForConfig(clientConfig)
|
||||
@ -571,6 +609,7 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies) (err error) {
|
||||
kubeDeps.ExternalKubeClient = externalKubeClient
|
||||
if heartbeatClient != nil {
|
||||
kubeDeps.HeartbeatClient = heartbeatClient
|
||||
kubeDeps.OnHeartbeatFailure = closeAllConns
|
||||
}
|
||||
if eventClient != nil {
|
||||
kubeDeps.EventClient = eventClient
|
||||
@ -580,7 +619,9 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies) (err error) {
|
||||
// If the kubelet config controller is available, and dynamic config is enabled, start the config and status sync loops
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicKubeletConfig) && len(s.DynamicConfigDir.Value()) > 0 &&
|
||||
kubeDeps.KubeletConfigController != nil && !standaloneMode && !s.RunOnce {
|
||||
kubeDeps.KubeletConfigController.StartSync(kubeDeps.KubeClient, kubeDeps.EventClient, string(nodeName))
|
||||
if err := kubeDeps.KubeletConfigController.StartSync(kubeDeps.KubeClient, kubeDeps.EventClient, string(nodeName)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if kubeDeps.Auth == nil {
|
||||
@ -623,7 +664,7 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies) (err error) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
experimentalQOSReserved, err := cm.ParseQOSReserved(s.ExperimentalQOSReserved)
|
||||
experimentalQOSReserved, err := cm.ParseQOSReserved(s.QOSReserved)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -651,10 +692,11 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies) (err error) {
|
||||
SystemReserved: systemReserved,
|
||||
HardEvictionThresholds: hardEvictionThresholds,
|
||||
},
|
||||
ExperimentalQOSReserved: *experimentalQOSReserved,
|
||||
QOSReserved: *experimentalQOSReserved,
|
||||
ExperimentalCPUManagerPolicy: s.CPUManagerPolicy,
|
||||
ExperimentalCPUManagerReconcilePeriod: s.CPUManagerReconcilePeriod.Duration,
|
||||
ExperimentalPodPidsLimit: s.PodPidsLimit,
|
||||
EnforceCPULimits: s.CPUCFSQuota,
|
||||
},
|
||||
s.FailSwapOn,
|
||||
devicePluginEnabled,
|
||||
@ -697,7 +739,16 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies) (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
<-done
|
||||
// If systemd is used, notify it that we have started
|
||||
go daemon.SdNotify(false, "READY=1")
|
||||
|
||||
select {
|
||||
case <-done:
|
||||
break
|
||||
case <-stopCh:
|
||||
break
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -726,7 +777,7 @@ func getNodeName(cloud cloudprovider.Interface, hostname string) (types.NodeName
|
||||
// InitializeTLS checks for a configured TLSCertFile and TLSPrivateKeyFile: if unspecified a new self-signed
|
||||
// certificate and key file are generated. Returns a configured server.TLSOptions object.
|
||||
func InitializeTLS(kf *options.KubeletFlags, kc *kubeletconfiginternal.KubeletConfiguration) (*server.TLSOptions, error) {
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.RotateKubeletServerCertificate) && kc.TLSCertFile == "" && kc.TLSPrivateKeyFile == "" {
|
||||
if !kc.ServerTLSBootstrap && kc.TLSCertFile == "" && kc.TLSPrivateKeyFile == "" {
|
||||
kc.TLSCertFile = path.Join(kf.CertDirectory, "kubelet.crt")
|
||||
kc.TLSPrivateKeyFile = path.Join(kf.CertDirectory, "kubelet.key")
|
||||
|
||||
@ -909,7 +960,8 @@ func RunKubelet(kubeFlags *options.KubeletFlags, kubeCfg *kubeletconfiginternal.
|
||||
kubeFlags.KeepTerminatedPodVolumes,
|
||||
kubeFlags.NodeLabels,
|
||||
kubeFlags.SeccompProfileRoot,
|
||||
kubeFlags.BootstrapCheckpointPath)
|
||||
kubeFlags.BootstrapCheckpointPath,
|
||||
kubeFlags.NodeStatusMaxImages)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create kubelet: %v", err)
|
||||
}
|
||||
@ -937,20 +989,31 @@ func RunKubelet(kubeFlags *options.KubeletFlags, kubeCfg *kubeletconfiginternal.
|
||||
}
|
||||
|
||||
func startKubelet(k kubelet.Bootstrap, podCfg *config.PodConfig, kubeCfg *kubeletconfiginternal.KubeletConfiguration, kubeDeps *kubelet.Dependencies, enableServer bool) {
|
||||
wg := sync.WaitGroup{}
|
||||
|
||||
// start the kubelet
|
||||
go wait.Until(func() { k.Run(podCfg.Updates()) }, 0, wait.NeverStop)
|
||||
wg.Add(1)
|
||||
go wait.Until(func() {
|
||||
wg.Done()
|
||||
k.Run(podCfg.Updates())
|
||||
}, 0, wait.NeverStop)
|
||||
|
||||
// start the kubelet server
|
||||
if enableServer {
|
||||
wg.Add(1)
|
||||
go wait.Until(func() {
|
||||
wg.Done()
|
||||
k.ListenAndServe(net.ParseIP(kubeCfg.Address), uint(kubeCfg.Port), kubeDeps.TLSOptions, kubeDeps.Auth, kubeCfg.EnableDebuggingHandlers, kubeCfg.EnableContentionProfiling)
|
||||
}, 0, wait.NeverStop)
|
||||
}
|
||||
if kubeCfg.ReadOnlyPort > 0 {
|
||||
wg.Add(1)
|
||||
go wait.Until(func() {
|
||||
wg.Done()
|
||||
k.ListenAndServeReadOnly(net.ParseIP(kubeCfg.Address), uint(kubeCfg.ReadOnlyPort))
|
||||
}, 0, wait.NeverStop)
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
func CreateAndInitKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
||||
@ -982,7 +1045,8 @@ func CreateAndInitKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
||||
keepTerminatedPodVolumes bool,
|
||||
nodeLabels map[string]string,
|
||||
seccompProfileRoot string,
|
||||
bootstrapCheckpointPath string) (k kubelet.Bootstrap, err error) {
|
||||
bootstrapCheckpointPath string,
|
||||
nodeStatusMaxImages int32) (k kubelet.Bootstrap, err error) {
|
||||
// TODO: block until all sources have delivered at least one update to the channel, or break the sync loop
|
||||
// up into "per source" synchronizations
|
||||
|
||||
@ -1015,7 +1079,8 @@ func CreateAndInitKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
||||
keepTerminatedPodVolumes,
|
||||
nodeLabels,
|
||||
seccompProfileRoot,
|
||||
bootstrapCheckpointPath)
|
||||
bootstrapCheckpointPath,
|
||||
nodeStatusMaxImages)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -1054,8 +1119,7 @@ func parseResourceList(m map[string]string) (v1.ResourceList, error) {
|
||||
}
|
||||
|
||||
// BootstrapKubeletConfigController constructs and bootstrap a configuration controller
|
||||
func BootstrapKubeletConfigController(defaultConfig *kubeletconfiginternal.KubeletConfiguration,
|
||||
dynamicConfigDir string) (*kubeletconfiginternal.KubeletConfiguration, *dynamickubeletconfig.Controller, error) {
|
||||
func BootstrapKubeletConfigController(dynamicConfigDir string, transform dynamickubeletconfig.TransformFunc) (*kubeletconfiginternal.KubeletConfiguration, *dynamickubeletconfig.Controller, error) {
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(features.DynamicKubeletConfig) {
|
||||
return nil, nil, fmt.Errorf("failed to bootstrap Kubelet config controller, you must enable the DynamicKubeletConfig feature gate")
|
||||
}
|
||||
@ -1069,7 +1133,7 @@ func BootstrapKubeletConfigController(defaultConfig *kubeletconfiginternal.Kubel
|
||||
return nil, nil, fmt.Errorf("failed to get absolute path for --dynamic-config-dir=%s", dynamicConfigDir)
|
||||
}
|
||||
// get the latest KubeletConfiguration checkpoint from disk, or return the default config if no valid checkpoints exist
|
||||
c := dynamickubeletconfig.NewController(defaultConfig, dir)
|
||||
c := dynamickubeletconfig.NewController(dir, transform)
|
||||
kc, err := c.Bootstrap()
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to determine a valid configuration, error: %v", err)
|
||||
@ -1079,7 +1143,7 @@ func BootstrapKubeletConfigController(defaultConfig *kubeletconfiginternal.Kubel
|
||||
|
||||
// RunDockershim only starts the dockershim in current process. This is only used for cri validate testing purpose
|
||||
// TODO(random-liu): Move this to a separate binary.
|
||||
func RunDockershim(f *options.KubeletFlags, c *kubeletconfiginternal.KubeletConfiguration) error {
|
||||
func RunDockershim(f *options.KubeletFlags, c *kubeletconfiginternal.KubeletConfiguration, stopCh <-chan struct{}) error {
|
||||
r := &f.ContainerRuntimeOptions
|
||||
|
||||
// Initialize docker client configuration.
|
||||
@ -1090,15 +1154,13 @@ func RunDockershim(f *options.KubeletFlags, c *kubeletconfiginternal.KubeletConf
|
||||
}
|
||||
|
||||
// Initialize network plugin settings.
|
||||
nh := &kubelet.NoOpLegacyHost{}
|
||||
pluginSettings := dockershim.NetworkPluginSettings{
|
||||
HairpinMode: kubeletconfiginternal.HairpinMode(c.HairpinMode),
|
||||
NonMasqueradeCIDR: f.NonMasqueradeCIDR,
|
||||
PluginName: r.NetworkPluginName,
|
||||
PluginConfDir: r.CNIConfDir,
|
||||
PluginBinDir: r.CNIBinDir,
|
||||
MTU: int(r.NetworkPluginMTU),
|
||||
LegacyRuntimeHost: nh,
|
||||
HairpinMode: kubeletconfiginternal.HairpinMode(c.HairpinMode),
|
||||
NonMasqueradeCIDR: f.NonMasqueradeCIDR,
|
||||
PluginName: r.NetworkPluginName,
|
||||
PluginConfDir: r.CNIConfDir,
|
||||
PluginBinDirString: r.CNIBinDir,
|
||||
MTU: int(r.NetworkPluginMTU),
|
||||
}
|
||||
|
||||
// Initialize streaming configuration. (Not using TLS now)
|
||||
@ -1111,8 +1173,9 @@ func RunDockershim(f *options.KubeletFlags, c *kubeletconfiginternal.KubeletConf
|
||||
SupportedPortForwardProtocols: streaming.DefaultConfig.SupportedPortForwardProtocols,
|
||||
}
|
||||
|
||||
// Standalone dockershim will always start the local streaming server.
|
||||
ds, err := dockershim.NewDockerService(dockerClientConfig, r.PodSandboxImage, streamingConfig, &pluginSettings,
|
||||
f.RuntimeCgroups, c.CgroupDriver, r.DockershimRootDirectory, r.DockerDisableSharedPID)
|
||||
f.RuntimeCgroups, c.CgroupDriver, r.DockershimRootDirectory, r.DockerDisableSharedPID, true /*startLocalStreamingServer*/)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -1121,8 +1184,6 @@ func RunDockershim(f *options.KubeletFlags, c *kubeletconfiginternal.KubeletConf
|
||||
if err := server.Start(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Start the streaming server
|
||||
addr := net.JoinHostPort(c.Address, strconv.Itoa(int(c.Port)))
|
||||
return http.ListenAndServe(addr, ds)
|
||||
<-stopCh
|
||||
return nil
|
||||
}
|
||||
|
3
vendor/k8s.io/kubernetes/cmd/kubelet/kubelet.go
generated
vendored
3
vendor/k8s.io/kubernetes/cmd/kubelet/kubelet.go
generated
vendored
@ -26,6 +26,7 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"k8s.io/apiserver/pkg/server"
|
||||
"k8s.io/apiserver/pkg/util/logs"
|
||||
"k8s.io/kubernetes/cmd/kubelet/app"
|
||||
_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client metric registration
|
||||
@ -35,7 +36,7 @@ import (
|
||||
func main() {
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
|
||||
command := app.NewKubeletCommand()
|
||||
command := app.NewKubeletCommand(server.SetupSignalHandler())
|
||||
logs.InitLogs()
|
||||
defer logs.FlushLogs()
|
||||
|
||||
|
Reference in New Issue
Block a user