enough-postman-52378
08/29/2024, 7:53 AMmicroscopic-river-74022
08/29/2024, 7:53 AMmicroscopic-river-74022
08/29/2024, 7:53 AMgarden.yml configuration. You can point Garden to your manifest files using the spec.files directive when configuring a kubernetes Deploy action.
Here is an example of how you can reference the manifests:
yaml
kind: Deploy
type: kubernetes
name: api
spec:
files:
- ./manifests/Deployment.yaml
- ./manifests/Ingress.yaml
- ./manifests/Service.yaml
You can also use glob patterns to include all files in a directory:
yaml
kind: Deploy
type: kubernetes
name: api
spec:
files:
- ./manifests/*
If your manifests are in a parent directory relative to the action config file, you need to set the source.path field for your action since Garden cannot include files from parent directories. For example:
yaml
kind: Deploy
type: kubernetes
name: api
source:
path: ../ # <--- Garden will now treat the parent directory as the action source path
spec:
files:
- ./manifests/Deployment.yaml
- ./manifests/Ingress.yaml
- ./manifests/Service.yaml
You can also use Garden's templating to reuse manifests and override names, labels, and such in the base manifests. However, note that using Garden template strings in manifests means they won't work with systems like kubectl apply.microscopic-river-74022
08/29/2024, 7:53 AMmicroscopic-river-74022
08/29/2024, 7:53 AMenough-postman-52378
08/29/2024, 7:55 AMenough-postman-52378
08/29/2024, 7:55 AMmicroscopic-river-74022
08/29/2024, 7:55 AMmicroscopic-river-74022
08/29/2024, 7:55 AMk8s.yaml file in your Garden configuration. You can specify the path to your k8s.yaml file in the files field of the spec section when configuring a kubernetes Deploy action in your garden.yml file.
Here is an example:
yaml
kind: Deploy
type: kubernetes
name: api
spec:
files:
- ./path/to/your/k8s.yaml
This tells Garden to use the Kubernetes manifests defined in k8s.yaml when deploying the api service.
For more information, you can refer to the following sources:
- Kubernetes-plugins > Actions > Deploy > Kubernetes ()
- Reference > Action-types > Deploy > kubernetes Deploy > Description ()
- Kubernetes-plugins > Actions > Deploy > Kubernetes > Referencing manifests > Option 1: Manifest files (recommended) ()
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------microscopic-river-74022
08/29/2024, 7:55 AM