Josef Trefil
10/28/2020, 11:25 PMDeploying flow run ...
and that's it.
When I then check kubectl get all
, the prefect-agent pod and deployment both show READY 0/1
When I check kubectl logs deployment/prefect-agent
the very last line of the traceback says: prefect.utilities.exceptions.ClientError: Malformed response received from API.
Any idea what I'm doing wrong? đ¤ˇââď¸
Thank you so much for any clues! đChris White
10/28/2020, 11:28 PMMalformed response
error suggests that your agent submitted the flow run to run against Prefect Cloud but did not provide a token to the run in order to communicate; are you attempting to run this with Cloud or a locally setup Server?Josef Trefil
10/28/2020, 11:33 PMChris White
10/28/2020, 11:38 PMprefect backend server
or set PREFECT__BACKEND=server
in the agentâs environment? Once set, the agent should then provide that config into the jobs it creates so that they talk to your local API instead of the Cloud APIJosef Trefil
10/28/2020, 11:42 PMprefect backend server
Then i ran:
prefect server start
prefect agent install kubernetes --rbac | kubectl apply -f -
prefect agent start kubernetes
Chris White
10/28/2020, 11:44 PMprefect agent install kubernetes --rbac
and adding PREFECT__BACKEND=server
as an environment variable in the manifestJosef Trefil
10/29/2020, 12:03 AMPREFECT__BACKEND=server
is there already. đ
This is the output of prefect agent install kubernetes --rbac
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: prefect-agent
name: prefect-agent
spec:
replicas: 1
selector:
matchLabels:
app: prefect-agent
template:
metadata:
labels:
app: prefect-agent
spec:
containers:
- args:
- prefect agent start kubernetes
command:
- /bin/bash
- -c
env:
- name: PREFECT__CLOUD__AGENT__AUTH_TOKEN
value: ''
- name: PREFECT__CLOUD__API
value: <https://api.prefect.io>
- name: NAMESPACE
value: default
- name: IMAGE_PULL_SECRETS
value: ''
- name: PREFECT__CLOUD__AGENT__LABELS
value: '[]'
- name: JOB_MEM_REQUEST
value: ''
- name: JOB_MEM_LIMIT
value: ''
- name: JOB_CPU_REQUEST
value: ''
- name: JOB_CPU_LIMIT
value: ''
- name: IMAGE_PULL_POLICY
value: ''
- name: SERVICE_ACCOUNT_NAME
value: ''
- name: PREFECT__BACKEND
value: server
- name: PREFECT__CLOUD__AGENT__AGENT_ADDRESS
value: http://:8080
image: prefecthq/prefect:0.13.9-python3.6
imagePullPolicy: Always
livenessProbe:
failureThreshold: 2
httpGet:
path: /api/health
port: 8080
initialDelaySeconds: 40
periodSeconds: 40
name: agent
resources:
limits:
cpu: 100m
memory: 128Mi
---
apiVersion: <http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>
kind: Role
metadata:
name: prefect-agent-rbac
namespace: default
rules:
- apiGroups:
- batch
- extensions
resources:
- jobs
verbs:
- '*'
- apiGroups:
- ''
resources:
- pods
verbs:
- '*'
---
apiVersion: <http://rbac.authorization.k8s.io/v1beta1|rbac.authorization.k8s.io/v1beta1>
kind: RoleBinding
metadata:
name: prefect-agent-rbac
namespace: default
roleRef:
apiGroup: <http://rbac.authorization.k8s.io|rbac.authorization.k8s.io>
kind: Role
name: prefect-agent-rbac
subjects:
- kind: ServiceAccount
name: default
Chris White
10/29/2020, 12:19 AMMarvin
10/29/2020, 12:22 AMChris White
10/29/2020, 12:28 AMprefect agent start kubernetes -e PREFECT__BACKEND=server
i believe it should work as you expectJosef Trefil
10/29/2020, 2:10 PMkubectl get all
the pod, deployment and replicaset show READY=1, but when I run the same command right after, they show READY=0. No matter whether I try to run a flow or not...
Do I understand correctly, that in my case, it would be easier to use Cloud instead of Server? I can try that...Chris White
10/29/2020, 3:46 PMJosef Trefil
10/29/2020, 4:19 PM