aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/contexts
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/contexts')
-rw-r--r--yardstick/benchmark/contexts/kubernetes.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/yardstick/benchmark/contexts/kubernetes.py b/yardstick/benchmark/contexts/kubernetes.py
index 6b00c0374..8cc5dc994 100644
--- a/yardstick/benchmark/contexts/kubernetes.py
+++ b/yardstick/benchmark/contexts/kubernetes.py
@@ -48,6 +48,7 @@ class KubernetesContext(Context):
LOG.info('Creating ssh key')
self._set_ssh_key()
+ self._create_crd()
LOG.info('Launch containers')
self._create_rcs()
self._create_services()
@@ -61,6 +62,7 @@ class KubernetesContext(Context):
self._delete_rcs()
self._delete_pods()
self._delete_services()
+ self._delete_crd()
super(KubernetesContext, self).undeploy()
@@ -107,6 +109,16 @@ class KubernetesContext(Context):
def _delete_pod(self, pod):
k8s_utils.delete_pod(pod)
+ def _create_crd(self):
+ LOG.info('Create Custom Resource Definition elements')
+ for crd in self.template.crd:
+ crd.create()
+
+ def _delete_crd(self):
+ LOG.info('Delete Custom Resource Definition elements')
+ for crd in self.template.crd:
+ crd.delete()
+
def _get_key_path(self):
task_id = self.name.split('-')[-1]
k = 'files/yardstick_key-{}'.format(task_id)