Update YAML for label-driven recurring job
Longhorn-467 Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
This commit is contained in:
parent
8dca77621d
commit
64d53d53ee
@ -49,7 +49,8 @@ rules:
|
||||
"engineimages", "engineimages/status", "nodes", "nodes/status", "instancemanagers", "instancemanagers/status",
|
||||
"sharemanagers", "sharemanagers/status", "backingimages", "backingimages/status",
|
||||
"backingimagemanagers", "backingimagemanagers/status", "backingimagedatasources", "backingimagedatasources/status",
|
||||
"backuptargets", "backuptargets/status", "backupvolumes", "backupvolumes/status", "backups", "backups/status"]
|
||||
"backuptargets", "backuptargets/status", "backupvolumes", "backupvolumes/status", "backups", "backups/status",
|
||||
"recurringjobs"]
|
||||
verbs: ["*"]
|
||||
- apiGroups: ["coordination.k8s.io"]
|
||||
resources: ["leases"]
|
||||
@ -745,6 +746,86 @@ spec:
|
||||
description: The backup last synced time
|
||||
jsonPath: .status.lastSyncedAt
|
||||
---
|
||||
apiVersion: apiextensions.k8s.io/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
labels:
|
||||
longhorn-manager: RecurringJob
|
||||
name: recurringjobs.longhorn.io
|
||||
spec:
|
||||
group: longhorn.io
|
||||
names:
|
||||
kind: RecurringJob
|
||||
listKind: RecurringJobList
|
||||
plural: recurringjobs
|
||||
shortNames:
|
||||
- lhrj
|
||||
singular: recurringjob
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1beta1
|
||||
served: true
|
||||
storage: true
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
type: object
|
||||
properties:
|
||||
metadata:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
spec:
|
||||
type: object
|
||||
properties:
|
||||
groups:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
task:
|
||||
type: string
|
||||
pattern: "^snapshot|backup$"
|
||||
cron:
|
||||
type: string
|
||||
retain:
|
||||
type: integer
|
||||
concurrency:
|
||||
type: integer
|
||||
labels:
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
status:
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
subresources:
|
||||
status: {}
|
||||
additionalPrinterColumns:
|
||||
- name: Groups
|
||||
type: string
|
||||
description: Sets groupings to the jobs. When set to "default" group will be added to the volume label when no other job label exist in volume.
|
||||
jsonPath: .spec.groups
|
||||
- name: Task
|
||||
type: string
|
||||
description: Should be one of "backup" or "snapshot".
|
||||
jsonPath: .spec.task
|
||||
- name: Cron
|
||||
type: string
|
||||
description: The cron expression represents recurring job scheduling.
|
||||
jsonPath: .spec.cron
|
||||
- name: Retain
|
||||
type: integer
|
||||
description: The number of snapshots/backups to keep for the volume.
|
||||
jsonPath: .spec.retain
|
||||
- name: Concurrency
|
||||
type: integer
|
||||
description: The concurrent job to run by each cron job.
|
||||
jsonPath: .spec.concurrency
|
||||
- name: Age
|
||||
type: date
|
||||
jsonPath: .metadata.creationTimestamp
|
||||
- name: Labels
|
||||
type: string
|
||||
description: Specify the labels
|
||||
jsonPath: .spec.labels
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
@ -874,9 +955,8 @@ data:
|
||||
# backingImageURL: "https://backing-image-example.s3-region.amazonaws.com/test-backing-image"
|
||||
# diskSelector: "ssd,fast"
|
||||
# nodeSelector: "storage,fast"
|
||||
# recurringJobs: '[{"name":"snap", "task":"snapshot", "cron":"*/1 * * * *", "retain":1},
|
||||
# {"name":"backup", "task":"backup", "cron":"*/2 * * * *", "retain":1,
|
||||
# "labels": {"interval":"2m"}}]'
|
||||
# recurringJobSelector: '[{"name":"snap-group", "isGroup":true},
|
||||
# {"name":"backup", "isGroup":false}]'
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
|
Loading…
Reference in New Issue
Block a user