diff options
author | Luc Provoost <luc.provoost@gmail.com> | 2024-11-25 15:06:53 +0100 |
---|---|---|
committer | Luc Provoost <luc.provoost@gmail.com> | 2024-11-25 15:06:53 +0100 |
commit | c97164903fc712487b26aa80edec3a96b6049074 (patch) | |
tree | b309899930c9290e91c04445b67587e8f174cf7e /VNFs | |
parent | 19d12dd0760ce512d730c1f8aacb7005073f3430 (diff) |
When running createrapidk8s.py, you can now specify the kubeconfig file
to be used. Check the help option for this parameter. The parameter is
optional.
Signed-off-by: Luc Provoost <luc.provoost@gmail.com>
Change-Id: Ic4b5fcb68cfda1cf39651600d7d40311ffe56c72
Diffstat (limited to 'VNFs')
-rwxr-xr-x | VNFs/DPPD-PROX/helper-scripts/rapid/createrapidk8s.py | 6 | ||||
-rw-r--r-- | VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/createrapidk8s.py b/VNFs/DPPD-PROX/helper-scripts/rapid/createrapidk8s.py index 8b0e4a6f..9f9d361d 100755 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/createrapidk8s.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/createrapidk8s.py @@ -28,13 +28,17 @@ RUN_CONFIG_FILE_NAME = "rapid.env" def main(): # Parse command line arguments argparser = argparse.ArgumentParser() + argparser.add_argument("-k", "--kubeconfig", type = str, required = False, + default = None, + help = "Specify the kubeconfig to be used") + argparser.add_argument("-c", "--clean", action = "store_true", help = "Terminate pod-rapid-* PODs. " "Clean up cluster before or after the testing.") args = argparser.parse_args() # Create a new deployment - deployment = K8sDeployment() + deployment = K8sDeployment(kubeconfig = args.kubeconfig) # Load config file with test environment description deployment.load_create_config(CREATE_CONFIG_FILE_NAME) 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 c9aca3c8..282f3274 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_k8s_deployment.py @@ -43,7 +43,7 @@ class K8sDeployment: _namespace = "rapid-testing" _pods = [] - def __init__(self): + def __init__(self, kubeconfig = None): # Configure logger self._log = logging.getLogger("k8srapid") self._log.setLevel(logging.DEBUG) @@ -66,7 +66,7 @@ class K8sDeployment: # Initialize k8s plugin try: - config.load_kube_config() + config.load_kube_config(config_file = kubeconfig) except: config.load_incluster_config() |