Skip to content

Feature additions #139

@limscoder

Description

@limscoder

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

limscoder@6302eb1

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.

limscoder@6bc3cdf

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

limscoder@21593ef

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
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions