https://prefect.io logo
Title
s

Sam Garvis

08/11/2022, 4:05 PM
For 2.0, has anyone successfully used the k8s helm deployment.yaml I'm having trouble getting it to actually apply and create pods.
1
n

Nate

08/11/2022, 4:12 PM
hey @Sam Garvis, I'm not exactly sure what you mean by:
k8s helm deployment.yaml
I've used the helm chart for deploying a k8s agent and successfully built and applied a deployment, and then spun up flow runs (on their corresponding pods) if this isn't the helm chart you mean, can you link it here?
s

Sam Garvis

08/11/2022, 5:53 PM
I'm currently trying to test this https://github.com/PrefectHQ/prefect-helm/tree/main/charts/prefect-agent/templates/agent in minikube It successfully applys but no pods start this is the code
apiVersion : apps/v1
kind: Deployment
metadata:
  name: prefect-dev-agent-1
  labels:
    app: prefect-dev-agent-1
spec:
  replicas: 4
  selector:
    matchLabels:
      app: prefect-dev-agent-1
  template:
    metadata:
      labels:
        app: prefect-dev-agent-1
    spec:
      imagePullSecrets:
        - name: Always
      serviceAccountName: prefect-2.0-dev
      containers:
        - name: prefect-agent
          image: samgarvis/prefect20_dockerfile:latest
          imagePullPolicy: Always
          command: ["prefect", "agent", "start", "xxx_XXXXXXXXXXXXXXXXXXX"]
          env:
            - name: PREFECT_DEBUG_MODE
              value: ''
            - name: PREFECT_API_URL
              valueFrom:
                secretKeyRef:
                  name: prefect-dev-service-secret
                  key:  prefect-dev-service-url
            - name: PREFECT_API_KEY
              valueFrom:
                secretKeyRef:
                  name: prefect-dev-service-secret
                  key:  prefect-dev-service-key
---
apiVersion: <http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>
kind: Role
metadata:
  namespace: default
  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: <http://rbac.authorization.k8s.io/v1|rbac.authorization.k8s.io/v1>
kind: RoleBinding
metadata:
  name: flow-runner-role-binding
  namespace: default
subjects:
- kind: ServiceAccount
  name: default
  namespace: default
roleRef:
  kind: Role
  name: flow-runner
  apiGroup: <http://rbac.authorization.k8s.io|rbac.authorization.k8s.io>
n

Nate

08/11/2022, 6:04 PM
@Sam Garvis the advantage of having the helm chart here is that you don't need to
kubectl apply
these resources manually have you seen these directions? in your example, you can replace <chart> with
prefect-agent
and then you'd just need to make sure you're in the desired context & namespace and run the
helm
commands I linked
s

Sam Garvis

08/11/2022, 7:52 PM
Got it. I'm using helm v3.9.3 I'm running into an issue that I've seen someone else in this chat has had before but there was no resolution. I keep getting this error
Error: INSTALLATION FAILED: failed to download "prefecthq/prefect-agent"
Also, super minor but for consistency I feel like the repo name should stay prefecthq or prefect in the Readme.md if y'all wanna change
n

Nate

08/11/2022, 7:57 PM
have you run this yet?
$ helm repo add prefecthq <https://prefecthq.github.io/prefect-helm/>
and wrt the name, the helm search command is fuzzy serach afaik so
prefect
is just a natural search term someone might use to find our charts
s

Sam Garvis

08/11/2022, 7:59 PM
Got it, I was jc if it was a mistake. And yes I have run that command
I believe I have the repo downloaded
n

Nate

08/11/2022, 8:01 PM
yeah
helm repo list
output looks good, can you try specifying
--version 0.3.1
in your install command as well?
1
s

Sam Garvis

08/11/2022, 8:02 PM
Wow that worked
Appreciate all the help. I was def struggling a lot at the beginning of this thread 🙏
n

Nate

08/11/2022, 8:03 PM
great! we'll get the docs updated so that's a little more clear happy to help 😄