Adam
05/21/2021, 2:54 PMAdam
05/21/2021, 2:55 PMimport prefect
from prefect import task, Flow
from prefect.storage import Bitbucket
from prefect.run_configs import KubernetesRun
from prefect.tasks.kubernetes.secrets import KubernetesSecret
@task
def say_hello():
logger = prefect.context.get("logger")
<http://logger.info|logger.info>("Hello, Cloud!")
with Flow("hello-flow") as flow:
say_hello()
flow.run_config = KubernetesRun(
env={"PREFECT__CONTEXT__SECRETS__BB_USER": "my_user",
"PREFECT__CONTEXT__SECRETS__BB_SECRET": KubernetesSecret(secret_name="bb-flows-pull")}
)
flow.storage = Bitbucket(
workspace="my_company",
project="project1",
repo="gitops-flows",
path="hello-flow.py",
ref="master",
cloud_username_secret="BB_USER",
cloud_app_password_secret="BB_SECRET",
)
Kevin Kho
KubernetesSecret(secret_name="bb-flows-pull").run()
to actually run the task and get the secret? Seems like you need the Kubernetes API Key also?Adam
05/21/2021, 3:24 PMdavzucky
05/22/2021, 12:22 AMKevin Kho
.run()
method 🙂davzucky
05/22/2021, 2:14 AM