Skip to content

Commit b2b983a

Browse files
srodenhuisjeho
andauthored
feat: Harbor backup (#343)
* fix: schema * fix: resources * feat: add databasePassword Co-authored-by: jeho <jehoszafat.zimnowoda@redkubes.com>
1 parent f0adf0b commit b2b983a

File tree

2 files changed

+107
-49
lines changed

2 files changed

+107
-49
lines changed

src/openapi/apps/harbor.yaml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ AppHarbor:
2626
# type: boolean
2727
# default: true
2828
# description: Will mark the main project named "library" as private.
29+
databasePassword:
30+
type: string
31+
description: Once set and deployed it cannot be changed with manual intervention.
32+
x-secret: 'randAlphaNum 20'
2933
core:
3034
type: object
3135
properties:
@@ -148,6 +152,18 @@ AppHarbor:
148152
required:
149153
- gcs
150154
- type
155+
backup:
156+
title: Backup Registry database
157+
description: Enabeling the registry backup will create a backup of the Harbor Registry database and store it in the Minio harbor bucket.
158+
type: object
159+
properties:
160+
enabled:
161+
type: boolean
162+
default: false
163+
schedule:
164+
default: 0 0 * * *
165+
description: Cron-type expression to schedule the backup. Defaults to once a day at 00:00.
166+
type: string
151167
registry:
152168
type: object
153169
properties:
@@ -192,26 +208,26 @@ AppHarbor:
192208
properties:
193209
cpu:
194210
$ref: ../definitions.yaml#/quantityCpu
195-
default: 100m
211+
default: 400m
196212
memory:
197213
$ref: ../definitions.yaml#/quantityMem
198-
default: 128Mi
214+
default: 256Mi
199215
requests:
200216
type: object
201217
properties:
202218
cpu:
203219
$ref: ../definitions.yaml#/quantityCpu
204-
default: 400m
220+
default: 100m
205221
memory:
206222
$ref: ../definitions.yaml#/quantityMem
207-
default: 256Mi
223+
default: 128Mi
208224
required:
209225
- limits
210226
- requests
211227
clair:
212228
type: object
213229
properties:
214-
limits:
230+
requests:
215231
type: object
216232
properties:
217233
cpu:
@@ -220,7 +236,7 @@ AppHarbor:
220236
memory:
221237
$ref: ../definitions.yaml#/quantityMem
222238
default: 1Gi
223-
requests:
239+
limits:
224240
type: object
225241
properties:
226242
cpu:
@@ -426,4 +442,6 @@ AppHarbor:
426442
required:
427443
- limits
428444
- requests
445+
required:
446+
- databasePassword
429447
required: [id]

src/values-schema.yaml

Lines changed: 83 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,17 @@ definitions:
127127
type: integer
128128
default: 1
129129
autoscalingEnabled:
130-
allOf:
131-
- properties:
132-
enabled:
133-
default: true
134-
type: boolean
135-
- $ref: '#/definitions/autoscaling'
130+
additionalProperties: false
131+
properties:
132+
enabled:
133+
default: true
134+
type: boolean
135+
maxReplicas:
136+
type: integer
137+
default: 10
138+
minReplicas:
139+
type: integer
140+
default: 1
136141
aws:
137142
definitions:
138143
accessKey:
@@ -735,8 +740,8 @@ definitions:
735740
pattern: '^[a-z0-9]+(?:[._-][a-z0-9]+)*$'
736741
type: string
737742
repoUrl:
738-
description: Path to a remote git repo without protocol. Will use https to access.
739-
pattern: '^(.+@)*([\w\d\.]+)(:[\d]+){0,1}/*(.*)$'
743+
description: Path to a remote git repo with or without protocol prefix of either https:// or file:// (https:// used if omitted)
744+
pattern: '^(https://|file://)?(.+@)*([\w\d\.]+)(:[\d]+){0,1}/*(.*)$'
740745
type: string
741746
repository:
742747
description: A container image repository.
@@ -1571,6 +1576,10 @@ properties:
15711576
adminPassword:
15721577
type: string
15731578
x-secret: ''
1579+
databasePassword:
1580+
type: string
1581+
description: Once set and deployed it cannot be changed with manual intervention.
1582+
x-secret: 'randAlphaNum 20'
15741583
core:
15751584
properties:
15761585
secret:
@@ -1650,8 +1659,8 @@ properties:
16501659
- aws
16511660
- azure
16521661
- gcs
1653-
- file
1654-
default: file
1662+
- filesystem
1663+
default: filesystem
16551664
registry:
16561665
properties:
16571666
secret:
@@ -1699,6 +1708,17 @@ properties:
16991708
secretKey:
17001709
type: string
17011710
x-secret: 'randAlpha 16'
1711+
backup:
1712+
properties:
1713+
enabled:
1714+
type: boolean
1715+
default: false
1716+
schedule:
1717+
default: 0 0 * * *
1718+
description: Cron-type expression to schedule the backup. Defaults to once a day at 00:00.
1719+
type: string
1720+
# required:
1721+
# - databasePassword
17021722
hello:
17031723
description: Hello world demo chart. When you turn this off you may also have to remove the ingress service.
17041724
properties:
@@ -2032,6 +2052,8 @@ properties:
20322052
external-secrets:
20332053
additionalProperties: false
20342054
properties:
2055+
_rawValues:
2056+
$ref: '#/definitions/rawValues'
20352057
enabled:
20362058
type: boolean
20372059
logLevel:
@@ -2079,40 +2101,42 @@ properties:
20792101
type: string
20802102
required:
20812103
- duration
2082-
aws:
2083-
type: object
2084-
azure:
2085-
description: Missing from docs but available with this schema.
2104+
storage:
20862105
properties:
2087-
account_key:
2088-
type: string
2089-
x-secret: ''
2090-
account_name:
2091-
type: string
2092-
container_name:
2106+
aws:
2107+
type: object
2108+
azure:
2109+
description: Missing from docs but available with this schema.
2110+
properties:
2111+
account_key:
2112+
type: string
2113+
x-secret: ''
2114+
account_name:
2115+
type: string
2116+
container_name:
2117+
type: string
2118+
type: object
2119+
bigtable:
2120+
type: object
2121+
cassandra:
2122+
type: object
2123+
gcs:
2124+
type: object
2125+
swift:
2126+
type: object
2127+
local:
2128+
type: object
2129+
storageType:
20932130
type: string
2094-
type: object
2095-
bigtable:
2096-
type: object
2097-
cassandra:
2098-
type: object
2099-
gcs:
2100-
type: object
2101-
swift:
2102-
type: object
2103-
local:
2104-
type: object
2105-
storageType:
2106-
type: string
2107-
enum:
2108-
- aws
2109-
- azure
2110-
- bigtable
2111-
- cassandra
2112-
- filesystem
2113-
- gcs
2114-
- swift
2115-
- local
2131+
enum:
2132+
- aws
2133+
- azure
2134+
- bigtable
2135+
- cassandra
2136+
- filesystem
2137+
- gcs
2138+
- swift
2139+
- local
21162140
v11StartDate:
21172141
description: Set this to a date just after deployment in case of an upgrade. (Otomi started at v9 with filesystem.)
21182142
title: Schema v11 start date
@@ -2167,7 +2191,7 @@ properties:
21672191
type: boolean
21682192
default: true
21692193
size:
2170-
type: string
2194+
$ref: '#/definitions/size'
21712195
default: 20Gi
21722196
oauth2-proxy:
21732197
additionalProperties: false
@@ -2188,6 +2212,9 @@ properties:
21882212
properties:
21892213
_rawValues:
21902214
$ref: '#/definitions/rawValues'
2215+
editorInactivityTimeout:
2216+
type: integer
2217+
default: 10
21912218
git:
21922219
additionalProperties: false
21932220
properties:
@@ -2516,6 +2543,7 @@ properties:
25162543
oneOf:
25172544
- title: AWS
25182545
description: Uses credentials when either a pair of id+key or a secret name is provided. Assumes node role otherwise.
2546+
additionalProperties: false
25192547
properties:
25202548
aws:
25212549
properties:
@@ -2541,18 +2569,21 @@ properties:
25412569
required:
25422570
- aws
25432571
- title: Azure
2572+
additionalProperties: false
25442573
properties:
25452574
azure:
25462575
$ref: '#/definitions/azure/definitions/dns'
25472576
required:
25482577
- azure
25492578
- title: Azure Private
2579+
additionalProperties: false
25502580
properties:
25512581
azure-private-dns:
25522582
$ref: '#/definitions/azure/definitions/dns'
25532583
required:
25542584
- azure-private-dns
25552585
- title: Google
2586+
additionalProperties: false
25562587
properties:
25572588
google:
25582589
properties:
@@ -2565,6 +2596,7 @@ properties:
25652596
required:
25662597
- google
25672598
- title: Digital Ocean
2599+
additionalProperties: false
25682600
properties:
25692601
digitalocean:
25702602
properties:
@@ -2576,6 +2608,7 @@ properties:
25762608
required:
25772609
- digitalocean
25782610
- title: CloudFlare
2611+
additionalProperties: false
25792612
properties:
25802613
cloudflare:
25812614
properties:
@@ -2603,6 +2636,7 @@ properties:
26032636
required:
26042637
- cloudflare
26052638
- title: Other
2639+
additionalProperties: false
26062640
properties:
26072641
other:
26082642
description: This option requires configuration for both external-dns as well as cert-manager. No schema validation is available so provide correct data.
@@ -3091,6 +3125,12 @@ properties:
30913125
patternProperties:
30923126
'^[a-z0-9]([-a-z0-9]*[a-z0-9])+$':
30933127
$ref: '#/definitions/team'
3128+
properties:
3129+
admin:
3130+
properties:
3131+
password:
3132+
type: string
3133+
x-secret: randAlpha 16
30943134
version:
30953135
type: integer
30963136
description: DO NOT CHANGE! Holds the values-schema version. For more details, see `otomi migrate`.

0 commit comments

Comments
 (0)