<@ULVA73B9P> can you share an example of a deploym...
# ask-marvin
y
@Marvin can you share an example of a deployment.yaml that I can use for AKS that creates two different pods running two different images with their own resource requests and limits?
m
Ah, the wonders of the internet. Here's a general example of how you might structure a
deployment.yaml
for AKS to create two different pods running two different images with their own resource requests and limits. This isn't a Prefect-specific example, but it should give you a good starting point.
Copy code
yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: deployment-name
spec:
  replicas: 1
  selector:
    matchLabels:
      app: label-name
  template:
    metadata:
      labels:
        app: label-name
    spec:
      containers:
      - name: container1
        image: image1
        resources:
          requests:
            memory: "64Mi"
            cpu: "250m"
          limits:
            memory: "128Mi"
            cpu: "500m"
      - name: container2
        image: image2
        resources:
          requests:
            memory: "64Mi"
            cpu: "250m"
          limits:
            memory: "128Mi"
            cpu: "500m"
In this example,
container1
and
container2
are the names of your containers,
image1
and
image2
are the images you want to run, and the
requests
and
limits
specify the resources allocated to each container. Remember, this is just a general example. You'll need to adjust the specifics to fit your needs. You can find more information on how to manage resources in AKS in this Microsoft documentation. And remember, humans, YAML is very sensitive to indentation. So, be careful with your spaces and tabs. It's a tough world out there for a text file.
n
hey @Marvin i think they meant a
prefect.yaml
- look up how to specify multiple deployments in the
prefect.yaml
, each with their own infra overrides via job_variables
m
Ah, the elusive
prefect.yaml
file. It's like a treasure map, but instead of leading to gold, it leads to well-orchestrated workflows. Here's how you can specify multiple deployments in the
prefect.yaml
, each with their own infra overrides via job_variables:
Copy code
yaml
deployments:
- name: deployment-1
  entrypoint: flows/hello.py:my_flow
  parameters:
    number: 42
    message: Don't panic!
  work_pool:
    name: my-process-work-pool
    work_queue_name: primary-queue
    job_variables:
      stream_output: false
- name: deployment-2
  entrypoint: flows/goodbye.py
  work_pool:
    name: another-work-pool
    job_variables:
      some_variable: some_value
In this example,
deployment-1
and
deployment-2
are the names of your deployments. Each deployment has its own
work_pool
and
job_variables
which can be overridden per deployment. The
job_variables
section follows the OpenAPI specification, which allows you to place limits on provided values (type, minimum, maximum, etc.). You can find more information about working with multiple deployments in Prefect in the Prefect documentation. Remember, humans, YAML is very sensitive to indentation. So, be careful with your spaces and tabs. It's a tough world out there for a text file.
n
ope i need to refresh marvin's docs, its not called
projects
anymore - just deployment management
better link
y
"ope" midwesterner spotted lol. Also, the example from above seems to be using two different workpools, I was thinking there's probably a way to use one workpool with two containers and different overrides? I largely won't need more than 2 maybe 3 different containers running in the same flow/parent flow, but I was hoping to get away with just using the one worker we got setup
oh wait nvm maybe, I can just specify the same workpool each time and then specify different image overrides?
n
exactly
you can override variables on the same workpool on a deployment-by-deployment basis as many times as you like
and yep haha you got me