Add additional knobs to SimpleKubelet
This commit is contained in:
@@ -204,7 +204,11 @@ 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, api.NamespaceDefault, empty_dir.ProbeVolumePlugins(), nil, cadvisorInterface, configFilePath, nil, kubecontainer.FakeOS{})
|
kcfg := kubeletapp.SimpleKubelet(cl, &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 */)
|
||||||
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
|
||||||
@@ -212,7 +216,11 @@ 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, api.NamespaceDefault, empty_dir.ProbeVolumePlugins(), nil, cadvisorInterface, "", nil, kubecontainer.FakeOS{})
|
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,
|
||||||
|
cadvisorInterface, "", nil, kubecontainer.FakeOS{}, 1*time.Second, /* FileCheckFrequency */
|
||||||
|
1*time.Second /* HTTPCheckFrequency */, 10*time.Second /* MinimumGCAge */, 3*time.Second, /* NodeStatusUpdateFrequency */
|
||||||
|
10*time.Second /* SyncFrequency */)
|
||||||
kubeletapp.RunKubelet(kcfg, nil)
|
kubeletapp.RunKubelet(kcfg, nil)
|
||||||
return apiServer.URL, configFilePath
|
return apiServer.URL, configFilePath
|
||||||
}
|
}
|
||||||
|
@@ -371,6 +371,7 @@ func (s *KubeletServer) KubeletConfig() (*KubeletConfig, error) {
|
|||||||
DockerExecHandler: dockerExecHandler,
|
DockerExecHandler: dockerExecHandler,
|
||||||
ResolverConfig: s.ResolverConfig,
|
ResolverConfig: s.ResolverConfig,
|
||||||
CPUCFSQuota: s.CPUCFSQuota,
|
CPUCFSQuota: s.CPUCFSQuota,
|
||||||
|
OSInterface: kubecontainer.RealOS{},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -560,13 +561,15 @@ func SimpleKubelet(client *client.Client,
|
|||||||
dockerClient dockertools.DockerInterface,
|
dockerClient dockertools.DockerInterface,
|
||||||
hostname, rootDir, manifestURL, address string,
|
hostname, rootDir, manifestURL, address string,
|
||||||
port uint,
|
port uint,
|
||||||
|
readOnlyPort uint,
|
||||||
masterServiceNamespace string,
|
masterServiceNamespace string,
|
||||||
volumePlugins []volume.VolumePlugin,
|
volumePlugins []volume.VolumePlugin,
|
||||||
tlsOptions *kubelet.TLSOptions,
|
tlsOptions *kubelet.TLSOptions,
|
||||||
cadvisorInterface cadvisor.Interface,
|
cadvisorInterface cadvisor.Interface,
|
||||||
configFilePath string,
|
configFilePath string,
|
||||||
cloud cloudprovider.Interface,
|
cloud cloudprovider.Interface,
|
||||||
osInterface kubecontainer.OSInterface) *KubeletConfig {
|
osInterface kubecontainer.OSInterface,
|
||||||
|
fileCheckFrequency, httpCheckFrequency, minimumGCAge, nodeStatusUpdateFrequency, syncFrequency time.Duration) *KubeletConfig {
|
||||||
|
|
||||||
imageGCPolicy := kubelet.ImageGCPolicy{
|
imageGCPolicy := kubelet.ImageGCPolicy{
|
||||||
HighThresholdPercent: 90,
|
HighThresholdPercent: 90,
|
||||||
@@ -584,13 +587,14 @@ func SimpleKubelet(client *client.Client,
|
|||||||
ManifestURL: manifestURL,
|
ManifestURL: manifestURL,
|
||||||
PodInfraContainerImage: dockertools.PodInfraContainerImage,
|
PodInfraContainerImage: dockertools.PodInfraContainerImage,
|
||||||
Port: port,
|
Port: port,
|
||||||
|
ReadOnlyPort: readOnlyPort,
|
||||||
Address: net.ParseIP(address),
|
Address: net.ParseIP(address),
|
||||||
EnableServer: true,
|
EnableServer: true,
|
||||||
EnableDebuggingHandlers: true,
|
EnableDebuggingHandlers: true,
|
||||||
HTTPCheckFrequency: 1 * time.Second,
|
HTTPCheckFrequency: httpCheckFrequency,
|
||||||
FileCheckFrequency: 1 * time.Second,
|
FileCheckFrequency: fileCheckFrequency,
|
||||||
SyncFrequency: 3 * time.Second,
|
SyncFrequency: syncFrequency,
|
||||||
MinimumGCAge: 10 * time.Second,
|
MinimumGCAge: minimumGCAge,
|
||||||
MaxPerPodContainerCount: 2,
|
MaxPerPodContainerCount: 2,
|
||||||
MaxContainerCount: 100,
|
MaxContainerCount: 100,
|
||||||
RegisterNode: true,
|
RegisterNode: true,
|
||||||
@@ -602,7 +606,7 @@ func SimpleKubelet(client *client.Client,
|
|||||||
ImageGCPolicy: imageGCPolicy,
|
ImageGCPolicy: imageGCPolicy,
|
||||||
DiskSpacePolicy: diskSpacePolicy,
|
DiskSpacePolicy: diskSpacePolicy,
|
||||||
Cloud: cloud,
|
Cloud: cloud,
|
||||||
NodeStatusUpdateFrequency: 10 * time.Second,
|
NodeStatusUpdateFrequency: nodeStatusUpdateFrequency,
|
||||||
ResourceContainer: "/kubelet",
|
ResourceContainer: "/kubelet",
|
||||||
OSInterface: osInterface,
|
OSInterface: osInterface,
|
||||||
CgroupRoot: "",
|
CgroupRoot: "",
|
||||||
|
Reference in New Issue
Block a user