Kubernetes 部署cron运行php
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: test-cron1
namespace: testcron
spec:
schedule: "10 21 * * *"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
ActiveDeadlineSeconds: 1800
imagePullSecrets:
- name: alicloudprivatekey
containers:
- name: test-cron1-container
image: registry-intl-vpc.ap-southeast-1.aliyuncs.com/pangzai/php
imagePullPolicy: Always
args:
- "/bin/bash"
- "-c"
- "php /var/www/html/protected/yiic mail combineEmailAndSend"
restartPolicy: OnFailure
Facebook评论