[Kubernetes] Action to scale Pod up/down

Change-Id: I6b2737524955b1f72b6a692559d3942cbb60deb7
Closes-Bug: #1449599
This commit is contained in:
Stan Lagun
2015-10-06 12:47:21 +03:00
committed by Victor Ryzhenkin
parent 6659c87a67
commit 17fea01068
4 changed files with 76 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ Properties:
replicas:
Contract: $.int().notNull().check($ >= 0)
Usage: InOut
Methods:
@@ -303,3 +304,26 @@ Methods:
getInternalScopeId:
Body:
Return: $.kubernetesCluster.id()
scalePodDown:
Usage: Action
Body:
- If: $.replicas > 1
Then:
- $._environment.reporter.report($this, 'Scaling Pod down')
- $.replicas: $.replicas - 1
- $.kubernetesCluster.scaleRc(rcName => $._getReplicationControllerId(), newSize => $.replicas)
Else:
- $._environment.reporter.report($this, 'Cannot scale Pod down')
scalePodUp:
Usage: Action
Body:
- If: $.replicas > 0
Then:
- $._environment.reporter.report($this, 'Scaling Pod up')
- $.replicas: $.replicas + 1
- $.kubernetesCluster.scaleRc(rcName => $._getReplicationControllerId(), newSize => $.replicas)
Else:
- $._environment.reporter.report($this, 'Cannot scale Pod up')