Ollie Sellers
06/08/2022, 2:01 PMKevin Kho
Ollie Sellers
06/08/2022, 3:26 PMKevin Kho
flow.executor()
out of the if block so that it’s attached? Also, you can try running a flow with DEBUG level logs and it will show the executor at the top of the logsOllie Sellers
06/08/2022, 3:40 PMKevin Kho
Ollie Sellers
06/08/2022, 3:55 PMKevin Kho
docker login
or is there a file with credentials? I hvaen’t done it in a whileOllie Sellers
06/09/2022, 2:27 PMKevin Kho
Ollie Sellers
06/09/2022, 2:57 PMKevin Kho
Ollie Sellers
06/09/2022, 2:59 PMflow.executor = DaskExecutor(
cluster_class=lambda: KubeCluster(
make_pod_spec(image=prefect.context.image)
),
adapt_kwargs={"minimum": 2, "maximum": 3},
)
Kevin Kho
make_pod_spec
so they are able to pull the same image right?context
?Ollie Sellers
06/09/2022, 3:10 PMflow.run_config = KubernetesRun(
env=os.environ,
image="<http://sampo.azurecr.io/sampo-prefect:latest|sampo.azurecr.io/sampo-prefect:latest>",
labels=["Kubernetes"],
image_pull_policy="Always",
)
Kevin Kho
make_pod_spec
Ollie Sellers
06/09/2022, 4:18 PMConnectionError: kubectl port forward failed
errorAlexandru Anghel
06/21/2022, 1:11 PMOllie Sellers
06/21/2022, 2:26 PMAlexandru Anghel
06/21/2022, 3:37 PMrun_config=KubernetesRun(
labels=["dev"],
job_template=job_template,
service_account_name="prefect-sa")
The kubernetes resources:
apiVersion: v1
kind: ServiceAccount
metadata:
name: prefect-sa
namespace: prefect-server
---
kind: ClusterRole
apiVersion: <http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>
metadata:
namespace: prefect-server
name: allow-port-forward
# rules:
# - apiGroups: [""]
# resources: ["pods", "pods/portforward"]
# verbs: ["get", "list", "create"]
rules:
- apiGroups: ["batch", "extensions"]
resources: ["jobs", "jobs/status"]
verbs: ["*"]
- apiGroups: [""]
resources: ["events", "pods", "pods/log", "services", "pods/portforward"]
verbs: ["*"]
- apiGroups: ["policy"]
resources: ["poddisruptionbudgets"]
verbs: ["*"]
---
apiVersion: <http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>
kind: ClusterRoleBinding
metadata:
name: allow-port-forward
namespace: prefect-server
subjects:
- kind: ServiceAccount
name: prefect-sa
namespace: prefect-server
roleRef:
kind: ClusterRole
name: allow-port-forward
apiGroup: ""
Let me know if this works for you as well.
Good luck!Ollie Sellers
06/21/2022, 4:07 PMTom Klein
07/10/2022, 1:08 PMOllie Sellers
08/18/2022, 3:55 PMTom Klein
08/19/2022, 4:33 PMOllie Sellers
09/06/2022, 8:00 AMTom Klein
09/06/2022, 8:08 AMOllie Sellers
09/06/2022, 8:09 AM