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
244 stars 14 forks source link

Add nodeSelector and tolerations flags #47

Closed mgss-cc closed 2 weeks ago

mgss-cc commented 3 months ago

Hi,

It would be great if we are able to pass nodeSelector and tolerations as flags to the krelay command. Sometimes in multitenancy, we want pods to be deployed on certain nodes.

knight42 commented 2 weeks 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.yaml
spec:
  tolerations:
    - ...
  nodeSelector:
    k: v

$ kubectl relay --custom custom-pod.yaml ...
knight42 commented 2 weeks ago

@mgss-cc 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.yaml ...