Support multiple NodePorts, static NodePort mapping, and add 'replicas' spec option #913

Merged
telackey merged 4 commits from telackey/nodeports into main 2024-08-09 02:32:07 +00:00
2 changed files with 11 additions and 1 deletions
Showing only changes of commit 21c61f9207 - Show all commits

View File

@ -514,6 +514,14 @@ def create_operation(deployment_command_context, spec_file, deployment_dir, netw
os.mkdir(destination_script_dir)
script_paths = get_pod_script_paths(parsed_stack, pod)
_copy_files_to_directory(script_paths, destination_script_dir)
if parsed_spec.is_kubernetes_deployment():
for configmap in parsed_spec.get_configmaps():
source_config_dir = resolve_config_dir(stack_name, configmap)
if os.path.exists(source_config_dir):
destination_config_dir = deployment_dir_path.joinpath("configmaps", configmap)
print(source_config_dir, destination_config_dir)
copytree(source_config_dir, destination_config_dir, dirs_exist_ok=True)
# Delegate to the stack's Python code
# The deploy create command doesn't require a --stack argument so we need to insert the
# stack member here.

View File

@ -90,7 +90,9 @@ class ClusterInfo:
if opts.o.debug:
print(f"service port: {raw_port}")
if ":" in raw_port:
parts = raw_port.split(":", 2)
parts = raw_port.split(":")
if len(parts) != 2:
raise Error(f"Invalid port definition: {raw_port}")
node_port = int(parts[0])
pod_port = int(parts[1])
else: