mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-24 18:06:16 +07:00
perf(secret-generator): only run job when config changed
This commit is contained in:
parent
5e76122a04
commit
002e725e6b
@ -1,35 +0,0 @@
|
|||||||
apiVersion: batch/v1
|
|
||||||
kind: CronJob
|
|
||||||
metadata:
|
|
||||||
name: secret-generator
|
|
||||||
namespace: {{ .Release.Namespace }}
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: '1'
|
|
||||||
spec:
|
|
||||||
schedule: '*/5 * * * *'
|
|
||||||
concurrencyPolicy: Forbid
|
|
||||||
jobTemplate:
|
|
||||||
spec:
|
|
||||||
backoffLimit: 3
|
|
||||||
template:
|
|
||||||
spec:
|
|
||||||
restartPolicy: Never
|
|
||||||
containers:
|
|
||||||
- name: apply
|
|
||||||
image: golang:1.19-alpine
|
|
||||||
workingDir: /go/src/secret-generator
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
args:
|
|
||||||
- |
|
|
||||||
go get .
|
|
||||||
go run .
|
|
||||||
volumeMounts:
|
|
||||||
- name: source
|
|
||||||
mountPath: /go/src/secret-generator
|
|
||||||
serviceAccount: secret-generator
|
|
||||||
volumes:
|
|
||||||
- name: source
|
|
||||||
configMap:
|
|
||||||
name: secret-generator
|
|
29
platform/global-secrets/templates/secret-generator/job.yaml
Normal file
29
platform/global-secrets/templates/secret-generator/job.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: secret-generator-{{ include (print $.Template.BasePath "/secret-generator/configmap.yaml") . | sha256sum | trunc 7 }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
spec:
|
||||||
|
backoffLimit: 3
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
restartPolicy: Never
|
||||||
|
containers:
|
||||||
|
- name: secret-generator
|
||||||
|
image: golang:1.19-alpine
|
||||||
|
workingDir: /go/src/secret-generator
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
args:
|
||||||
|
- |
|
||||||
|
go get .
|
||||||
|
go run .
|
||||||
|
volumeMounts:
|
||||||
|
- name: source
|
||||||
|
mountPath: /go/src/secret-generator
|
||||||
|
serviceAccount: secret-generator
|
||||||
|
volumes:
|
||||||
|
- name: source
|
||||||
|
configMap:
|
||||||
|
name: secret-generator
|
Loading…
Reference in New Issue
Block a user