Skip to main content
Planned. This page describes designed behaviour that is not built yet. Details may change before it ships.
Ported from Garden’s documentation: garden-for/kubernetes/deploy-k8s-resource.md, gliss-cli at 3bc62a036 (Garden 0.14). Gliss runs Garden under the hood; the notes on this page say where Gliss differs.
In Gliss, kubernetes Deploy actions are available at level 2 only. Your IT team enables level 2 per project, and every release is checked against IT’s policy instead of the catalog. The project still uses the gliss provider: the deploy becomes a signed release request, and the cluster agent applies it. You don’t configure Garden’s kubernetes provider or a kubeconfig.
You deploy your own Kubernetes resources with the kubernetes Deploy action. This page shows how to point Garden at your manifests, deploy an image you build, and change values per environment. The kubernetes Deploy action works much like the helm Deploy action. The full field list is in Garden’s kubernetes Deploy reference.

Reference manifests

Point Garden at your manifest files with the spec.manifestFiles field. You can also put manifests inline in spec.manifests, but files are easier to reuse with other tools. If your project looks like this:
reference the manifests like this:
Glob patterns work too:
You can use templating to pick manifests per environment, for example with a manifests/dev and a manifests/prod directory:
Garden can’t include files from parent directories. If your manifests are in a parent directory of the action’s garden.yml, set source.path:

Option 2: Inline

Deploy an image built by Garden

Most commonly you use the kubernetes Deploy action with a container Build action: one builds your code, the other deploys it. Your manifests will likely contain a hard-coded image, while the image Garden builds has a different version. The recommended way to set the right image is the patchResources field. patchResources overwrites any field in your manifests with Kubernetes’ built-in patch functionality, without changing the manifest files:
This way you add the Garden action to your project without changing existing configuration. Garden has a complete example project that uses this approach.

Option 2: Template strings in inline manifests

If you define the manifests inline, you can use template strings in them directly:

Overwrite values

The same patchResources pattern overwrites other values. For example, to change the number of replicas and an environment variable per environment:
You can also loop over Garden variables and set each one as a container environment variable:
See Variables and templating for the template syntax.
In Gliss, don’t put secret values in Garden variables or manifests, and don’t use Garden Cloud secrets. Secret values are set through Gliss secret requests, and your configuration refers to secrets by name only.
In Gliss, Garden’s sync mode and port forwarding aren’t available, so the spec.sync field and Garden’s guidance on default targets for sync don’t apply. Live code changes are Git-backed and work in Preview only, through gliss dev.
To add tests, see Tests and runs.