mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 01:30:25 +08:00
7a82cf80ce
* simplify code, format makefile * simplify code * some optimize by kevwan and benying (#240) Co-authored-by: 杨志泉 <zhiquan.yang@yiducloud.cn> * optimization (#241) * optimize docker file generation, make docker build faster * support k8s deployment yaml generation Co-authored-by: benying <31179034+benyingY@users.noreply.github.com> Co-authored-by: 杨志泉 <zhiquan.yang@yiducloud.cn> Co-authored-by: bittoy <bittoy@qq.com>
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
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
|
|
`
|