Hi, I need to port forward a service inside the fl...
# ask-the-community
Hi, I need to port forward a service inside the flyte sandbox container. I was able to do this by launching the container as where the service is running at
Copy code
docker create --privileged -p -p -p -p -p -p -p -p --env SANDBOX=1 --env KUBERNETES_API_PORT=30086 --env FLYTE_HOST=localhost:30081 --env FLYTE_AWS_ENDPOINT=<http://localhost:30084> --mount type=bind,source=/home/aswanth/.flyte,target=/etc/rancher/ --mount type=bind,source=/home/aswanth/.flyte/state,target=/srv/flyte --name flyte-sandbox <http://cr.flyte.org/flyteorg/flyte-sandbox:dind-f69fb09ca189e8bf57e1a6a12db168274f640d15|cr.flyte.org/flyteorg/flyte-sandbox:dind-f69fb09ca189e8bf57e1a6a12db168274f640d15>
after this when i try to register my workflows using pyflyte register i am gettting the following error
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses; last error: UNAVAILABLE: Socket closed"
debug_error_string = "UNKNOWN:Failed to pick subchannel {created_time:"2023-02-20T12:41:31.69117013+05:30", children:[UNKNOWN:failed to connect to all addresses; last error: UNAVAILABLE: Socket closed {created_time:"2023-02-20T12:41:31.691159352+05:30", grpc_status:14}]}"
how can i achieve my intention? Thanks in advance
could you show your flytectl config
Hi @Aswanth Krishnan Also, what we call "port forward" is basically a temporary version of what a
service would do. To expose a Pod using a specific pair of ports, you could do it imperatively using `kubectl expose`: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#expose
@Kevin Su this is my flytectl config
Copy code
  # For GRPC endpoints you might want to use dns:///flyte.myexample.com
  endpoint: localhost:30080
  authType: Pkce
  insecure: true
  endpoint: <http://localhost:30081>
  show-source: true
  level: 0
@David Espejo (he/him) I was using
kubectl port-forward --address $(hostname -i),localhost ui-pod 8501:8501
command. will
kubectl expose
work differently? I also need to access this outside the sandbox container. Sorry if my questions doesn't make sense. i am pretty new to flyte and kubernetes.
@Aswanth Krishnan your question makes a lot of sense!
kubectl port forward
will work while your terminal session is open,
kubectl expose
will create a Service for you to make it persistent
Okay thanks a lot! Do you think this will solve the issue I am facing while registering my workflows?
well, it should help 🙂 To register, are you using
pyflyte run
I am using pyflyte register
Were you able to resolve the issue?