kubernetes-sigs / cluster-capacity

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

Feature additions #139

Open limscoder opened 3 years ago

limscoder commented 3 years ago

Hi, I made 3 feature additions in a fork and was wondering if you'd consider accepting PRs for any of them described below.

  1. Replaced --podspec with --replicaset

https://github.com/limscoder/cluster-capacity/commit/6302eb1a754b4ca1eda9a0b888d50af28e139b50

This commit replaces podspec config with replicaset config. This enables multiple podspecs to be defined with the desired number of replicas for each.

example:

./cluster-capacity --kubeconfig ${KUBECONFIG} --replicaset ./examples/smallpod-replicaset.yaml --replicaset ./examples/largepod-replicaset.yaml --verbose

output:

Pod distribution among nodes:
small-pod
        - node.1: 1 instance(s)
        - node.2: 1 instance(s)
        - node.3: 1 instance(s)
large-pod
        - node.4: 2 instance(s)
        - node.2: 1 instance(s)

Set Replicas: 0 to maintain current behavior of scheduling until node resources are exhausted.

example:

 ./cluster-capacity --kubeconfig ${KUBECONFIG} --replicaset ./examples/unbounded-replicaset.yaml --verbose

output:

The cluster can schedule 742 instance(s) of the pod unbounded-pod.

Termination reason: Unschedulable: 0/35 nodes are available: ...

Pod distribution among nodes:
unbounded-pod
...
  1. Add estimated cluster capacity to verbose output.

https://github.com/limscoder/cluster-capacity/commit/6bc3cdf01efde94b6fdee0e430033cb812f1cdee

Calculates estimated cluster and node capacities after requested replicasets have been scheduled.

output:

node.1
        - pod count: 58
        - CPU requested: 15775m/15900m 99.21% allocated
        - CPU limited: 49450m/15900m 311.01% allocated
        - Memory requested: 25243794432bytes/126191124480bytes 20.00% allocated
        - Memory limited: 124531248384bytes/126191124480bytes 98.68% allocated
        - EphemeralStorage requested: 48066723840bytes/240575057113bytes 19.98% allocated
        - EphemeralStorage limited: 128849018880bytes/240575057113bytes 53.56% allocated

Cluster capacity:
        - CPU requested: 506500m/532200m 95.17% allocated
        - CPU limited: 1576200m/532200m 296.17% allocated
        - Memory requested: 949234361344bytes/4136864407552bytes 22.95% allocated
        - Memory limited: 3771463961344bytes/4136864407552bytes 91.17% allocated
        - EphemeralStorage requested: 2195500040192bytes/8420126998955bytes 26.07% allocated
        - EphemeralStorage limited: 5425617436672bytes/8420126998955bytes 64.44% allocated
  1. Add ability to simulate a larger cluster

https://github.com/limscoder/cluster-capacity/commit/21593efa0bd00e84708a573ad16155dcba7e50d7

This commit allows a source node to be virtually replicated.

example adding 10 replicas of node.1 to the scheduler cache:

 ./cluster-capacity --kubeconfig ${KUBECONFIG} --replicaset ./examples/smallpod-replicaset.yaml --simulatenode node.1:10 --verbose

output:

node.1.simulated.1
        - pod count: 1
        - CPU requested: 150m/15900m 0.94% allocated
        - CPU limited: 300m/15900m 1.89% allocated
        - Memory requested: 104857600bytes/126191124480bytes 0.08% allocated
        - Memory limited: 209715200bytes/126191124480bytes 0.17% allocated
        - EphemeralStorage requested: 0bytes/240575057113bytes 0.00% allocated
        - EphemeralStorage limited: 0bytes/240575057113bytes 0.00% allocated
node.1.simulated.2
...
k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 2 years ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-ci-robot commented 2 years ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/cluster-capacity/issues/139#issuecomment-1179622625): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues and PRs according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue or PR with `/reopen` >- Mark this issue or PR as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
limscoder commented 7 months ago

/reopen

I saw there was a new version of this project released this spring. My organization is still using the changes referenced in this issue. They are very useful. I'm re-opening to see if the maintainers would accept these changes as PRs. If not, please close again.

k8s-ci-robot commented 7 months ago

@limscoder: Reopened this issue.

In response to [this](https://github.com/kubernetes-sigs/cluster-capacity/issues/139#issuecomment-1834571773): >/reopen > >I saw there was a new version of this project released this spring. My organization is still using the changes referenced in this issue. They are very useful. I'm re-opening to see if the maintainers would accept these changes as PRs. If not, please close again. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
limscoder commented 7 months ago

/remove-lifecycle stale

k8s-triage-robot commented 6 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 6 months ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-sigs/cluster-capacity/issues/139#issuecomment-1902056399): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
k8s-triage-robot commented 2 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten