add repo
This commit is contained in:
38
repo/cronjobs/repo-sync.yaml
Normal file
38
repo/cronjobs/repo-sync.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: repo-sync
|
||||
namespace: repo
|
||||
spec:
|
||||
schedule: "15 2 * * *"
|
||||
concurrencyPolicy: Forbid
|
||||
successfulJobsHistoryLimit: 2
|
||||
failedJobsHistoryLimit: 2
|
||||
jobTemplate:
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
containers:
|
||||
- name: sync
|
||||
image: alpine:latest
|
||||
command: ["sh","-lc"]
|
||||
args:
|
||||
- |
|
||||
set -e
|
||||
apk add --no-cache rsync wget bash coreutils
|
||||
chmod +x /config/sync.sh
|
||||
/config/sync.sh
|
||||
volumeMounts:
|
||||
- name: repo-storage
|
||||
mountPath: /mirror
|
||||
- name: repo-config
|
||||
mountPath: /config
|
||||
volumes:
|
||||
- name: repo-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: repo-pvc
|
||||
- name: repo-config
|
||||
configMap:
|
||||
name: repo-sources
|
||||
defaultMode: 0755
|
||||
Reference in New Issue
Block a user