[kubernetes] Create actions to recreate pods and restart containers
This patch adds actions to KubernetesPod class which allow to recreate a pod (delete it and create new one) and to restart docker containers on minion nodes. Change-Id: Ia03b27d72662700fb302960adba9dae20203b597 Closes-bug: #1466359
This commit is contained in:
@@ -329,3 +329,21 @@ Methods:
|
||||
- $.kubernetesCluster.scaleRc(rcName => $._getReplicationControllerId(), newSize => $.replicas)
|
||||
Else:
|
||||
- $._environment.reporter.report($this, 'Cannot scale Pod up')
|
||||
|
||||
|
||||
recreatePod:
|
||||
Usage: Action
|
||||
Body:
|
||||
- $._environment.reporter.report($this, 'Recreating Pod {0}'.format($.name))
|
||||
- $.kubernetesCluster.deletePods(dict(id => $._getPodName()))
|
||||
- If: $.replicas = 0
|
||||
Then:
|
||||
- $._loadCurrentPodDefinition()
|
||||
- $.kubernetesCluster.createPod(definition => $._podDefinition, isNew => true)
|
||||
- $._environment.reporter.report($this, 'Pod {0} recreated'.format($.name))
|
||||
|
||||
|
||||
restartContainers:
|
||||
Usage: Action
|
||||
Body:
|
||||
- $.kubernetesCluster.restartContainers(podName => $._getPodName())
|
||||
|
Reference in New Issue
Block a user