bright-policeman-43626
06/23/2023, 3:53 AMmicroscopic-river-74022
06/23/2023, 3:53 AMcontainer
Build action that builds the image for your service.
yaml
kind: Build
type: container
name: worker-image
2. Create a helm
Deploy action that depends on the Build action and injects the image output from the Build action into the Helm chart via the spec.values
field.
yaml
kind: Deploy
description: Helm deploy for the worker container
type: helm
name: worker-deploy
dependencies: [build.worker-image]
spec:
values:
image:
repository: ${actions.build.worker-image.outputs.deployment-image-name}
tag: ${actions.build.worker-image.version}
Make sure to consult the reference for the chart in question and adjust the spec.values
field according to the shape of the chart's values.yaml
file.
For more information, refer to the Linking container builds and Helm deploy actions () section in the Garden documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------bright-policeman-43626
06/23/2023, 3:55 AMmicroscopic-river-74022
06/23/2023, 3:55 AMspec.valueFiles
field in your action configuration. Specify the paths to your custom value files relative to the config root, and make sure the files are contained in the action config's directory. The custom value files will take precedence over the values.yaml
file bundled in the Helm chart.
Here's an example of how to set custom values files in a Helm deploy action:
yaml
kind: Deploy
type: helm
name: helm-deploy
spec:
valueFiles:
- custom-values-1.yaml
- custom-values-2.yaml
In this example, custom-values-1.yaml
and custom-values-2.yaml
are custom value files. The last file in the list (custom-values-2.yaml
) will have the highest precedence.
For more information, refer to the spec.valueFiles () section in the Garden documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------bright-policeman-43626
06/23/2023, 4:37 AMmicroscopic-river-74022
06/23/2023, 4:37 AMspec.chart.path
field in your Helm deploy action configuration. Set the chart.path
to the directory path relative to the action directory, where the Chart.yaml
file is located.
Here's an example of how to specify a Helm chart using a path:
yaml
kind: Deploy
type: helm
name: helm-deploy
spec:
chart:
path: ./path/to/chart/
In this example, ./path/to/chart/
is the relative path to the directory containing the Chart.yaml
file.
For more information, refer to the spec.chart () section in the Garden documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------bright-policeman-43626
06/23/2023, 5:27 AMmicroscopic-river-74022
06/23/2023, 5:27 AMyaml
kind: Deploy
type: helm
name: nodejs-api
spec:
chart:
path: ./path/to/chart/
values:
image:
repository: ${{actions.build.nodejs-api-image.outputs.deployment-image-name}}
tag: ${{actions.build.nodejs-api-image.version}}
sync:
paths:
- containerPath: /app/src
sourcePath: ${actions.build.nodejs-api-image.sourcePath}/src
mode: two-way
In this example, replace ./path/to/chart/
with the relative path to the directory containing the Chart.yaml
file for your Node.js API Helm chart. The sync
block is configured to sync the src
directory from the build action's source path to the /app/src
directory inside the running container.
Make sure you have a Build action for your Node.js API image, like this:
yaml
kind: Build
type: container
name: nodejs-api-image
For more information on synchronization, refer to the Code Synchronization Guide () in the Garden documentation.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------bright-policeman-43626
06/23/2023, 5:33 AMkind: Deploy
type: container
build: api-build
name: api
description: Golang API deployment
spec:
sync:
paths:
- target: /app
mode: "one-way-replica"
ports:
- name: http
protocol: TCP
containerPort: 80
servicePort: 80
ingresses:
- path: /
port: http
hostname: api.${variables.base-hostname}
healthCheck:
httpGet:
path: /
port: http
microscopic-river-74022
06/23/2023, 5:33 AMvalues.yaml
file. Make sure to include the appropriate configuration for syncing, ports, ingresses, and health checks in the chart.
2. Update the Deploy action configuration to use the Helm chart:
yaml
kind: Deploy
type: helm
name: api
description: Golang API deployment
dependencies: [build.api-build]
spec:
chart:
path: ./path/to/chart/
values:
image:
repository: ${{actions.build.api-build.outputs.deployment-image-name}}
tag: ${{actions.build.api-build.version}}
In this example, replace ./path/to/chart/
with the relative path to the directory containing the Chart.yaml
file for your Golang API Helm chart.
Please note that the sync configuration, ports, ingresses, and health checks should be defined within the Helm chart itself, as they are not directly specified in the Helm deploy action configuration.
For more information on creating Helm charts and using the Helm deploy action, refer to the Helm action type documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------bright-policeman-43626
06/23/2023, 5:35 AMkind: Deploy
type: container
build: api-build
name: api
description: Golang API deployment
spec:
sync:
paths:
- target: /app
mode: "one-way-replica"
microscopic-river-74022
06/23/2023, 5:35 AM