hi, how do i update k8 workpool base job template ...
# prefect-kubernetes
y
hi, how do i update k8 workpool base job template in a file without going through the ui? I would like to version control it updating image and set environment variables. is there any better way to do it to what i did?
Copy code
prefect-kubernetes==0.3.1
I tried to get the manifest from
prefect kubernetes manifest flow-run-job
edit the manifest to change the environment variables but when i try to apply it by
kubectl apply -f job-manifest.yaml
I get the error
Copy code
error: error when retrieving current configuration of:
Resource: "batch/v1, Resource=jobs", GroupVersionKind: "batch/v1, Kind=Job"
Name: "", Namespace: "data"
my manifest looks like this
Copy code
apiVersion: batch/v1
kind: Job
metadata:
  # labels are required, even if empty
  labels: {}
  namespace: data
  stream_output: true
spec:
  template:
    spec:
      completions: 1
      containers:
        - name: prefect-job
          env:
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: DB_PASSWORD
                  name: etl
          image: xxxxx.dkr.ecr.eu-central-1.amazonaws.com/data/prefect_agent:latest
      parallelism: 1
      restartPolicy: Never
o
Hi @Ying Ting Loo I did it like this: 1. Fetch base-job-template:
prefect work-pool get-default-base-job-template --type kubernetes > template.json
2. Edit the template 3. Update work-pool:
prefect work-pool update --base-job-template template.json WORK_POOL_NAME
Of course step 1 is only required the first time
y
thank you so much. couldnt find this anywhere or in the documentation
o
No problem 🙂 It’s a bit hidden but there it is 🙂 https://docs.prefect.io/2.13.7/concepts/work-pools/#work-pool-configuration