Links

workload

"workload" Humanitec resource type
Used to optionally override values in the workload entry of the deployment set before deployment.

Inputs

Name
Description
id
The ID of the workload.
profile
The Workload Profile of the workload.
spec
The Spec section of the workload object.

Output

update
An array of JSONPatch objects

Notes

This is a special type of resource which is automatically provisioned by Humanitec for every workload. It is commonly used with the humanitec/template driver to allow per environment overrides of deployment set values.
This is also a practical way of injecting manifests that are scoped per workload.

Example

This example shows how a resource definition could be defined to change the serviceAccountName to dev-service-account in environments of type development, but only if it has been set.
{
"id": "service-account-name-override-dev",
"type": "workload",
"driver_type": "humanitec/template",
"driver_inputs": {
"values": {
"templates": {
"outputs":
"[{{if .resources.spec.serviceAccountName }}{"op:"replace","path":"/spec/serviceAccountName","value":"dev-service-account"}{{end}}]"
}
}
},
"criteria": {
"env_type": "development"
}
}
Last modified 1yr ago