How to port-forward correctly?

Hi Yugabyte team, I have two questions regarding how to port-forward correctly based on two installation ways.

Question 1 (local install)

I have read “ Problem with port-forward · Issue #4677 · yugabyte/yugabyte-db · GitHub

After changing

"--pgsql_proxy_bind_address=$(POD_IP):5433"

to

"--pgsql_proxy_bind_address=0.0.0.0:5433"

of the yaml file https://raw.githubusercontent.com/yugabyte/yugabyte-db/master/cloud/kubernetes/yugabyte-statefulset-rf-1.yaml

Once installed by kubectl apply --filename=kubernetes/manifests/yugabyte-statefulset-rf-1.yaml,
I can port-forward YSQL API successfully by

kubectl port-forward service/yb-tservers --namespace=default 5433:5433

My question is that is there a way that I can updatesomething in the yaml file to port forward the master UI too by below command?

kubectl port-forward service/yb-master-ui --namespace=default 7000:7000

Question 2 (install by operator)

I try to deploy by operator based on this tutorial “ Open source Kubernetes using YugabyteDB operator | YugabyteDB Docs

kubectl create -f deploy/crds/yugabyte.com_ybclusters_crd.yaml
kubectl create -f deploy/operator.yaml
kubectl create -f deploy/crds/yugabyte.com_v1alpha1_ybcluster_cr.yaml

The files mentioned above are at “ yugabyte-operator/deploy at master · yugabyte/yugabyte-operator · GitHub

How can I port-forward both YSQL API (5433) and master UI (7000) ?
I cannot find pgsql_proxy_bind_address in the repo.

Thanks! :smiley:

Hongbo –

In response to question (1):

You can add the flag --webserver_interface and set it to 0.0.0.0 for both yb-master and yb-tserver in kubernetes/manifests/yugabyte-statefuset-rf-1.yaml.

In response to question (2):

If you use the full CRD template at https://github.com/yugabyte/yugabyte-operator/blob/master/deploy/crds/yugabyte.com_v1alpha1_ybcluster_full_cr.yaml, you can add the gflags webserver_interface and pgsql_proxy_bind_address via the gflags spec in that CRD.

Hope this helps.
–Alan

1 Like

Thanks, Alan! :smiley:
My final work solution for operator way is adding

    gflags:
      - key: webserver_interface
        value: "0.0.0.0"
      - key: pgsql_proxy_bind_address
        value: "0.0.0.0"

Just add more info regarding these flags here for future people:

I think I found some unexpected things.

First just clarify, port-forward works perfect after adding

    gflags:
      - key: webserver_interface
        value: "0.0.0.0"
      - key: pgsql_proxy_bind_address
        value: "0.0.0.0"

Unexpected Issue 1

Based on the document “ yb-tserver configuration reference | YugabyteDB Docs ”,

webserver_interface is default to 0.0.0.0, why port-forward won’t work without adding this?

      - key: webserver_interface
        value: "0.0.0.0"

Is document wrong?

Unexpected Issue 2

Based on the document “ yb-tserver configuration reference | YugabyteDB Docs ”,

pgsql_proxy_bind_address is default to 0.0.0.0:5433.

However, in reality, port-forward works when use

      - key: pgsql_proxy_bind_address
        value: "0.0.0.0"

but this does not work:

      - key: pgsql_proxy_bind_address
        value: "0.0.0.0:5433"

Happy to create two separate GitHub issues if need.

Yes, please open an issue for each one.

1 Like

Created at

:smiley: