Vlad Tudor
08/16/2022, 7:42 PMKubernetesAgent
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
Mason Menges
08/16/2022, 9:06 PMVlad Tudor
08/17/2022, 6:46 AMminikube 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.