mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #47876 from mwielgus/remove-initial-resources-e2e
Automatic merge from submit-queue Remove initial resources e2e This is just a cleanup PR. We won't continue initial resources effort. It is dropped in favor of VPA developed in kubernetes/autoscaler. cc: @piosz @jszczepkowski @kgrygiel
This commit is contained in:
commit
c3dd67dc21
@ -74,7 +74,6 @@ go_library(
|
|||||||
"gke_node_pools.go",
|
"gke_node_pools.go",
|
||||||
"ha_master.go",
|
"ha_master.go",
|
||||||
"ingress.go",
|
"ingress.go",
|
||||||
"initial_resources.go",
|
|
||||||
"job.go",
|
"job.go",
|
||||||
"kibana_logging.go",
|
"kibana_logging.go",
|
||||||
"kube_proxy.go",
|
"kube_proxy.go",
|
||||||
|
@ -1,74 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2015 The Kubernetes Authors.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package e2e
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo"
|
|
||||||
. "github.com/onsi/gomega"
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
|
||||||
"k8s.io/kubernetes/test/e2e/common"
|
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
|
||||||
)
|
|
||||||
|
|
||||||
// [Feature:InitialResources]: Initial resources is an experimental feature, so
|
|
||||||
// these tests are not run by default.
|
|
||||||
//
|
|
||||||
// Flaky issue #20272
|
|
||||||
var _ = framework.KubeDescribe("Initial Resources [Feature:InitialResources] [Flaky]", func() {
|
|
||||||
f := framework.NewDefaultFramework("initial-resources")
|
|
||||||
|
|
||||||
It("should set initial resources based on historical data", func() {
|
|
||||||
// TODO(piosz): Add cleanup data in InfluxDB that left from previous tests.
|
|
||||||
cpu := 100
|
|
||||||
mem := 200
|
|
||||||
for i := 0; i < 10; i++ {
|
|
||||||
rc := common.NewStaticResourceConsumer(fmt.Sprintf("ir-%d", i), 1, cpu, mem, 0, int64(2*cpu), int64(2*mem), f)
|
|
||||||
defer rc.CleanUp()
|
|
||||||
}
|
|
||||||
// Wait some time to make sure usage data is gathered.
|
|
||||||
time.Sleep(10 * time.Minute)
|
|
||||||
|
|
||||||
pod := runPod(f, "ir-test", common.GetResourceConsumerImage())
|
|
||||||
r := pod.Spec.Containers[0].Resources.Requests
|
|
||||||
Expect(r.Cpu().MilliValue()).Should(BeNumerically("~", cpu, 10))
|
|
||||||
Expect(r.Memory().Value()).Should(BeNumerically("~", mem*1024*1024, 20*1024*1024))
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
func runPod(f *framework.Framework, name, image string) *v1.Pod {
|
|
||||||
pod := &v1.Pod{
|
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
|
||||||
Name: name,
|
|
||||||
},
|
|
||||||
Spec: v1.PodSpec{
|
|
||||||
Containers: []v1.Container{
|
|
||||||
{
|
|
||||||
Name: name,
|
|
||||||
Image: image,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
createdPod, err := f.ClientSet.Core().Pods(f.Namespace.Name).Create(pod)
|
|
||||||
framework.ExpectNoError(err)
|
|
||||||
framework.ExpectNoError(framework.WaitForPodRunningInNamespace(f.ClientSet, createdPod))
|
|
||||||
return createdPod
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user