Merge pull request #670 from GLYASAI/V5.2

adapted to kubelet 1.16
This commit is contained in:
barnettZQG 2020-02-13 22:28:56 +08:00 committed by GitHub
commit 475d4bdc3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1762,7 +1762,7 @@ func (s *ServiceAction) GetPodContainerMemory(podNames []string) (map[string]map
memoryUsageMap := make(map[string]map[string]string, 10)
proxy := GetPrometheusProxy()
queryName := strings.Join(podNames, "|")
query := fmt.Sprintf(`container_memory_rss{pod_name=~"%s"}`, queryName)
query := fmt.Sprintf(`container_memory_rss{pod=~"%s"}`, queryName)
proQuery := strings.Replace(query, " ", "%20", -1)
req, err := http.NewRequest("GET", fmt.Sprintf("http://127.0.0.1:9999/api/v1/query?query=%s", proQuery), nil)
if err != nil {