Hi All - I am working on a proof of concept to run...
# ask-community
b
Hi All - I am working on a proof of concept to run Prefect in K8 via
microk8s
for local development alongside
localstack
. Ideally, this would allow us to port our existing prefect deployment to k8
k
Hi @Bradley Hurley, this setup looks like it’s not too far off from working. See this thread. Would you be able to move some of the code to the thread for me so we don’t crowd the main channel?
b
Thanks! - This looks super helpful!
Original Posting (Moved to thread) Helm
Copy code
helm repo add localstack-charts <https://localstack.github.io/helm-charts>
helm repo add prefecthq <https://prefecthq.github.io/server/>
helm repo update

helm install aws localstack-charts/localstack
helm list -o json

helm install --set prefectVersionTag=0.15.11-python3.9  --set serverVersionTag=core-0.15.11 --set agent.enabled=true  prefect prefecthq/prefect-server


prefect backend server
kubectl port-forward service/prefect-ui 8080
kubectl port-forward service/prefect-apollo 4200 

prefect server create-tenant --name default --slug default
prefect create project 'default'
Register Flow -
python -m flow
flow.py
Copy code
from prefect import Flow, task

@task(name="hello", log_stdout=True)
def hello():
    print("Attempting To Say Hello")


def create_flow() -> Flow:
    with Flow(name="say-hello") as flow:
        hello_called = hello()
    return flow


if __name__ == "__main__":
    create_flow().register(project_name="default")
The flow fails:
Copy code
Pod prefect-job-4917beb4--1-ndkbd failed.
	Container 'flow' state: terminated
		Exit Code:: 1
		Reason: Error
Failed to load and execute Flow's environment: ModuleNotFoundError("No module named '/Users/bradley/'")
I've done a fair bit of poking around, but can't seem to get back on track.