knight42 / krelay

A better alternative to `kubectl port-forward` that can forward TCP or UDP traffic to IP/Host which is accessible inside the cluster.
MIT License
248 stars 15 forks source link

add option to control the pod name prefix #56

Closed grzn closed 2 months ago

grzn commented 2 months ago

would be helpful to provide a name prefix for the pod from the commandline, it'll be helpful to identify which pod is used for what purpose when running multiple pods.

knight42 commented 2 months ago

I plan to add a flag, say --custom, so that users are able to specify the path to a JSON or YAML file containing a partial pod object to customize the relay agent pod.

Let's take your use case as an example, you can do something like this:

$ cat custom-pod.json
{"metadata": {"namePrefix": "your-name-prefix"} }

$ kubectl relay --custom custom-pod.json ...
knight42 commented 2 months ago

@grzn Hi, with krelay 0.1.1, you could customize the krelay-server pod by the --patch/--patch-file flag. For instance:

$ kubectl relay --patch-file custom-pod.json ...