Hi, I need to port forward a service inside the fl...
# ask-the-community
a
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 127.0.0.1:8501.
Copy code
docker create --privileged -p 0.0.0.0:30082:30082 -p 0.0.0.0:30084:30084 -p 0.0.0.0:30086:30086 -p 0.0.0.0:30088:30088 -p 0.0.0.0:30089:30089 -p 0.0.0.0:30080:30080 -p 0.0.0.0:30081:30081 -p 127.0.0.1:8501:8501 --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
k
could you show your flytectl config
d
Hi @Aswanth Krishnan Also, what we call "port forward" is basically a temporary version of what a
NodePort
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
a
@Kevin Su this is my flytectl config
Copy code
admin:
  # For GRPC endpoints you might want to use dns:///flyte.myexample.com
  endpoint: localhost:30080
  authType: Pkce
  insecure: true
console:
  endpoint: <http://localhost:30081>
logger:
  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.
d
@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
a
Okay thanks a lot! Do you think this will solve the issue I am facing while registering my workflows?
d
well, it should help 🙂 To register, are you using
pyflyte run
?
a
I am using pyflyte register
s
Were you able to resolve the issue?
153 Views