witty-pilot-66879
10/11/2024, 10:50 PMDeploy.Container
instead of Deploy.Kubernetes
to utilize $merge: ${var}
, which isn't supported by Deploy.Kubernetes
. The only issue is ensuring the pod exits successfully without restarting. Is there a way to control the restartPolicy
to set it to OnFailure
, or any alternative solutions? I couldn’t find anything in the garden.io docs.witty-pilot-66879
10/13/2024, 1:40 PM---
kind: Build
name: sync-images-job
type: container
dependencies:
- deploy.datastore
source:
path: ../../
include:
- "go.mod"
- "go.sum"
- "pkg"
- "jobs/sync-images"
- "services/datastore/pkg/models"
- "services/datastore/pkg/views"
spec:
dockerfile: jobs/sync-images/Dockerfile.dev
buildArgs:
SSH_DEPLOY_PRIVATE_KEY: ${local.env.SSH_DEPLOY_PRIVATE_KEY}
---
kind: Deploy
name: sync-images-job
type: kubernetes
dependencies:
- build.sync-images-job
- deploy.datastore
spec:
manifests:
- apiVersion: v1
kind: ConfigMap
metadata:
name: sync-images-job-config
data:
$merge: ${variables}
- apiVersion: batch/v1
kind: Job
metadata:
name: sync-images-job-${datetime.timestamp}
spec:
ttlSecondsAfterFinished: 30
template:
spec:
restartPolicy: OnFailure
imagePullSecrets:
- name: regcred
containers:
- name: sync-images-job
image: ${actions.build.sync-images-job.outputs.deploymentImageId}
args: [ "sh", "garden.sh" ]
envFrom:
- configMapRef:
name: sync-images-job-config
freezing-pharmacist-34446
10/15/2024, 11:55 AMrestartPolicy
field and a Deploy.kuberntes is the right choice here.
Regarding your solution, what exactly doesn't work about sync mode with this config?