summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@gmail.com>2023-01-17 12:23:58 +0100
committerLuc Provoost <luc.provoost@gmail.com>2023-01-17 17:45:13 +0000
commit77efe56b635f105502270010e365ddadef6ddbe1 (patch)
tree0b8945c0ba47150c88535f2da078b4647edfe6e8 /VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py
parentf87088f24875450847dc305e6e7c56db8264bdbc (diff)
Allow a different pod spec for each pod
A new parameter is now introduced in the [PODx] sections of the rapid.pods file. This parameter specifies the pod spec yaml file that will be used to create this specif pod. When this parameter is not available, the default pod-rapid.yaml file will be used. The parameter name is spec_file_name. Also cleaned some lines of code exceeding 80 characters. Signed-off-by: Luc Provoost <luc.provoost@gmail.com> Change-Id: Id26881517d45baf4bf6be2e82b4f9e049f2b2547
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py')
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py
index bfb81611..9ef7ef6d 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py
@@ -121,6 +121,14 @@ class K8sDeployment:
else:
pod_nodeselector_hostname = None
+ # Search for POD spec
+ if self._create_config.has_option("POD%d" % i,
+ "spec_file_name"):
+ pod_spec_file_name = self._create_config.get(
+ "POD%d" % i, "spec_file_name")
+ else:
+ pod_spec_file_name = K8sDeployment.POD_YAML_TEMPLATE_FILE_NAME
+
# Search for POD dataplane static IP
if self._create_config.has_option("POD%d" % i,
"dp_ip"):
@@ -139,6 +147,7 @@ class K8sDeployment:
pod = Pod(pod_name, self._namespace)
pod.set_nodeselector(pod_nodeselector_hostname)
+ pod.set_spec_file_name(pod_spec_file_name)
pod.set_dp_ip(pod_dp_ip)
pod.set_dp_subnet(pod_dp_subnet)
pod.set_id(i)
@@ -157,7 +166,7 @@ class K8sDeployment:
# Create PODs using template from yaml file
for pod in self._pods:
self._log.info("Creating POD %s...", pod.get_name())
- pod.create_from_yaml(K8sDeployment.POD_YAML_TEMPLATE_FILE_NAME)
+ pod.create_from_yaml()
# Wait for PODs to start
for pod in self._pods: