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)
|
||||
glog.Infof("Using %s as root dir for kubelet #1", testRootDir)
|
||||
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)
|
||||
// Kubelet (machine)
|
||||
// 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.", "")
|
||||
glog.Infof("Using %s as root dir for kubelet #2", testRootDir)
|
||||
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)
|
||||
return apiServer.URL, configFilePath
|
||||
}
|
||||
|
@@ -371,6 +371,7 @@ func (s *KubeletServer) KubeletConfig() (*KubeletConfig, error) {
|
||||
DockerExecHandler: dockerExecHandler,
|
||||
ResolverConfig: s.ResolverConfig,
|
||||
CPUCFSQuota: s.CPUCFSQuota,
|
||||
OSInterface: kubecontainer.RealOS{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -560,13 +561,15 @@ func SimpleKubelet(client *client.Client,
|
||||
dockerClient dockertools.DockerInterface,
|
||||
hostname, rootDir, manifestURL, address string,
|
||||
port uint,
|
||||
readOnlyPort uint,
|
||||
masterServiceNamespace string,
|
||||
volumePlugins []volume.VolumePlugin,
|
||||
tlsOptions *kubelet.TLSOptions,
|
||||
cadvisorInterface cadvisor.Interface,
|
||||
configFilePath string,
|
||||
cloud cloudprovider.Interface,
|
||||
osInterface kubecontainer.OSInterface) *KubeletConfig {
|
||||
osInterface kubecontainer.OSInterface,
|
||||
fileCheckFrequency, httpCheckFrequency, minimumGCAge, nodeStatusUpdateFrequency, syncFrequency time.Duration) *KubeletConfig {
|
||||
|
||||
imageGCPolicy := kubelet.ImageGCPolicy{
|
||||
HighThresholdPercent: 90,
|
||||
@@ -584,13 +587,14 @@ func SimpleKubelet(client *client.Client,
|
||||
ManifestURL: manifestURL,
|
||||
PodInfraContainerImage: dockertools.PodInfraContainerImage,
|
||||
Port: port,
|
||||
ReadOnlyPort: readOnlyPort,
|
||||
Address: net.ParseIP(address),
|
||||
EnableServer: true,
|
||||
EnableDebuggingHandlers: true,
|
||||
HTTPCheckFrequency: 1 * time.Second,
|
||||
FileCheckFrequency: 1 * time.Second,
|
||||
SyncFrequency: 3 * time.Second,
|
||||
MinimumGCAge: 10 * time.Second,
|
||||
HTTPCheckFrequency: httpCheckFrequency,
|
||||
FileCheckFrequency: fileCheckFrequency,
|
||||
SyncFrequency: syncFrequency,
|
||||
MinimumGCAge: minimumGCAge,
|
||||
MaxPerPodContainerCount: 2,
|
||||
MaxContainerCount: 100,
|
||||
RegisterNode: true,
|
||||
@@ -602,7 +606,7 @@ func SimpleKubelet(client *client.Client,
|
||||
ImageGCPolicy: imageGCPolicy,
|
||||
DiskSpacePolicy: diskSpacePolicy,
|
||||
Cloud: cloud,
|
||||
NodeStatusUpdateFrequency: 10 * time.Second,
|
||||
NodeStatusUpdateFrequency: nodeStatusUpdateFrequency,
|
||||
ResourceContainer: "/kubelet",
|
||||
OSInterface: osInterface,
|
||||
CgroupRoot: "",
|
||||
|
Reference in New Issue
Block a user