Hey guys, I am trying to install the prefect 3 cli...
# prefect-ui
h
Hey guys, I am trying to install the prefect 3 cli to be able to run
prefect deploy
with the prefect 3 binaries in a CI pipeline. What would be the best way to install that I tried
pip install prefect == 3.0.0
but it coming back with
ERROR: No matching distribution found for prefect==3.0.0
j
3.0.0 exists on pypi https://pypi.org/project/prefect/#history so it should be installable but if you don't need a "hard pin", I would suggest "prefect>=3.0" to get the most recent version, or hard pin to the version that you most recently tested with (which may be more recent?)
upvote 1
h
Good to know will keep that in mind as I am getting more flows onboarded to see which version works best. Thanks
n
yeah generally I would recommend pinning specific versions
prefect==3.x.x
for deployments you've verified work for you, and simply
pip install -U prefect
for development
h
Got it okay. Thank you. I was able to get past this issue. Now I am running into a ServiceAccount permission issue eventhough I have the worker deployed in the eks cluster but it seems that the flow is getting deployed into the default namespace in the eks cluster where the Worker is deployed. It looks like the serviceAccount is getting a forbidden
Copy code
system:serviceaccount:kube-addons-prefect-server-3:prefect-worker" cannot create resource "jobs" in API group "batch" in the namespace "default"
is there a way to tell the worker to deploy into a specific namespace ? I couldn't find that in the helm chart so I thought you guys maybe able to help
n
this is a common gotcha its not the chart bc when you say
helm install
you select a namespace to install the chart in
just update the
namespace
in the work pool
h
Is that configurable in a config file ? or only in the UI ?
n
is there a way to tell the worker to deploy into a specific namespace ?
i.e. yes its like
helm install ... --namespace whatever
Is that configurable in a config file ? or only in the UI ?
the work pool can be configured in the UI or updated via SDK / REST API
but every deployment / flow run can independently override this, so its not a "infra-level config"
h
no way to tell the worker to use a particular namespace in the prefect.yaml for that particular flow ?
n
^ link above
Copy code
deployment: foo
...
work_pool: bar
  job_variables:
    namespace: whatever
h
Ah okay I see
Let me try that thank you!
n
catjam
h
Does it also need a ClusterRole to access other namespaces I am seeing that the helm chart creates a Role and a RoleBinding but it looks like the deployed flow is having to access the
kube-system
namespace
Copy code
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"namespaces \"kube-system\" is forbidden: User \"system:serviceaccount:kube-addons-prefect-server-3:prefect-worker\" cannot get resource \"namespaces\" in API group \"\" in the namespace \"kube-system\"","reason":"Forbidden","details":{"name":"kube-system","kind":"namespaces"},"code":403}
Eventhough the namespace that I specfied the deployment/flow to run in is
kube-addons-prefect-server-3
namespace