Hi — I’m in process of trying to deploy a Kubernet...
# ask-community
l
Hi — I’m in process of trying to deploy a KubernetesAgent to EKS, I have an EKS cluster with 3 different nodes. Where would I specify which node group I would want to use for a flow run? Would it be in the flow.run_config = KubernetesRun(…)?
k
Hey @Leon Kozlowski, i’ll ask the member on the team with more experience and get back to you
z
you’d want to put that in your job template
👍 1
which you can specify as a kwarg in the KubernetesRun init
l
Ah - I see. Thanks Zach
z
FWIW, this is what our job template looks like
Copy code
apiVersion: batch/v1
kind: Job
metadata:
  name: prefect-job
spec:
  template:
    spec:
      restartPolicy: Never
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: function
                operator: In
                values:
                - "etl"
      containers:
        - name: flow-container
          imagePullPolicy: IfNotPresent
      imagePullSecrets:
        - name: regcred
      tolerations:
      - key: "function"
        operator: "Equal"
        value: "etl"
        effect: "NoSchedule"
👏 2
note we use pass in image and env vars thru the KubernetesRun which get added to that template at run time
l
So I suppose provided variables in KubernetsRun will overwrite any existing configuration that exist in the template provided?
t
@Leon Kozlowski yep the run config will take precedence and the nodeaffinity is a great way to do this
🙌 2
l
Thanks Tyler