fresh-yak-35965
10/02/2024, 6:24 PMmicroscopic-river-74022
10/02/2024, 6:24 PMmicroscopic-river-74022
10/02/2024, 6:24 PMpatchResources
field in your garden.yml
file. This field is designed for cases like this and can serve the same role as Kustomize.
Here is an example of how you can use the patchResources
field:
yaml
kind: Deploy
type: kubernetes
name: admin-api
variables:
ADMIN_IMAGE: ${actions.build.admin-api.outputs.deployment-image-name}:${actions.build.admin-api.version}
dependencies:
- build.admin-api
spec:
kustomize:
path: ./kubernetes/overlays/${environment.name}
patchResources:
- name: admin-api
kind: Deployment
patch:
spec:
template:
spec:
containers:
- name: api-container
image: ${var.ADMIN_IMAGE}
initContainers:
- name: init-api
image: ${var.ADMIN_IMAGE}
In this example, the ADMIN_IMAGE
variable is defined using the output of a build action, and then used in the patchResources
field to patch the image of the api-container
and init-api
containers in the admin-api
Deployment.
For more information, you can refer to the Garden documentation on the patchResources
field ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
10/02/2024, 6:24 PM