123456789101112131415161718192021222324252627282930313233343536373839 |
- package kube
- var jobTmeplate = `apiVersion: batch/v1
- kind: CronJob
- metadata:
- name: {{.Name}}
- namespace: {{.Namespace}}
- spec:
- successfulJobsHistoryLimit: {{.SuccessfulJobsHistoryLimit}}
- schedule: "{{.Schedule}}"
- jobTemplate:
- spec:
- template:
- spec:
- containers:
- - name: {{.Name}}
- image: # todo image url
- resources:
- requests:
- cpu: {{.RequestCpu}}m
- memory: {{.RequestMem}}Mi
- limits:
- cpu: {{.LimitCpu}}m
- memory: {{.LimitMem}}Mi
- command:
- - ./{{.ServiceName}}
- - -f
- - ./{{.Name}}.yaml
- volumeMounts:
- - name: timezone
- mountPath: /etc/localtime
- imagePullSecrets:
- - name: # registry secret, if no, remove this
- restartPolicy: OnFailure
- volumes:
- - name: timezone
- hostPath:
- path: /usr/share/zoneinfo/Asia/Shanghai
- `
|