kubernetes-sigs / cluster-capacity

Cluster capacity analysis
Apache License 2.0
442 stars 103 forks source link

Rebase to kubernetes-1.13 #109

Closed ringtail closed 4 years ago

ringtail commented 4 years ago

rebase code base to release-1.13.5

k8s-ci-robot commented 4 years ago

Welcome @ringtail!

It looks like this is your first PR to kubernetes-incubator/cluster-capacity 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-incubator/cluster-capacity has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

ringtail commented 4 years ago

Hold on. I have shielded some tests. And I need to recover them first.

ringtail commented 4 years ago

/assign @ingvagabund

ringtail commented 4 years ago

pass tests

➜  cluster-capacity git:(rebase-release-1.13) ✗ go test -v ./...
?       github.com/kubernetes-incubator/cluster-capacity/cmd/cluster-capacity   [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/cmd/cluster-capacity/app   [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/cmd/cluster-capacity/app/options   [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/cmd/genpod [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/cmd/genpod/app [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/cmd/genpod/app/options [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/cmd/hypercc    [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/pkg/api    [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/pkg/client [no test files]
=== RUN   TestPrediction
W1106 17:24:53.822968   84178 authentication.go:249] No authentication-kubeconfig provided in order to lookup client-ca-file in configmap/extension-apiserver-authentication in kube-system, so client certificate authentication won't work.
W1106 17:24:53.823085   84178 authentication.go:252] No authentication-kubeconfig provided in order to lookup requestheader-client-ca-file in configmap/extension-apiserver-authentication in kube-system, so request-header client certificate authentication won't work.
W1106 17:24:53.823108   84178 authorization.go:146] No authorization-kubeconfig provided, so SubjectAccessReview of authorization tokens won't work.
--- PASS: TestPrediction (1.01s)
    simulator_test.go:233: Reason: 0, instances: &{test-node-3 3}
    simulator_test.go:233: Reason: 1, instances: &{test-node-2 2}
    simulator_test.go:233: Reason: 2, instances: &{test-node-1 1}
    simulator_test.go:236: Stop reason: &{LimitReached Maximum number of pods simulated: 6}
PASS
ok      github.com/kubernetes-incubator/cluster-capacity/pkg/framework  1.068s
?       github.com/kubernetes-incubator/cluster-capacity/pkg/framework/record   [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/pkg/framework/restclient/external  [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/pkg/framework/store    [no test files]
=== RUN   TestAddPodStrategy
--- PASS: TestAddPodStrategy (0.00s)
PASS
ok      github.com/kubernetes-incubator/cluster-capacity/pkg/framework/strategy 0.025s
?       github.com/kubernetes-incubator/cluster-capacity/pkg/framework/watch    [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/pkg/test   [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/pkg/utils  [no test files]
?       github.com/kubernetes-incubator/cluster-capacity/verify/boilerplate/test    [no test files]

simulate scheduling.

➜  cluster-capacity git:(rebase-release-1.13) ✗ ./cluster-capacity --kubeconfig ~/.kube/config --podspec ../../examples/pod.yaml
I1106 17:23:40.797690   84018 defaults.go:210] TaintNodesByCondition is enabled, PodToleratesNodeTaints predicate is mandatory
41

simulate scheduling in verbose mode

➜  cluster-capacity git:(rebase-release-1.13) ✗ ./cluster-capacity --kubeconfig ~/.kube/config --podspec ../../examples/pod.yaml --verbose
I1106 17:23:53.790463   84036 defaults.go:210] TaintNodesByCondition is enabled, PodToleratesNodeTaints predicate is mandatory
small-pod pod requirements:
    - CPU: 150m
    - Memory: 100Mi

The cluster can schedule 41 instance(s) of the pod small-pod.

Termination reason: Unschedulable: 0/7 nodes are available: 2 Insufficient cpu, 5 node(s) had taints that the pod didn't tolerate.

Pod distribution among nodes:
small-pod
    - cn-beijing.192.168.3.251: 22 instance(s)
    - cn-beijing.192.168.3.250: 19 instance(s)
ingvagabund commented 4 years ago
$ minikube version
minikube version: v1.1.0
$ sudo kubectl version
...
Server Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.5", GitCommit:"2166946f41b36dea2c4626f90a77706f426cdea2", GitTreeState:"clean", BuildDate:"2019-03-25T15:19:22Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
$ ./cluster-capacity --kubeconfig ~/.kube/config --podspec examples/pod.yaml --verbose
I1113 13:05:17.997183   22250 defaults.go:210] TaintNodesByCondition is enabled, PodToleratesNodeTaints predicate is mandatory
small-pod pod requirements:
    - CPU: 150m
    - Memory: 100Mi

The cluster can schedule 8 instance(s) of the pod small-pod.

Termination reason: Unschedulable: 0/1 nodes are available: 1 Insufficient cpu.

Pod distribution among nodes:
small-pod
    - minikube: 8 instance(s)
ingvagabund commented 4 years ago

/approve

k8s-ci-robot commented 4 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ingvagabund

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-incubator/cluster-capacity/blob/master/OWNERS)~~ [ingvagabund] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
ingvagabund commented 4 years ago

/lgtm