Skip to content

Instantly share code, notes, and snippets.

@miticojo
Created June 4, 2018 05:52
Show Gist options
  • Save miticojo/cadec8d92bf8e35317ff6badbb1beb57 to your computer and use it in GitHub Desktop.
Save miticojo/cadec8d92bf8e35317ff6badbb1beb57 to your computer and use it in GitHub Desktop.
ocp/k8s gitlab backup cronjob
apiVersion: v1
kind: List
metadata: {}
items:
- apiVersion: v1
kind: Role
metadata:
creationTimestamp: null
name: pod-reader
rules:
- apiGroups:
- ""
attributeRestrictions: null
resources:
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
attributeRestrictions: null
resources:
- pods/exec
verbs:
- create
- apiVersion: v1
groupNames: null
kind: RoleBinding
metadata:
creationTimestamp: null
name: pod-reader
roleRef:
name: pod-reader
namespace: gitlab
subjects:
- kind: ServiceAccount
name: default
namespace: gitlab
userNames:
- system:serviceaccount:gitlab:default
- apiVersion: batch/v2alpha1
kind: CronJob
metadata:
creationTimestamp: null
labels:
run: gitlab-scheduled-backup
name: gitlab-scheduled-backup
spec:
concurrencyPolicy: Allow
jobTemplate:
metadata:
creationTimestamp: null
spec:
template:
metadata:
creationTimestamp: null
labels:
run: gitlab-scheduled-backup
spec:
containers:
- args:
- oc
- exec
- -it
- gitlab-ce-12-4rn52
- gitlab-rake
- gitlab:backup:create
image: quay.io/gcrivell/oc-client:latest
imagePullPolicy: Always
name: gitlab-scheduled-backup
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Never
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
schedule: 0 5 * * *
suspend: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment