diff options
| author | Baoqiang-Zhang <zhangbaoqiang.zhang@huawei.com> | 2019-08-20 15:27:42 +0800 |
|---|---|---|
| committer | Baoqiang-Zhang <zhangbaoqiang.zhang@huawei.com> | 2019-08-22 10:20:51 +0800 |
| commit | c37089caed993246b3fda7556172b26a2167ed26 (patch) | |
| tree | 2a576017b044c3174e15f982eeef03e7ee1de892 | |
| parent | fix edgecore panic error (diff) | |
| download | kubeedge-c37089caed993246b3fda7556172b26a2167ed26.tar.gz | |
add image pull progress deadline param
| -rw-r--r-- | edge/conf/edge.yaml | 1 | ||||
| -rw-r--r-- | edge/pkg/edged/edged.go | 56 | ||||
| -rw-r--r-- | edgesite/conf/edgeSite.yaml | 1 |
3 files changed, 34 insertions, 24 deletions
diff --git a/edge/conf/edge.yaml b/edge/conf/edge.yaml index 633ad0e6e..75ab44c7b 100644 --- a/edge/conf/edge.yaml +++ b/edge/conf/edge.yaml @@ -46,6 +46,7 @@ edged: remote-image-endpoint: unix:///var/run/dockershim.sock runtime-request-timeout: 2 podsandbox-image: k8s.gcr.io/pause + image-pull-progress-deadline: 60 # second cgroup-driver: cgroupfs node-ip: "" cluster-dns: "" diff --git a/edge/pkg/edged/edged.go b/edge/pkg/edged/edged.go index bdf22861c..73fa5df3b 100644 --- a/edge/pkg/edged/edged.go +++ b/edge/pkg/edged/edged.go @@ -157,6 +157,8 @@ const ( redirectContainerStream = false // ResolvConfDefault gives the default dns resolv configration file ResolvConfDefault = "/etc/resolv.conf" + // ImagePullProgressDeadlineDefault gives the default image pull progress deadline + ImagePullProgressDeadlineDefault = 60 ) var ( @@ -233,27 +235,28 @@ type edged struct { //Config defines configuration details type Config struct { - nodeName string - nodeNamespace string - interfaceName string - memoryCapacity int - nodeStatusUpdateInterval time.Duration - devicePluginEnabled bool - gpuPluginEnabled bool - imageGCHighThreshold int - imageGCLowThreshold int - MaxPerPodContainerCount int - DockerAddress string - version string - runtimeType string - remoteRuntimeEndpoint string - remoteImageEndpoint string - RuntimeRequestTimeout metav1.Duration - PodSandboxImage string - cgroupDriver string - nodeIP string - clusterDNS string - clusterDomain string + nodeName string + nodeNamespace string + interfaceName string + memoryCapacity int + nodeStatusUpdateInterval time.Duration + devicePluginEnabled bool + gpuPluginEnabled bool + imageGCHighThreshold int + imageGCLowThreshold int + imagePullProgressDeadline int + MaxPerPodContainerCount int + DockerAddress string + version string + runtimeType string + remoteRuntimeEndpoint string + remoteImageEndpoint string + RuntimeRequestTimeout metav1.Duration + PodSandboxImage string + cgroupDriver string + nodeIP string + clusterDNS string + clusterDomain string } func init() { @@ -401,6 +404,10 @@ func getConfig() *Config { if conf.PodSandboxImage == "" { conf.PodSandboxImage = PodSandboxImage } + conf.imagePullProgressDeadline = config.CONFIG.GetConfigurationByKey("edged.image-pull-progress-deadline").(int) + if conf.imagePullProgressDeadline == 0 { + conf.imagePullProgressDeadline = ImagePullProgressDeadlineDefault + } return &conf } @@ -490,9 +497,10 @@ func newEdged() (*edged, error) { if conf.remoteRuntimeEndpoint == DockerShimEndpoint || conf.remoteRuntimeEndpoint == DockerShimEndpointDeprecated { streamingConfig := &streaming.Config{} DockerClientConfig := &dockershim.ClientConfig{ - DockerEndpoint: conf.DockerAddress, - EnableSleep: true, - WithTraceDisabled: true, + DockerEndpoint: conf.DockerAddress, + ImagePullProgressDeadline: time.Duration(conf.imagePullProgressDeadline) * time.Second, + EnableSleep: true, + WithTraceDisabled: true, } pluginConfigs := dockershim.NetworkPluginSettings{ diff --git a/edgesite/conf/edgeSite.yaml b/edgesite/conf/edgeSite.yaml index 8bbad3532..9b7f69f52 100644 --- a/edgesite/conf/edgeSite.yaml +++ b/edgesite/conf/edgeSite.yaml @@ -38,6 +38,7 @@ edged: remote-image-endpoint: unix:///var/run/dockershim.sock runtime-request-timeout: 2 podsandbox-image: k8s.gcr.io/pause + image-pull-progress-deadline: 60 # second cgroup-driver: cgroupfs node-ip: "" cluster-dns: "" |
