gocron/k8s-deploy/gocron-st.yml

51 lines
1.1 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 改为用StatefulSet部署把配置目录挂载到外置存储以防container down后重启
# 如果使用历史数据库需要先配置安装然后在conf目录下创建install.lock文件最后重启进程即可
#
---
apiVersion: v1
kind: Service
metadata:
name: gocron
labels:
app: gocron
spec:
ports:
- port: 5920
name: gocron
type: NodePort
selector:
app: gocron
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: gocron
spec:
serviceName: "gocron"
replicas: 1
template:
metadata:
labels:
app: gocron
spec:
securityContext:
fsGroup: 1000
terminationGracePeriodSeconds: 10
containers:
- name: gocron
image: ouqg/gocron:latest
ports:
- containerPort: 5920
name: gocron
volumeMounts:
- name: gocron-vol
mountPath: /app/conf
volumeClaimTemplates:
- metadata:
name: gocron-vol
spec:
storageClassName: rbd
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 100Mi