OpenFaas kubernetes port forwarding

50 views Asked by At

I am trying to use "kubectl port-forward -n openfaas svc/gateway 8080:8080" command for port forwarding and i am trying to forward port to permanently open. I have tried VSCode kubernetes extension to open yaml file added line targetPort but it didn't work, also i couldn't restart the kubernetes to see yaml works or not, i don't know where to look at and where the openfaas yaml files to make gateway open.

1

There are 1 answers

0
gaurav On

You can use the "kubectl port-forward -n openfaas svc/gateway 8080:8080 &" to port-forward the service in background. This will keep the process in background till the terminal is open. You can port-forward multiple services using this.

If you want the port to be open permanently, change the service type to LoadBalancer and attach it to a public IP or private IP according to your convenience. By default, the service type is ClusterIP which makes the pod to be accessed only internally.