mirror of https://github.com/k3s-io/k3s
alphabetize structs in cmd/kubelet/app/server.go
parent
3f8953e23b
commit
44e6a566f6
|
@ -204,11 +204,29 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
|
||||||
configFilePath := makeTempDirOrDie("config", testRootDir)
|
configFilePath := makeTempDirOrDie("config", testRootDir)
|
||||||
glog.Infof("Using %s as root dir for kubelet #1", testRootDir)
|
glog.Infof("Using %s as root dir for kubelet #1", testRootDir)
|
||||||
fakeDocker1.VersionInfo = docker.Env{"ApiVersion=1.15"}
|
fakeDocker1.VersionInfo = docker.Env{"ApiVersion=1.15"}
|
||||||
kcfg := kubeletapp.SimpleKubelet(cl, &fakeDocker1, "localhost", testRootDir, firstManifestURL, "127.0.0.1",
|
|
||||||
10250 /* KubeletPort */, 0 /* ReadOnlyPort */, api.NamespaceDefault, empty_dir.ProbeVolumePlugins(), nil,
|
kcfg := kubeletapp.SimpleKubelet(
|
||||||
cadvisorInterface, configFilePath, nil, kubecontainer.FakeOS{}, 1*time.Second, /* FileCheckFrequency */
|
cl,
|
||||||
1*time.Second /* HTTPCheckFrequency */, 10*time.Second /* MinimumGCAge */, 3*time.Second, /* NodeStatusUpdateFrequency */
|
&fakeDocker1,
|
||||||
|
"localhost",
|
||||||
|
testRootDir,
|
||||||
|
firstManifestURL,
|
||||||
|
"127.0.0.1",
|
||||||
|
10250, /* KubeletPort */
|
||||||
|
0, /* ReadOnlyPort */
|
||||||
|
api.NamespaceDefault,
|
||||||
|
empty_dir.ProbeVolumePlugins(),
|
||||||
|
nil,
|
||||||
|
cadvisorInterface,
|
||||||
|
configFilePath,
|
||||||
|
nil,
|
||||||
|
kubecontainer.FakeOS{},
|
||||||
|
1*time.Second, /* FileCheckFrequency */
|
||||||
|
1*time.Second, /* HTTPCheckFrequency */
|
||||||
|
10*time.Second, /* MinimumGCAge */
|
||||||
|
3*time.Second, /* NodeStatusUpdateFrequency */
|
||||||
10*time.Second /* SyncFrequency */)
|
10*time.Second /* SyncFrequency */)
|
||||||
|
|
||||||
kubeletapp.RunKubelet(kcfg, nil)
|
kubeletapp.RunKubelet(kcfg, nil)
|
||||||
// Kubelet (machine)
|
// Kubelet (machine)
|
||||||
// Create a second kubelet so that the guestbook example's two redis slaves both
|
// Create a second kubelet so that the guestbook example's two redis slaves both
|
||||||
|
@ -216,11 +234,29 @@ func startComponents(firstManifestURL, secondManifestURL string) (string, string
|
||||||
testRootDir = makeTempDirOrDie("kubelet_integ_2.", "")
|
testRootDir = makeTempDirOrDie("kubelet_integ_2.", "")
|
||||||
glog.Infof("Using %s as root dir for kubelet #2", testRootDir)
|
glog.Infof("Using %s as root dir for kubelet #2", testRootDir)
|
||||||
fakeDocker2.VersionInfo = docker.Env{"ApiVersion=1.15"}
|
fakeDocker2.VersionInfo = docker.Env{"ApiVersion=1.15"}
|
||||||
kcfg = kubeletapp.SimpleKubelet(cl, &fakeDocker2, "127.0.0.1", testRootDir, secondManifestURL, "127.0.0.1",
|
|
||||||
10251 /* KubeletPort */, 0 /* ReadOnlyPort */, api.NamespaceDefault, empty_dir.ProbeVolumePlugins(), nil,
|
kcfg = kubeletapp.SimpleKubelet(
|
||||||
cadvisorInterface, "", nil, kubecontainer.FakeOS{}, 1*time.Second, /* FileCheckFrequency */
|
cl,
|
||||||
1*time.Second /* HTTPCheckFrequency */, 10*time.Second /* MinimumGCAge */, 3*time.Second, /* NodeStatusUpdateFrequency */
|
&fakeDocker2,
|
||||||
|
"127.0.0.1",
|
||||||
|
testRootDir,
|
||||||
|
secondManifestURL,
|
||||||
|
"127.0.0.1",
|
||||||
|
10251, /* KubeletPort */
|
||||||
|
0, /* ReadOnlyPort */
|
||||||
|
api.NamespaceDefault,
|
||||||
|
empty_dir.ProbeVolumePlugins(),
|
||||||
|
nil,
|
||||||
|
cadvisorInterface,
|
||||||
|
"",
|
||||||
|
nil,
|
||||||
|
kubecontainer.FakeOS{},
|
||||||
|
1*time.Second, /* FileCheckFrequency */
|
||||||
|
1*time.Second, /* HTTPCheckFrequency */
|
||||||
|
10*time.Second, /* MinimumGCAge */
|
||||||
|
3*time.Second, /* NodeStatusUpdateFrequency */
|
||||||
10*time.Second /* SyncFrequency */)
|
10*time.Second /* SyncFrequency */)
|
||||||
|
|
||||||
kubeletapp.RunKubelet(kcfg, nil)
|
kubeletapp.RunKubelet(kcfg, nil)
|
||||||
return apiServer.URL, configFilePath
|
return apiServer.URL, configFilePath
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,75 +66,75 @@ const defaultRootDir = "/var/lib/kubelet"
|
||||||
// KubeletServer encapsulates all of the parameters necessary for starting up
|
// KubeletServer encapsulates all of the parameters necessary for starting up
|
||||||
// a kubelet. These can either be set via command line or directly.
|
// a kubelet. These can either be set via command line or directly.
|
||||||
type KubeletServer struct {
|
type KubeletServer struct {
|
||||||
Config string
|
|
||||||
SyncFrequency time.Duration
|
|
||||||
FileCheckFrequency time.Duration
|
|
||||||
HTTPCheckFrequency time.Duration
|
|
||||||
ManifestURL string
|
|
||||||
ManifestURLHeader string
|
|
||||||
EnableServer bool
|
|
||||||
Address net.IP
|
Address net.IP
|
||||||
Port uint
|
|
||||||
ReadOnlyPort uint
|
|
||||||
HostnameOverride string
|
|
||||||
PodInfraContainerImage string
|
|
||||||
DockerEndpoint string
|
|
||||||
RootDirectory string
|
|
||||||
AllowPrivileged bool
|
AllowPrivileged bool
|
||||||
HostNetworkSources string
|
|
||||||
RegistryPullQPS float64
|
|
||||||
RegistryBurst int
|
|
||||||
EventRecordQPS float32
|
|
||||||
EventBurst int
|
|
||||||
RunOnce bool
|
|
||||||
EnableDebuggingHandlers bool
|
|
||||||
MinimumGCAge time.Duration
|
|
||||||
MaxPerPodContainerCount int
|
|
||||||
MaxContainerCount int
|
|
||||||
AuthPath util.StringFlag // Deprecated -- use KubeConfig instead
|
|
||||||
KubeConfig util.StringFlag
|
|
||||||
CadvisorPort uint
|
|
||||||
HealthzPort int
|
|
||||||
HealthzBindAddress net.IP
|
|
||||||
OOMScoreAdj int
|
|
||||||
APIServerList []string
|
APIServerList []string
|
||||||
RegisterNode bool
|
AuthPath util.StringFlag // Deprecated -- use KubeConfig instead
|
||||||
StandaloneMode bool
|
CadvisorPort uint
|
||||||
ClusterDomain string
|
CertDirectory string
|
||||||
MasterServiceNamespace string
|
CgroupRoot string
|
||||||
|
CloudConfigFile string
|
||||||
|
CloudProvider string
|
||||||
ClusterDNS net.IP
|
ClusterDNS net.IP
|
||||||
StreamingConnectionIdleTimeout time.Duration
|
ClusterDomain string
|
||||||
|
Config string
|
||||||
|
ConfigureCBR0 bool
|
||||||
|
ContainerRuntime string
|
||||||
|
CPUCFSQuota bool
|
||||||
|
DockerDaemonContainer string
|
||||||
|
DockerEndpoint string
|
||||||
|
DockerExecHandlerName string
|
||||||
|
EnableDebuggingHandlers bool
|
||||||
|
EnableServer bool
|
||||||
|
EventBurst int
|
||||||
|
EventRecordQPS float32
|
||||||
|
FileCheckFrequency time.Duration
|
||||||
|
HealthzBindAddress net.IP
|
||||||
|
HealthzPort int
|
||||||
|
HostnameOverride string
|
||||||
|
HostNetworkSources string
|
||||||
|
HTTPCheckFrequency time.Duration
|
||||||
ImageGCHighThresholdPercent int
|
ImageGCHighThresholdPercent int
|
||||||
ImageGCLowThresholdPercent int
|
ImageGCLowThresholdPercent int
|
||||||
|
KubeConfig util.StringFlag
|
||||||
LowDiskSpaceThresholdMB int
|
LowDiskSpaceThresholdMB int
|
||||||
NetworkPluginName string
|
ManifestURL string
|
||||||
|
ManifestURLHeader string
|
||||||
|
MasterServiceNamespace string
|
||||||
|
MaxContainerCount int
|
||||||
|
MaxPerPodContainerCount int
|
||||||
|
MaxPods int
|
||||||
|
MinimumGCAge time.Duration
|
||||||
NetworkPluginDir string
|
NetworkPluginDir string
|
||||||
CloudProvider string
|
NetworkPluginName string
|
||||||
CloudConfigFile string
|
NodeStatusUpdateFrequency time.Duration
|
||||||
|
OOMScoreAdj int
|
||||||
|
PodCIDR string
|
||||||
|
PodInfraContainerImage string
|
||||||
|
Port uint
|
||||||
|
ReadOnlyPort uint
|
||||||
|
RegisterNode bool
|
||||||
|
RegistryBurst int
|
||||||
|
RegistryPullQPS float64
|
||||||
|
ResolverConfig string
|
||||||
|
ResourceContainer string
|
||||||
|
RktPath string
|
||||||
|
RootDirectory string
|
||||||
|
RunOnce bool
|
||||||
|
StandaloneMode bool
|
||||||
|
StreamingConnectionIdleTimeout time.Duration
|
||||||
|
SyncFrequency time.Duration
|
||||||
|
SystemContainer string
|
||||||
TLSCertFile string
|
TLSCertFile string
|
||||||
TLSPrivateKeyFile string
|
TLSPrivateKeyFile string
|
||||||
CertDirectory string
|
|
||||||
NodeStatusUpdateFrequency time.Duration
|
|
||||||
ResourceContainer string
|
|
||||||
CgroupRoot string
|
|
||||||
ContainerRuntime string
|
|
||||||
RktPath string
|
|
||||||
DockerDaemonContainer string
|
|
||||||
SystemContainer string
|
|
||||||
ConfigureCBR0 bool
|
|
||||||
PodCIDR string
|
|
||||||
MaxPods int
|
|
||||||
DockerExecHandlerName string
|
|
||||||
ResolverConfig string
|
|
||||||
CPUCFSQuota bool
|
|
||||||
// Flags intended for testing
|
|
||||||
|
|
||||||
// Crash immediately, rather than eating panics.
|
// Flags intended for testing
|
||||||
ReallyCrashForTesting bool
|
|
||||||
// Insert a probability of random errors during calls to the master.
|
|
||||||
ChaosChance float64
|
|
||||||
// Is the kubelet containerized?
|
// Is the kubelet containerized?
|
||||||
Containerized bool
|
Containerized bool
|
||||||
|
// Insert a probability of random errors during calls to the master.
|
||||||
|
ChaosChance float64
|
||||||
|
// Crash immediately, rather than eating panics.
|
||||||
|
ReallyCrashForTesting bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// bootstrapping interface for kubelet, targets the initialization protocol
|
// bootstrapping interface for kubelet, targets the initialization protocol
|
||||||
|
@ -153,45 +153,45 @@ type KubeletBuilder func(kc *KubeletConfig) (KubeletBootstrap, *config.PodConfig
|
||||||
// NewKubeletServer will create a new KubeletServer with default values.
|
// NewKubeletServer will create a new KubeletServer with default values.
|
||||||
func NewKubeletServer() *KubeletServer {
|
func NewKubeletServer() *KubeletServer {
|
||||||
return &KubeletServer{
|
return &KubeletServer{
|
||||||
SyncFrequency: 10 * time.Second,
|
|
||||||
FileCheckFrequency: 20 * time.Second,
|
|
||||||
HTTPCheckFrequency: 20 * time.Second,
|
|
||||||
EnableServer: true,
|
|
||||||
Address: net.ParseIP("0.0.0.0"),
|
Address: net.ParseIP("0.0.0.0"),
|
||||||
Port: ports.KubeletPort,
|
|
||||||
ReadOnlyPort: ports.KubeletReadOnlyPort,
|
|
||||||
PodInfraContainerImage: dockertools.PodInfraContainerImage,
|
|
||||||
RootDirectory: defaultRootDir,
|
|
||||||
RegistryBurst: 10,
|
|
||||||
EnableDebuggingHandlers: true,
|
|
||||||
MinimumGCAge: 1 * time.Minute,
|
|
||||||
MaxPerPodContainerCount: 2,
|
|
||||||
MaxContainerCount: 100,
|
|
||||||
AuthPath: util.NewStringFlag("/var/lib/kubelet/kubernetes_auth"), // deprecated
|
AuthPath: util.NewStringFlag("/var/lib/kubelet/kubernetes_auth"), // deprecated
|
||||||
KubeConfig: util.NewStringFlag("/var/lib/kubelet/kubeconfig"),
|
|
||||||
CadvisorPort: 4194,
|
CadvisorPort: 4194,
|
||||||
HealthzPort: 10248,
|
CertDirectory: "/var/run/kubernetes",
|
||||||
|
CgroupRoot: "",
|
||||||
|
ConfigureCBR0: false,
|
||||||
|
ContainerRuntime: "docker",
|
||||||
|
CPUCFSQuota: false,
|
||||||
|
DockerDaemonContainer: "/docker-daemon",
|
||||||
|
DockerExecHandlerName: "native",
|
||||||
|
EnableDebuggingHandlers: true,
|
||||||
|
EnableServer: true,
|
||||||
|
FileCheckFrequency: 20 * time.Second,
|
||||||
HealthzBindAddress: net.ParseIP("127.0.0.1"),
|
HealthzBindAddress: net.ParseIP("127.0.0.1"),
|
||||||
RegisterNode: true, // will be ignored if no apiserver is configured
|
HealthzPort: 10248,
|
||||||
OOMScoreAdj: qos.KubeletOomScoreAdj,
|
HostNetworkSources: kubelet.FileSource,
|
||||||
MasterServiceNamespace: api.NamespaceDefault,
|
HTTPCheckFrequency: 20 * time.Second,
|
||||||
ImageGCHighThresholdPercent: 90,
|
ImageGCHighThresholdPercent: 90,
|
||||||
ImageGCLowThresholdPercent: 80,
|
ImageGCLowThresholdPercent: 80,
|
||||||
|
KubeConfig: util.NewStringFlag("/var/lib/kubelet/kubeconfig"),
|
||||||
LowDiskSpaceThresholdMB: 256,
|
LowDiskSpaceThresholdMB: 256,
|
||||||
NetworkPluginName: "",
|
MasterServiceNamespace: api.NamespaceDefault,
|
||||||
|
MaxContainerCount: 100,
|
||||||
|
MaxPerPodContainerCount: 2,
|
||||||
|
MinimumGCAge: 1 * time.Minute,
|
||||||
NetworkPluginDir: "/usr/libexec/kubernetes/kubelet-plugins/net/exec/",
|
NetworkPluginDir: "/usr/libexec/kubernetes/kubelet-plugins/net/exec/",
|
||||||
HostNetworkSources: kubelet.FileSource,
|
NetworkPluginName: "",
|
||||||
CertDirectory: "/var/run/kubernetes",
|
|
||||||
NodeStatusUpdateFrequency: 10 * time.Second,
|
NodeStatusUpdateFrequency: 10 * time.Second,
|
||||||
ResourceContainer: "/kubelet",
|
OOMScoreAdj: qos.KubeletOomScoreAdj,
|
||||||
CgroupRoot: "",
|
PodInfraContainerImage: dockertools.PodInfraContainerImage,
|
||||||
ContainerRuntime: "docker",
|
Port: ports.KubeletPort,
|
||||||
RktPath: "",
|
ReadOnlyPort: ports.KubeletReadOnlyPort,
|
||||||
DockerDaemonContainer: "/docker-daemon",
|
RegisterNode: true, // will be ignored if no apiserver is configured
|
||||||
SystemContainer: "",
|
RegistryBurst: 10,
|
||||||
ConfigureCBR0: false,
|
ResourceContainer: "/kubelet",
|
||||||
DockerExecHandlerName: "native",
|
RktPath: "",
|
||||||
CPUCFSQuota: false,
|
RootDirectory: defaultRootDir,
|
||||||
|
SyncFrequency: 10 * time.Second,
|
||||||
|
SystemContainer: "",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,61 +317,61 @@ func (s *KubeletServer) KubeletConfig() (*KubeletConfig, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return &KubeletConfig{
|
return &KubeletConfig{
|
||||||
Address: s.Address,
|
Address: s.Address,
|
||||||
AllowPrivileged: s.AllowPrivileged,
|
AllowPrivileged: s.AllowPrivileged,
|
||||||
HostNetworkSources: hostNetworkSources,
|
CadvisorInterface: nil, // launches background processes, not set here
|
||||||
HostnameOverride: s.HostnameOverride,
|
CgroupRoot: s.CgroupRoot,
|
||||||
RootDirectory: s.RootDirectory,
|
Cloud: nil, // cloud provider might start background processes
|
||||||
ConfigFile: s.Config,
|
ClusterDNS: s.ClusterDNS,
|
||||||
ManifestURL: s.ManifestURL,
|
ClusterDomain: s.ClusterDomain,
|
||||||
ManifestURLHeader: manifestURLHeader,
|
ConfigFile: s.Config,
|
||||||
FileCheckFrequency: s.FileCheckFrequency,
|
ConfigureCBR0: s.ConfigureCBR0,
|
||||||
HTTPCheckFrequency: s.HTTPCheckFrequency,
|
ContainerRuntime: s.ContainerRuntime,
|
||||||
PodInfraContainerImage: s.PodInfraContainerImage,
|
CPUCFSQuota: s.CPUCFSQuota,
|
||||||
SyncFrequency: s.SyncFrequency,
|
DiskSpacePolicy: diskSpacePolicy,
|
||||||
RegistryPullQPS: s.RegistryPullQPS,
|
DockerClient: dockertools.ConnectToDockerOrDie(s.DockerEndpoint),
|
||||||
RegistryBurst: s.RegistryBurst,
|
DockerDaemonContainer: s.DockerDaemonContainer,
|
||||||
EventRecordQPS: s.EventRecordQPS,
|
DockerExecHandler: dockerExecHandler,
|
||||||
EventBurst: s.EventBurst,
|
EnableDebuggingHandlers: s.EnableDebuggingHandlers,
|
||||||
MinimumGCAge: s.MinimumGCAge,
|
EnableServer: s.EnableServer,
|
||||||
MaxPerPodContainerCount: s.MaxPerPodContainerCount,
|
EventBurst: s.EventBurst,
|
||||||
MaxContainerCount: s.MaxContainerCount,
|
EventRecordQPS: s.EventRecordQPS,
|
||||||
RegisterNode: s.RegisterNode,
|
FileCheckFrequency: s.FileCheckFrequency,
|
||||||
StandaloneMode: (len(s.APIServerList) == 0),
|
HostnameOverride: s.HostnameOverride,
|
||||||
ClusterDomain: s.ClusterDomain,
|
HostNetworkSources: hostNetworkSources,
|
||||||
ClusterDNS: s.ClusterDNS,
|
HTTPCheckFrequency: s.HTTPCheckFrequency,
|
||||||
Runonce: s.RunOnce,
|
ImageGCPolicy: imageGCPolicy,
|
||||||
|
KubeClient: nil,
|
||||||
|
ManifestURL: s.ManifestURL,
|
||||||
|
ManifestURLHeader: manifestURLHeader,
|
||||||
|
MasterServiceNamespace: s.MasterServiceNamespace,
|
||||||
|
MaxContainerCount: s.MaxContainerCount,
|
||||||
|
MaxPerPodContainerCount: s.MaxPerPodContainerCount,
|
||||||
|
MaxPods: s.MaxPods,
|
||||||
|
MinimumGCAge: s.MinimumGCAge,
|
||||||
|
Mounter: mounter,
|
||||||
|
NetworkPluginName: s.NetworkPluginName,
|
||||||
|
NetworkPlugins: ProbeNetworkPlugins(s.NetworkPluginDir),
|
||||||
|
NodeStatusUpdateFrequency: s.NodeStatusUpdateFrequency,
|
||||||
|
OSInterface: kubecontainer.RealOS{},
|
||||||
|
PodCIDR: s.PodCIDR,
|
||||||
|
PodInfraContainerImage: s.PodInfraContainerImage,
|
||||||
Port: s.Port,
|
Port: s.Port,
|
||||||
ReadOnlyPort: s.ReadOnlyPort,
|
ReadOnlyPort: s.ReadOnlyPort,
|
||||||
CadvisorInterface: nil, // launches background processes, not set here
|
RegisterNode: s.RegisterNode,
|
||||||
EnableServer: s.EnableServer,
|
RegistryBurst: s.RegistryBurst,
|
||||||
EnableDebuggingHandlers: s.EnableDebuggingHandlers,
|
RegistryPullQPS: s.RegistryPullQPS,
|
||||||
DockerClient: dockertools.ConnectToDockerOrDie(s.DockerEndpoint),
|
ResolverConfig: s.ResolverConfig,
|
||||||
KubeClient: nil,
|
ResourceContainer: s.ResourceContainer,
|
||||||
MasterServiceNamespace: s.MasterServiceNamespace,
|
RktPath: s.RktPath,
|
||||||
VolumePlugins: ProbeVolumePlugins(),
|
RootDirectory: s.RootDirectory,
|
||||||
NetworkPlugins: ProbeNetworkPlugins(s.NetworkPluginDir),
|
Runonce: s.RunOnce,
|
||||||
NetworkPluginName: s.NetworkPluginName,
|
StandaloneMode: (len(s.APIServerList) == 0),
|
||||||
StreamingConnectionIdleTimeout: s.StreamingConnectionIdleTimeout,
|
StreamingConnectionIdleTimeout: s.StreamingConnectionIdleTimeout,
|
||||||
|
SyncFrequency: s.SyncFrequency,
|
||||||
|
SystemContainer: s.SystemContainer,
|
||||||
TLSOptions: tlsOptions,
|
TLSOptions: tlsOptions,
|
||||||
ImageGCPolicy: imageGCPolicy,
|
VolumePlugins: ProbeVolumePlugins(),
|
||||||
DiskSpacePolicy: diskSpacePolicy,
|
|
||||||
Cloud: nil, // cloud provider might start background processes
|
|
||||||
NodeStatusUpdateFrequency: s.NodeStatusUpdateFrequency,
|
|
||||||
ResourceContainer: s.ResourceContainer,
|
|
||||||
CgroupRoot: s.CgroupRoot,
|
|
||||||
ContainerRuntime: s.ContainerRuntime,
|
|
||||||
RktPath: s.RktPath,
|
|
||||||
Mounter: mounter,
|
|
||||||
DockerDaemonContainer: s.DockerDaemonContainer,
|
|
||||||
SystemContainer: s.SystemContainer,
|
|
||||||
ConfigureCBR0: s.ConfigureCBR0,
|
|
||||||
PodCIDR: s.PodCIDR,
|
|
||||||
MaxPods: s.MaxPods,
|
|
||||||
DockerExecHandler: dockerExecHandler,
|
|
||||||
ResolverConfig: s.ResolverConfig,
|
|
||||||
CPUCFSQuota: s.CPUCFSQuota,
|
|
||||||
OSInterface: kubecontainer.RealOS{},
|
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -580,44 +580,44 @@ func SimpleKubelet(client *client.Client,
|
||||||
RootFreeDiskMB: 256,
|
RootFreeDiskMB: 256,
|
||||||
}
|
}
|
||||||
kcfg := KubeletConfig{
|
kcfg := KubeletConfig{
|
||||||
KubeClient: client,
|
Address: net.ParseIP(address),
|
||||||
DockerClient: dockerClient,
|
CadvisorInterface: cadvisorInterface,
|
||||||
HostnameOverride: hostname,
|
|
||||||
RootDirectory: rootDir,
|
|
||||||
ManifestURL: manifestURL,
|
|
||||||
PodInfraContainerImage: dockertools.PodInfraContainerImage,
|
|
||||||
Port: port,
|
|
||||||
ReadOnlyPort: readOnlyPort,
|
|
||||||
Address: net.ParseIP(address),
|
|
||||||
EnableServer: true,
|
|
||||||
EnableDebuggingHandlers: true,
|
|
||||||
HTTPCheckFrequency: httpCheckFrequency,
|
|
||||||
FileCheckFrequency: fileCheckFrequency,
|
|
||||||
SyncFrequency: syncFrequency,
|
|
||||||
MinimumGCAge: minimumGCAge,
|
|
||||||
MaxPerPodContainerCount: 2,
|
|
||||||
MaxContainerCount: 100,
|
|
||||||
RegisterNode: true,
|
|
||||||
MasterServiceNamespace: masterServiceNamespace,
|
|
||||||
VolumePlugins: volumePlugins,
|
|
||||||
TLSOptions: tlsOptions,
|
|
||||||
CadvisorInterface: cadvisorInterface,
|
|
||||||
ConfigFile: configFilePath,
|
|
||||||
ImageGCPolicy: imageGCPolicy,
|
|
||||||
DiskSpacePolicy: diskSpacePolicy,
|
|
||||||
Cloud: cloud,
|
|
||||||
NodeStatusUpdateFrequency: nodeStatusUpdateFrequency,
|
|
||||||
ResourceContainer: "/kubelet",
|
|
||||||
OSInterface: osInterface,
|
|
||||||
CgroupRoot: "",
|
CgroupRoot: "",
|
||||||
|
Cloud: cloud,
|
||||||
|
ConfigFile: configFilePath,
|
||||||
ContainerRuntime: "docker",
|
ContainerRuntime: "docker",
|
||||||
Mounter: mount.New(),
|
|
||||||
DockerDaemonContainer: "/docker-daemon",
|
|
||||||
SystemContainer: "",
|
|
||||||
MaxPods: 32,
|
|
||||||
DockerExecHandler: &dockertools.NativeExecHandler{},
|
|
||||||
ResolverConfig: kubelet.ResolvConfDefault,
|
|
||||||
CPUCFSQuota: false,
|
CPUCFSQuota: false,
|
||||||
|
DiskSpacePolicy: diskSpacePolicy,
|
||||||
|
DockerClient: dockerClient,
|
||||||
|
DockerDaemonContainer: "/docker-daemon",
|
||||||
|
DockerExecHandler: &dockertools.NativeExecHandler{},
|
||||||
|
EnableDebuggingHandlers: true,
|
||||||
|
EnableServer: true,
|
||||||
|
FileCheckFrequency: fileCheckFrequency,
|
||||||
|
HostnameOverride: hostname,
|
||||||
|
HTTPCheckFrequency: httpCheckFrequency,
|
||||||
|
ImageGCPolicy: imageGCPolicy,
|
||||||
|
KubeClient: client,
|
||||||
|
ManifestURL: manifestURL,
|
||||||
|
MasterServiceNamespace: masterServiceNamespace,
|
||||||
|
MaxContainerCount: 100,
|
||||||
|
MaxPerPodContainerCount: 2,
|
||||||
|
MaxPods: 32,
|
||||||
|
MinimumGCAge: minimumGCAge,
|
||||||
|
Mounter: mount.New(),
|
||||||
|
NodeStatusUpdateFrequency: nodeStatusUpdateFrequency,
|
||||||
|
OSInterface: osInterface,
|
||||||
|
PodInfraContainerImage: dockertools.PodInfraContainerImage,
|
||||||
|
Port: port,
|
||||||
|
ReadOnlyPort: readOnlyPort,
|
||||||
|
RegisterNode: true,
|
||||||
|
ResolverConfig: kubelet.ResolvConfDefault,
|
||||||
|
ResourceContainer: "/kubelet",
|
||||||
|
RootDirectory: rootDir,
|
||||||
|
SyncFrequency: syncFrequency,
|
||||||
|
SystemContainer: "",
|
||||||
|
TLSOptions: tlsOptions,
|
||||||
|
VolumePlugins: volumePlugins,
|
||||||
}
|
}
|
||||||
return &kcfg
|
return &kcfg
|
||||||
}
|
}
|
||||||
|
@ -739,64 +739,64 @@ func makePodSourceConfig(kc *KubeletConfig) *config.PodConfig {
|
||||||
// KubeletConfig is all of the parameters necessary for running a kubelet.
|
// KubeletConfig is all of the parameters necessary for running a kubelet.
|
||||||
// TODO: This should probably be merged with KubeletServer. The extra object is a consequence of refactoring.
|
// TODO: This should probably be merged with KubeletServer. The extra object is a consequence of refactoring.
|
||||||
type KubeletConfig struct {
|
type KubeletConfig struct {
|
||||||
KubeClient *client.Client
|
|
||||||
DockerClient dockertools.DockerInterface
|
|
||||||
CadvisorInterface cadvisor.Interface
|
|
||||||
Address net.IP
|
Address net.IP
|
||||||
AllowPrivileged bool
|
AllowPrivileged bool
|
||||||
HostNetworkSources []string
|
CadvisorInterface cadvisor.Interface
|
||||||
HostnameOverride string
|
CgroupRoot string
|
||||||
RootDirectory string
|
Cloud cloudprovider.Interface
|
||||||
|
ClusterDNS net.IP
|
||||||
|
ClusterDomain string
|
||||||
ConfigFile string
|
ConfigFile string
|
||||||
|
ConfigureCBR0 bool
|
||||||
|
ContainerRuntime string
|
||||||
|
CPUCFSQuota bool
|
||||||
|
DiskSpacePolicy kubelet.DiskSpacePolicy
|
||||||
|
DockerClient dockertools.DockerInterface
|
||||||
|
DockerDaemonContainer string
|
||||||
|
DockerExecHandler dockertools.ExecHandler
|
||||||
|
EnableDebuggingHandlers bool
|
||||||
|
EnableServer bool
|
||||||
|
EventBurst int
|
||||||
|
EventRecordQPS float32
|
||||||
|
FileCheckFrequency time.Duration
|
||||||
|
Hostname string
|
||||||
|
HostnameOverride string
|
||||||
|
HostNetworkSources []string
|
||||||
|
HTTPCheckFrequency time.Duration
|
||||||
|
ImageGCPolicy kubelet.ImageGCPolicy
|
||||||
|
KubeClient *client.Client
|
||||||
ManifestURL string
|
ManifestURL string
|
||||||
ManifestURLHeader http.Header
|
ManifestURLHeader http.Header
|
||||||
FileCheckFrequency time.Duration
|
MasterServiceNamespace string
|
||||||
HTTPCheckFrequency time.Duration
|
|
||||||
Hostname string
|
|
||||||
NodeName string
|
|
||||||
PodInfraContainerImage string
|
|
||||||
SyncFrequency time.Duration
|
|
||||||
RegistryPullQPS float64
|
|
||||||
RegistryBurst int
|
|
||||||
EventRecordQPS float32
|
|
||||||
EventBurst int
|
|
||||||
MinimumGCAge time.Duration
|
|
||||||
MaxPerPodContainerCount int
|
|
||||||
MaxContainerCount int
|
MaxContainerCount int
|
||||||
RegisterNode bool
|
MaxPerPodContainerCount int
|
||||||
StandaloneMode bool
|
MaxPods int
|
||||||
ClusterDomain string
|
MinimumGCAge time.Duration
|
||||||
ClusterDNS net.IP
|
Mounter mount.Interface
|
||||||
EnableServer bool
|
NetworkPluginName string
|
||||||
EnableDebuggingHandlers bool
|
NetworkPlugins []network.NetworkPlugin
|
||||||
|
NodeName string
|
||||||
|
NodeStatusUpdateFrequency time.Duration
|
||||||
|
OSInterface kubecontainer.OSInterface
|
||||||
|
PodCIDR string
|
||||||
|
PodInfraContainerImage string
|
||||||
Port uint
|
Port uint
|
||||||
ReadOnlyPort uint
|
ReadOnlyPort uint
|
||||||
Runonce bool
|
|
||||||
MasterServiceNamespace string
|
|
||||||
VolumePlugins []volume.VolumePlugin
|
|
||||||
NetworkPlugins []network.NetworkPlugin
|
|
||||||
NetworkPluginName string
|
|
||||||
StreamingConnectionIdleTimeout time.Duration
|
|
||||||
Recorder record.EventRecorder
|
Recorder record.EventRecorder
|
||||||
TLSOptions *kubelet.TLSOptions
|
RegisterNode bool
|
||||||
ImageGCPolicy kubelet.ImageGCPolicy
|
RegistryBurst int
|
||||||
DiskSpacePolicy kubelet.DiskSpacePolicy
|
RegistryPullQPS float64
|
||||||
Cloud cloudprovider.Interface
|
|
||||||
NodeStatusUpdateFrequency time.Duration
|
|
||||||
ResourceContainer string
|
|
||||||
OSInterface kubecontainer.OSInterface
|
|
||||||
CgroupRoot string
|
|
||||||
ContainerRuntime string
|
|
||||||
RktPath string
|
|
||||||
Mounter mount.Interface
|
|
||||||
DockerDaemonContainer string
|
|
||||||
SystemContainer string
|
|
||||||
ConfigureCBR0 bool
|
|
||||||
PodCIDR string
|
|
||||||
MaxPods int
|
|
||||||
DockerExecHandler dockertools.ExecHandler
|
|
||||||
ResolverConfig string
|
ResolverConfig string
|
||||||
CPUCFSQuota bool
|
ResourceContainer string
|
||||||
|
RktPath string
|
||||||
|
RootDirectory string
|
||||||
|
Runonce bool
|
||||||
|
StandaloneMode bool
|
||||||
|
StreamingConnectionIdleTimeout time.Duration
|
||||||
|
SyncFrequency time.Duration
|
||||||
|
SystemContainer string
|
||||||
|
TLSOptions *kubelet.TLSOptions
|
||||||
|
VolumePlugins []volume.VolumePlugin
|
||||||
}
|
}
|
||||||
|
|
||||||
func createAndInitKubelet(kc *KubeletConfig) (k KubeletBootstrap, pc *config.PodConfig, err error) {
|
func createAndInitKubelet(kc *KubeletConfig) (k KubeletBootstrap, pc *config.PodConfig, err error) {
|
||||||
|
|
Loading…
Reference in New Issue