Alan
06/10/2024, 6:02 PMJamie Zieziula
06/10/2024, 6:28 PMAlan
06/10/2024, 7:11 PMAlan
06/10/2024, 7:19 PM│ Error: values don't meet the specifications of the schema(s) in the following chart(s):
│ prefect-worker:
│ - worker: Additional property autoscaling is not allowed
│ - worker.config.baseJobTemplate: Invalid type. Expected: [string,null], given: object
│
│
│ with module.prefect.helm_release.prefect_worker,
│ on ../../tfmodules/prefect/workers.tf line 1, in resource "helm_release" "prefect_worker":
│ 1: resource "helm_release" "prefect_worker"
Jamie Zieziula
06/10/2024, 7:47 PMJamie Zieziula
06/10/2024, 7:47 PMAlan
06/10/2024, 7:53 PMJamie Zieziula
06/10/2024, 7:56 PMAlan
06/10/2024, 7:57 PMJamie Zieziula
06/10/2024, 7:58 PMJamie Zieziula
06/10/2024, 7:58 PMAlan
06/10/2024, 8:00 PMJamie Zieziula
06/10/2024, 8:03 PMAlan
06/10/2024, 8:05 PMAlan
06/10/2024, 8:05 PMAlan
06/10/2024, 8:05 PMresource "kubernetes_config_map" "base_job_template" {
for_each = { for np in var.karpenter_node_pools : np.node_pool_name => np }
metadata {
name = "base-job-template-configmap"
namespace = "${var.environment}-prefect-worker-${each.value.node_pool_name}"
}
data = {
"baseJobTemplate.json" = jsonencode(
// Your base job template JSON content goes here
{
Jamie Zieziula
06/10/2024, 8:07 PMJamie Zieziula
06/10/2024, 8:07 PMAlan
06/10/2024, 8:14 PMAlan
06/10/2024, 8:16 PMworker:
# -- unique cluster identifier, if none is provided this value will be infered at time of helm install
clusterUid: ""
image:
# -- worker image repository
repository: prefecthq/prefect
## prefect tag is pinned to the latest available image tag at packaging time. Update the value here to
## override pinned tag
# -- prefect image tag (immutable tags are recommended)
prefectTag: 2-python3.11-kubernetes
# -- worker image pull policy
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: <https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/>
## e.g:
## pullSecrets:
## - myRegistryKeySecretName
# -- worker image pull secrets
pullSecrets: []
# -- enable worker image debug mode
debug: false
## general configuration of the worker
config:
# -- the work pool that your started worker will poll.
workPool: ${WORK_POOL_NAME}
# -- one or more work queue names for the worker to pull from. if not provided, the worker will pull from all work queues in the work pool
workQueues: []
# -- how often the worker will query for runs
queryInterval: 5
# -- when querying for runs, how many seconds in the future can they be scheduled
prefetchSeconds: 10
# -- connect using HTTP/2 if the server supports it (experimental)
http2: true
## You can set the worker type here.
## The default image includes only the type "kubernetes".
## Custom workers must be properly registered with the prefect cli.
## See the guide here: <https://docs.prefect.io/2.11.3/guides/deployment/developing-a-new-worker-type/>
# -- specify the worker type
type: kubernetes
## one of 'always', 'if-not-present', 'never', 'prompt'
# -- install policy to use workers from Prefect integration packages.
installPolicy: prompt
# -- the name to give to the started worker. If not provided, a unique name will be generated.
name: null
# -- maximum number of flow runs to start simultaneously (default: unlimited)
limit: null
# -- JSON formatted base job template. If unspecified, Prefect will use the default base job template for the given worker type. If the work pool already exists, this will be ignored.
baseJobTemplate: ${BASE_JOB_TEMPLATE}
Alan
06/10/2024, 8:17 PMresource "kubernetes_config_map" "base_job_template" {
for_each = { for np in var.karpenter_node_pools : np.node_pool_name => np }
metadata {
name = "base-job-template-configmap"
namespace = "${var.environment}-prefect-worker-${each.value.node_pool_name}"
}
data = {
"baseJobTemplate.json" = jsonencode(
// Your base job template JSON content goes here
{
Jamie Zieziula
06/10/2024, 8:19 PMAlan
06/10/2024, 8:34 PMAlan
06/10/2024, 8:35 PMJamie Zieziula
06/10/2024, 8:36 PMJamie Zieziula
06/10/2024, 8:37 PMAlan
06/10/2024, 8:38 PMbaseJobTemplate: ${BASE_JOB_TEMPLATE}
Alan
06/10/2024, 8:38 PMJamie Zieziula
06/10/2024, 8:40 PMAlan
06/10/2024, 8:41 PMAlan
06/10/2024, 9:55 PMapiKeySecret:
# -- prefect API secret name
name: prefect-api-key
# -- prefect API secret key
key: key
value: ""
Jamie Zieziula
06/11/2024, 12:43 AM