Raphael Perez
03/24/2023, 3:53 PMkubectl -n <my_namespace> apply -f prefect2_agent.yaml
the deployment launches but keeps returning Response: {'detail': 'Not Found'}
when attempting to connect to the work-queue. Even after manually exec'ing into the deployment pod and running a prefect cloud login -k $PREFECT_API_KEY
receiving a login confirmation and choosing the correct workspace I cannot interact with any resource.
For example running prefect cloud workspace ls
raise the error AttributeError: 'NoneType' object has no attribute 'groups'
even though the workspace was correctly set in the cloud login step.
If anyone could shine a light where my issue may be I'd be grateful.redsquare
03/24/2023, 4:35 PMRaphael Perez
03/24/2023, 4:40 PMprefect config view
locally and confirmed the URL is the same as the env var set up as PREFECT_API_URL inside the deployment yaml file, also running a echo $PREFECT_API_URL
inside the deployment pod returns the correct URLredsquare
03/24/2023, 4:43 PMredsquare
03/24/2023, 4:43 PMRaphael Perez
03/24/2023, 4:45 PMredsquare
03/24/2023, 4:45 PMredsquare
03/24/2023, 4:47 PMRaphael Perez
03/24/2023, 4:47 PMprefecthq/prefect:2.4.5-python3.9
Raphael Perez
03/24/2023, 4:47 PMRaphael Perez
03/24/2023, 4:47 PMredsquare
03/24/2023, 4:48 PMredsquare
03/24/2023, 4:48 PMredsquare
03/24/2023, 4:49 PMRaphael Perez
03/24/2023, 4:55 PMredsquare
03/24/2023, 4:56 PMRaphael Perez
03/24/2023, 4:57 PMRaphael Perez
03/24/2023, 4:58 PMredsquare
03/24/2023, 4:58 PMredsquare
03/24/2023, 4:59 PMRaphael Perez
03/24/2023, 5:02 PMredsquare
03/24/2023, 5:03 PMapiVersion: apps/v1
kind: Deployment
metadata:
name: prefect-agent-<AGENT_NAME>-<COUNTRY>-<ENV>
namespace: data-prefect-<COUNTRY>-<ENV>
spec:
selector:
matchLabels:
app: prefect-agent-<AGENT_NAME>-<COUNTRY>-<ENV>
replicas: 1
template:
metadata:
labels:
app: prefect-agent-<AGENT_NAME>-<COUNTRY>-<ENV>
spec:
serviceAccountName: default
automountServiceAccountToken: true
containers:
- name: agent
image: xxxprefect-agent:<IMAGE_VERSION>
command: ["prefect", "agent", "start", "<WORK_QUEUE>"]
imagePullPolicy: "IfNotPresent"
volumeMounts:
- mountPath: /.prefect
name: prefectscratch
env:
- name: ENVIRONMENT
value: "<ENV>"
- name: COUNTRY
value: <COUNTRY>
- name: IMAGE_VERSION
value: "<IMAGE_VERSION>"
- name: WORK_QUEUE
value: "<WORK_QUEUE>"
- name: "AGENT_NAME"
value: "<AGENT_NAME>"
envFrom:
- secretRef:
name: data-prefect-agent
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
privileged: false
readOnlyRootFilesystem: false
runAsNonRoot: true
runAsUser: 1000
imagePullSecrets:
- name: azure-docker
volumes:
- emptyDir:
sizeLimit: 100Mi
medium: Memory
name: prefectscratch
redsquare
03/24/2023, 5:03 PMredsquare
03/24/2023, 5:16 PMRaphael Perez
03/24/2023, 5:19 PMprefect cloud workspace ls
raises an exceptionRaphael Perez
03/24/2023, 5:19 PMredsquare
03/24/2023, 5:23 PMRaphael Perez
03/24/2023, 5:32 PMRaphael Perez
03/24/2023, 5:32 PMredsquare
03/24/2023, 5:33 PMredsquare
03/24/2023, 5:33 PMredsquare
03/24/2023, 5:33 PM