Skip to content

Commit d13fb27

Browse files
authored
Add Size Field to Backup CR (#460)
1 parent a27e5ef commit d13fb27

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1805
-897
lines changed
Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: apiextensions.k8s.io/v1beta1
22
kind: CustomResourceDefinition
33
metadata:
4-
name: arangobackups.backup.arangodb.com
4+
name: arangobackuppolicies.backup.arangodb.com
55
labels:
66
app.kubernetes.io/name: {{ template "kube-arangodb-crd.name" . }}
77
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
@@ -11,39 +11,28 @@ metadata:
1111
spec:
1212
group: backup.arangodb.com
1313
additionalPrinterColumns:
14-
- JSONPath: .spec.policyName
15-
description: Policy name
16-
name: Policy
14+
- JSONPath: .spec.schedule
15+
description: Schedule
16+
name: Schedule
1717
type: string
18-
- JSONPath: .spec.deployment.name
19-
description: Deployment name
20-
name: Deployment
21-
type: string
22-
- JSONPath: .status.backup.version
23-
description: Backup Version
24-
name: Version
25-
type: string
26-
- JSONPath: .status.backup.createdAt
27-
description: Backup Creation Timestamp
28-
name: Created
29-
type: string
30-
- JSONPath: .status.state
31-
description: The actual state of the ArangoBackup
32-
name: State
18+
- JSONPath: .status.scheduled
19+
description: Scheduled
20+
name: Scheduled
3321
type: string
3422
- JSONPath: .status.message
3523
priority: 1
36-
description: Message of the ArangoBackup object
24+
description: Message of the ArangoBackupPolicy object
3725
name: Message
3826
type: string
3927
names:
40-
kind: ArangoBackup
41-
listKind: ArangoBackupList
42-
plural: arangobackups
28+
kind: ArangoBackupPolicy
29+
listKind: ArangoBackupPolicyList
30+
plural: arangobackuppolicies
4331
shortNames:
44-
- arangobackup
45-
singular: arangobackup
32+
- arangobackuppolicy
33+
- arangobp
34+
singular: arangobackuppolicy
4635
scope: Namespaced
4736
version: v1alpha
4837
subresources:
49-
status: {}
38+
status: {}
Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: apiextensions.k8s.io/v1beta1
22
kind: CustomResourceDefinition
33
metadata:
4-
name: arangobackuppolicies.backup.arangodb.com
4+
name: arangobackups.backup.arangodb.com
55
labels:
66
app.kubernetes.io/name: {{ template "kube-arangodb-crd.name" . }}
77
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
@@ -11,28 +11,48 @@ metadata:
1111
spec:
1212
group: backup.arangodb.com
1313
additionalPrinterColumns:
14-
- JSONPath: .spec.schedule
15-
description: Schedule
16-
name: Schedule
14+
- JSONPath: .spec.policyName
15+
description: Policy name
16+
name: Policy
1717
type: string
18-
- JSONPath: .status.scheduled
19-
description: Scheduled
20-
name: Scheduled
18+
- JSONPath: .spec.deployment.name
19+
description: Deployment name
20+
name: Deployment
21+
type: string
22+
- JSONPath: .status.backup.version
23+
description: Backup Version
24+
name: Version
25+
type: string
26+
- JSONPath: .status.backup.createdAt
27+
description: Backup Creation Timestamp
28+
name: Created
29+
type: string
30+
- JSONPath: .status.backup.sizeInBytes
31+
description: Backup Size in Bytes
32+
name: Size
33+
type: integer
34+
format: byte
35+
- JSONPath: .status.backup.numberOfDBServers
36+
description: Backup Number of the DB Servers
37+
name: DBServers
38+
type: integer
39+
- JSONPath: .status.state
40+
description: The actual state of the ArangoBackup
41+
name: State
2142
type: string
2243
- JSONPath: .status.message
2344
priority: 1
24-
description: Message of the ArangoBackupPolicy object
45+
description: Message of the ArangoBackup object
2546
name: Message
2647
type: string
2748
names:
28-
kind: ArangoBackupPolicy
29-
listKind: ArangoBackupPolicyList
30-
plural: arangobackuppolicies
49+
kind: ArangoBackup
50+
listKind: ArangoBackupList
51+
plural: arangobackups
3152
shortNames:
32-
- arangobackuppolicy
33-
- arangobp
34-
singular: arangobackuppolicy
53+
- arangobackup
54+
singular: arangobackup
3555
scope: Namespaced
3656
version: v1alpha
3757
subresources:
38-
status: {}
58+
status: {}

chart/kube-arangodb/templates/backup-operator/role.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ rules:
1616
- apiGroups: [""]
1717
resources: ["pods", "services", "endpoints"]
1818
verbs: ["get", "update"]
19+
- apiGroups: [""]
20+
resources: ["events"]
21+
verbs: ["*"]
1922
- apiGroups: [""]
2023
resources: ["secrets"]
2124
verbs: ["get"]

docs/Manual/Deployment/Kubernetes/BackupResource.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ status:
114114
uploaded: true
115115
downloaded: true
116116
createdAt: "time"
117+
sizeInBytes: 1
118+
numberOfDBServers: 3
117119
available: true
118120
```
119121

@@ -331,6 +333,7 @@ Possible states:
331333
- "Ready" - state when Backup is finished
332334
- "Deleted" - state when Backup was once in ready, but has been deleted
333335
- "Failed" - state for failure
336+
- "Unavailable" - state when Backup is not available on the ArangoDB. It can happen in case of upgrades, node restarts etc.
334337

335338
### `status.time: timestamp`
336339

@@ -429,6 +432,22 @@ Required: true
429432

430433
Default: now()
431434

435+
#### `status.backup.sizeInBytes: uint64`
436+
437+
Size of the Backup in ArangoDB.
438+
439+
Required: true
440+
441+
Default: 0
442+
443+
#### `status.backup.numberOfDBServers: uint`
444+
445+
Cluster size of the Backup in ArangoDB.
446+
447+
Required: true
448+
449+
Default: 0
450+
432451
### `status.available: bool`
433452

434453
Determines if we can restore from ArangoBackup.

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/aktau/github-release v0.7.2 // indirect
1919
github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680
2020
github.com/arangodb/arangosync-client v0.6.3
21-
github.com/arangodb/go-driver v0.0.0-20190917135832-4ec315b17bf0
21+
github.com/arangodb/go-driver v0.0.0-20191002124627-11b6bfc64f67
2222
github.com/arangodb/go-upgrade-rules v0.0.0-20180809110947-031b4774ff21
2323
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
2424
github.com/bugagazavr/go-gitlab-client v0.0.0-20150830002541-e5999f934dc4 // indirect
@@ -62,6 +62,7 @@ require (
6262
github.com/juju/errgo v0.0.0-20140925100237-08cceb5d0b53 // indirect
6363
github.com/julienschmidt/httprouter v1.2.0
6464
github.com/manucorporat/stats v0.0.0-20180402194714-3ba42d56d227 // indirect
65+
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a // indirect
6566
github.com/mattn/go-colorable v0.1.1 // indirect
6667
github.com/mattn/go-isatty v0.0.7 // indirect
6768
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect

go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ github.com/arangodb/go-driver v0.0.0-20190806145426-48dd51aa0940 h1:CWLm7jOfT3v3
7171
github.com/arangodb/go-driver v0.0.0-20190806145426-48dd51aa0940/go.mod h1:5nMxlcbN6PHA05uGUw2EH6PIQHvdRVTrg/S/GM8jG4w=
7272
github.com/arangodb/go-driver v0.0.0-20190917135832-4ec315b17bf0 h1:OZAHgwP/X6eJlm33G94lo32j82acWZZvB2d/hbSAbTs=
7373
github.com/arangodb/go-driver v0.0.0-20190917135832-4ec315b17bf0/go.mod h1:5nMxlcbN6PHA05uGUw2EH6PIQHvdRVTrg/S/GM8jG4w=
74+
github.com/arangodb/go-driver v0.0.0-20191001090752-e07a8fe34b53 h1:gKOy8ZeLmAMWoCfZtXAwTpl9S3UxHjv8l4T96BvuXoQ=
75+
github.com/arangodb/go-driver v0.0.0-20191001090752-e07a8fe34b53/go.mod h1:5nMxlcbN6PHA05uGUw2EH6PIQHvdRVTrg/S/GM8jG4w=
76+
github.com/arangodb/go-driver v0.0.0-20191002081852-02f5e9c3a694 h1:Cn68e0b50vTJqku80erSNWddXixyyvzVOy7cgb4MKYw=
77+
github.com/arangodb/go-driver v0.0.0-20191002081852-02f5e9c3a694/go.mod h1:5nMxlcbN6PHA05uGUw2EH6PIQHvdRVTrg/S/GM8jG4w=
78+
github.com/arangodb/go-driver v0.0.0-20191002124627-11b6bfc64f67 h1:Nmcpj1EUYYOs3x/4F/4GH2nA8ooxkInWjOmbyOlw4bQ=
79+
github.com/arangodb/go-driver v0.0.0-20191002124627-11b6bfc64f67/go.mod h1:5nMxlcbN6PHA05uGUw2EH6PIQHvdRVTrg/S/GM8jG4w=
7480
github.com/arangodb/go-upgrade-rules v0.0.0-20180809110947-031b4774ff21 h1:+W7D5ttxi/Ygh/39vialtypE23p9KI7P0J2qtoqUV4w=
7581
github.com/arangodb/go-upgrade-rules v0.0.0-20180809110947-031b4774ff21/go.mod h1:RkPIG6JJ2pcJUoymc18NxAJGraZd+iAEVnOTDjZey/w=
7682
github.com/arangodb/go-velocypack v0.0.0-20190129082528-7896a965b4ad h1:Ah+VRYUWLuqgbfnDyuC8IrIe8XFzpt9tBVVnPGFNTJ8=
@@ -414,6 +420,8 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe h1:W/GaMY0y69G4cFl
414420
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
415421
github.com/manucorporat/stats v0.0.0-20180402194714-3ba42d56d227 h1:KIaAZ/V+/0/6BOULrmBQ9T1ed8BkKqGIjIKW923nJuo=
416422
github.com/manucorporat/stats v0.0.0-20180402194714-3ba42d56d227/go.mod h1:ruMr5t05gVho4tuDv0PbI0Bb8nOxc/5Y6JzRHe/yfA0=
423+
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a h1:+J2gw7Bw77w/fbK7wnNJJDKmw1IbWft2Ul5BzrG1Qm8=
424+
github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0=
417425
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
418426
github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg=
419427
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=

manifests/arango-backup.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ rules:
6666
- apiGroups: [""]
6767
resources: ["pods", "services", "endpoints"]
6868
verbs: ["get", "update"]
69+
- apiGroups: [""]
70+
resources: ["events"]
71+
verbs: ["*"]
6972
- apiGroups: [""]
7073
resources: ["secrets"]
7174
verbs: ["get"]
@@ -168,6 +171,9 @@ spec:
168171
operator: In
169172
values:
170173
- amd64
174+
hostNetwork: false
175+
hostPID: false
176+
hostIPC: false
171177
containers:
172178
- name: operator
173179
imagePullPolicy: Always
@@ -193,9 +199,12 @@ spec:
193199
- name: metrics
194200
containerPort: 8528
195201
securityContext:
196-
capabilities:
197-
drop:
198-
- 'ALL'
202+
privileged: false
203+
allowPrivilegeEscalation: false
204+
readOnlyRootFilesystem: true
205+
capabilities:
206+
drop:
207+
- 'ALL'
199208
livenessProbe:
200209
httpGet:
201210
path: /health

0 commit comments

Comments
 (0)