https://flyte.org logo
#ask-the-community
Title
# ask-the-community
a

Adrian Rumpold

12/13/2022, 12:07 PM
Hi! Is there an easy way to obtain an instance of a
FlyteRemote
or similar (i.e.,
flytekit.clients.friendly
) API client instance when running in a container? I have seen
Config.auto()
, but it needs a config file to do its magic. Also, there's
FlyteContext.flyte_client
, which looks promising but is set to
None
, when I try to look it up on a context obtained via
FlyteContextManager.current_context()
at runtime. Any pointers are highly appreciated! 🙏
y

Yee

12/13/2022, 5:04 PM
you can.
one sec
you can at least start out with
Config.for_endpoint(endpoint, insecure)
Copy code
endpoint: str,
        insecure: bool = False,
        data_config: typing.Optional[DataConfig] = None,
        config_file: typing.Union[str, ConfigFile] = None,
that’s the full constructor but the other objects are optional
a

Adrian Rumpold

12/13/2022, 5:10 PM
Actually, that's what I settled on as a workaround, but it requires looking up the admin endpoint from k8s services - or is the endpoint URL readily available elsewhere in the task container?
y

Yee

12/13/2022, 6:39 PM
it is not… but you can hard-code it right?
the dns shouldn’t change.
one thing though is that if you have authentication turned on you’ll have to contend with it