Hello everyone! I’m try deploy the prefect api and agent in k8s(ocp) with custom namespace (like this Deploying Prefect Agents on Kubernetes).I have a problem, the api does not start, outputs 0 logs, only a welcome message, but there are no problems with the agent. After re-creation, the container lives for about 5 seconds and outputs “Orion stopped!” and again
My deployment.yml
apiVersion: apps/v1
kind: Deployment
metadata:
name: orion
spec:
selector:
matchLabels:
app: orion
replicas: 1 # We're using SQLite, so we should only run 1 pod
template:
metadata:
labels:
app: orion
spec:
containers:
- name: api
image: proxy-repo/prefect:2.4.0-python3.9
command: ["prefect", "orion", "start","--host", "0.0.0.0", "--port", "4200", "--no-ui", "--log-level", "DEBUG"]
imagePullPolicy: "IfNotPresent"
ports:
- containerPort: 4200
env:
- name: PREFECT_HOME
value: .
- name: agent
image: proxy-repo/prefecthq/prefect:2.4.0-python3.9
command: ["prefect", "agent", "start", "-q", "kubernetes"]
imagePullPolicy: "IfNotPresent"
env:
- name: PREFECT_API_URL
value: http://orion:4200/api
- name: PREFECT_HOME
value: .
---
apiVersion: v1
kind: Service
metadata:
name: orion
labels:
app: orion
spec:
ports:
- port: 4200
protocol: TCP
selector:
app: orion
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: my-namespace
name: flow-runner
rules:
- apiGroups: [""]
resources: ["pods", "pods/log", "pods/status"]
verbs: ["get", "watch", "list"]
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: [ "get", "list", "watch", "create", "update", "patch", "delete" ]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: flow-runner-role-binding
namespace: my-namespace
subjects:
- kind: ServiceAccount
name: default
namespace: my-namespace
roleRef:
kind: Role
name: flow-runner
apiGroup: rbac.authorization.k8s.io
ocp and k8s version
PS C:\Users\18320943\projects> oc version
Client Version: openshift-clients-4.6.0-202006250705.p0-168-g02c110006
Kubernetes Version: v1.20.0+558d959
Help me pls) it’s first try deplot api\agent