Vaikath Job

07/11/2022, 8:36 PM
Hi, I'm trying to attach storage to my flows (GitLab with on-prem host). Prefect server (1.x) is hosted on an on-prem K8s cluster. I get the following error
Failed to load and execute flow run: ValueError('Local Secret "<prefect.client.secrets.Secret object at 0x00000221D3B7B100>" was not found.')
when trying to use an OAuth token with the Secrets API. i.e. The config.toml is located on my local machine with and has a section:
GITLAB="<OAuth Token>"
The code that registers the flow is similar to this:
secret = Secret("GITLAB") = GitLab(host="path/to/host", repo="repo/address", path="flow/", access_token_secret=secret)
I assume this is happening because the config.toml is not on the K8s cluster. If this is the case, is there a way I can attach this storage to the flow without storing OAuth tokens on the cluster itself?

Kevin Kho

07/11/2022, 8:45 PM
I think the access token secret should be a name: = GitLab(host="path/to/host", repo="repo/address", path="flow/", access_token_secret="GITLAB")
and Prefect will fetch the value during runtime. Yes you need config.toml available to Kubernetes or you can check this for options

Vaikath Job

07/11/2022, 9:19 PM
Thanks! That seemed to work but now it looks like my org hasn't setup SSL certs correctly. Is there a way to use set ssl_verify=False when initializing this storage? I tried including it as an additonal kwarg but that just throws a "got an unexpected keyword argument 'ssl_verify'" error
@Kevin Kho would you happen to know?