https://prefect.io logo
Title
v

Vlad Tudor

08/16/2022, 7:42 PM
Hi, I am trying to run a
KubernetesAgent
locally and to bind it to minikube for testing purposes. For now, I see the Agent in the Server UI, but the tasks are not executed. How do I configure this? Thank you for you patience, I am new to Prefect.
šŸ˜„  minikube v1.26.1 on Ubuntu 20.04
āœØ  Using the docker driver based on existing profile
šŸ‘  Starting control plane node minikube in cluster minikube
šŸšœ  Pulling base image ...
šŸƒ  Updating the running docker "minikube" container ...
šŸ³  Preparing Kubernetes v1.24.3 on Docker 20.10.17 ...
    ā–Ŗ Generating certificates and keys ...
    ā–Ŗ Booting up control plane ...
    ā–Ŗ Configuring RBAC rules ...
šŸ”Ž  Verifying Kubernetes components...
    ā–Ŗ Using image <http://gcr.io/k8s-minikube/storage-provisioner:v5|gcr.io/k8s-minikube/storage-provisioner:v5>
šŸŒŸ  Enabled addons: storage-provisioner, default-storageclass
šŸ„  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
m

Mason Menges

08/16/2022, 9:06 PM
Hey @Vlad Tudor Are you seeing any of the flow runs in the work-queue/ui and what status are they showing up in? if not are you deploying the flows or just trying to run them locally and view them in the ui?
v

Vlad Tudor

08/17/2022, 6:46 AM
So, I start Minikube (output given above):
minikube start
Then I run the Prefect server:
prefect backend server
prefect server start
Finally I run this script:
from prefect.agent.kubernetes import KubernetesAgent
from pipeline import prefect_tasks
import prefect

if __name__ == '__main__':
    client = prefect.Client()
    client.create_tenant('default')
    client.create_project(project_name="project")

    flow = prefect_tasks.build_flow()
    flow.register(project_name="project", labels=["development"], add_default_labels=False)

    agent = KubernetesAgent()
    agent.start()
I open my UI at
localhost:8080
and I find my
default
tennant, my
project
project and I also see the Agent. The Agent connects to Minikube (initially I forgit to run minikube and a Connection Error was raised), the task gets submitted to the Agent, but nothing is run.