Lan Yao
08/16/2021, 4:28 AMprefect agent kubernetes install -t ${TOKEN} --rbac --label ${CLUSTER_NAME} | kubectl apply -f -
I’m trying to use the Prefect Cloud Automations to do health monitoring of the agent. However, I can’t do it at the agent installation phase as per the Prefect Docs. And I can’t manage to add the agent_config_id
argument to a running agent either. I tried GraphQL, but didn’t find a proper mutation to make it.
Is there any way to make the Automations work for Prefect agent running in Kubernetes cluster for my case? 🙏Zanie
start
command to include the id
❯ prefect agent kubernetes install
---
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 kubernetes start
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: cloud
- name: PREFECT__CLOUD__AGENT__AGENT_ADDRESS
value: http://:8080
- name: PREFECT__CLOUD__API_KEY
value: ''
- name: PREFECT__CLOUD__TENANT_ID
value: ''
image: prefecthq/prefect:latest
imagePullPolicy: Always
livenessProbe:
failureThreshold: 2
httpGet:
path: /api/health
port: 8080
initialDelaySeconds: 40
periodSeconds: 40
name: agent
Zanie
- args:
- prefect agent kubernetes start --agent-config-id "<id>"
Zanie
Maikel Penz
08/16/2021, 8:38 PMconfig_id
as an option added to the prefect agent kubernetes install
command would be the ideal.Zanie
prefect agent kubernetes install
will just print the yaml and you can modify it before passing it to kubectl
Zanie
Lan Yao
08/17/2021, 10:34 PM