Skip to content

Commit b275fea

Browse files
committed
📚 Sync docs from alaudadevops/harbor-ce-operator on d92f4753ab9587c6224505626db3fb10d1375b85
Source: doc: add documentation for snapshot-based backup (#131) Author: nanjingfm Ref: refs/heads/main Commit: d92f4753ab9587c6224505626db3fb10d1375b85 This commit automatically syncs documentation changes from the source-docs repository. 🔗 View source commit: AlaudaDevops/harbor-ce-operator@d92f475 🤖 Synced on 2025-08-21 04:34:03 UTC
1 parent 10ed8a9 commit b275fea

7 files changed

Lines changed: 3679 additions & 2840 deletions

File tree

‎.github/SYNC_INFO.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Documentation Sync Information
22

3-
- **Last synced**: 2025-08-13 06:36:49 UTC
3+
- **Last synced**: 2025-08-21 04:34:03 UTC
44
- **Source repository**: alaudadevops/harbor-ce-operator
5-
- **Source commit**: [258a67084dbd367a13cc3105bafe0027e5b4e5bc](https://github.com/alaudadevops/harbor-ce-operator/commit/258a67084dbd367a13cc3105bafe0027e5b4e5bc)
6-
- **Triggered by**: yuzichen12123
7-
- **Workflow run**: [#11](https://github.com/alaudadevops/harbor-ce-operator/actions/runs/16929547208)
5+
- **Source commit**: [d92f4753ab9587c6224505626db3fb10d1375b85](https://github.com/alaudadevops/harbor-ce-operator/commit/d92f4753ab9587c6224505626db3fb10d1375b85)
6+
- **Triggered by**: nanjingfm
7+
- **Workflow run**: [#14](https://github.com/alaudadevops/harbor-ce-operator/actions/runs/17117180755)
88

99
## Files synced:
1010
- docs/

‎docs/en/howto/04_backup_and_restore_using_velero.mdx‎

Lines changed: 153 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ mc alias set ${MINIO_ALIAS_NAME} ${MINIO_HOST} ${MINIO_ACCESS_KEY} ${MINIO_SECRE
5555
mc ping ${MINIO_ALIAS_NAME}
5656

5757
# Example output:
58-
# 1: http://192.168.131.56:32571:32571 min=98.86ms max=98.86ms average=98.86ms errors=0 roundtrip=98.86ms
59-
# 2: http://192.168.131.56:32571:32571 min=29.57ms max=98.86ms average=64.21ms errors=0 roundtrip=29.57ms
60-
# 3: http://192.168.131.56:32571:32571 min=29.57ms max=98.86ms average=52.77ms errors=0 roundtrip=29.88ms
58+
# 1: http://192.168.131.56:32571:32571 min=98.86ms max=98.86ms average=98.86ms errors=0 roundtrip=98.86ms
59+
# 2: http://192.168.131.56:32571:32571 min=29.57ms max=98.86ms average=64.21ms errors=0 roundtrip=29.57ms
60+
# 3: http://192.168.131.56:32571:32571 min=29.57ms max=98.86ms average=52.77ms errors=0 roundtrip=29.88ms
6161
```
6262

6363
If you can successfully ping the MinIO instance, it means mc is configured correctly.
@@ -205,6 +205,104 @@ kubectl wait --for=condition=ready pod -n ${HARBOR_NAMESPACE} ${HARBOR_NAME}-bac
205205
# pod/xxxx-harbor-backup-pod condition met
206206
```
207207

208+
#### Create Backup Volume Policy
209+
210+
Volume policy is used to specify the backup method for PVCs. The default policy is to backup PVCs using the `fs-backup` method.
211+
212+
```bash
213+
export BACKUP_POLICY_NAME=${BACKUP_POLICY_NAME:-harbor-backup}
214+
export VELERO_BACKUP_REPO_NAME=${VELERO_BACKUP_REPO_NAME:-backup}
215+
216+
kubectl apply -f - <<EOF
217+
apiVersion: v1
218+
kind: ConfigMap
219+
metadata:
220+
name: ${BACKUP_POLICY_NAME}-volume-policy
221+
namespace: cpaas-system
222+
data:
223+
resourcepolicies: |
224+
version: v1
225+
volumePolicies:
226+
- conditions:
227+
csi: {}
228+
action:
229+
type: fs-backup
230+
- conditions:
231+
csi: {}
232+
action:
233+
type: fs-backup
234+
EOF
235+
236+
# Output
237+
# configmap/harbor-backup-volume-policy created
238+
```
239+
240+
If the PVC supports snapshot, you can use snapshot to backup pvc to speed up backup. You need to modify the volume policy configmap to specify that the storage class uses snapshot for backup. For example, if the `ceph` storage class supports snapshot backup, you need to add the following configuration (the added condition should be placed at the top to get higher priority):
241+
242+
[How to determine if the PVC supports snapshot?](./04_backup_and_restore_using_velero.mdx#how_to_determine_if_the_pvc_supports_snapshot)
243+
244+
:::warning
245+
246+
**If you use pvc snapshot backup, you cannot change the storage class when restoring. Please adjust the storage class according to the actual situation.**
247+
248+
:::
249+
250+
```diff
251+
apiVersion: v1
252+
kind: ConfigMap
253+
metadata:
254+
name: ${BACKUP_POLICY_NAME}-volume-policy
255+
namespace: cpaas-system
256+
data:
257+
resourcepolicies: |
258+
version: v1
259+
volumePolicies:
260+
+ - conditions:
261+
+ storageClass:
262+
+ - ceph
263+
+ action:
264+
+ type: snapshot
265+
- conditions:
266+
csi: {}
267+
action:
268+
type: fs-backup
269+
- conditions:
270+
csi: {}
271+
action:
272+
type: fs-backup
273+
```
274+
275+
:::warning
276+
277+
If the velero is not enabled CSI snapshot, you will get the following error when backup:
278+
279+
```
280+
Skip action velero.io/csi-pvc-backupper for resource persistentvolumeclaims:xxx, because the CSI feature is not enabled.
281+
```
282+
283+
To fix this, you need to add `--features=EnableCSI` parameter to the velero deployment.
284+
285+
```diff
286+
apiVersion: apps/v1
287+
kind: Deployment
288+
metadata:
289+
name: velero
290+
spec:
291+
template:
292+
spec:
293+
containers:
294+
- args:
295+
- server
296+
- --uploader-type=restic
297+
+ - --features=EnableCSI
298+
- --namespace=cpaas-system
299+
command:
300+
- /velero
301+
name: velero
302+
```
303+
304+
:::
305+
208306
#### Execute Backup
209307

210308
Run the following commands to create a backup schedule and trigger a backup job:
@@ -228,6 +326,9 @@ spec:
228326
- ${HARBOR_NAMESPACE}
229327
includedResources:
230328
- '*'
329+
resourcePolicy:
330+
kind: configmap
331+
name: ${BACKUP_POLICY_NAME}-volume-policy
231332
storageLocation: ${VELERO_BACKUP_REPO_NAME}
232333
ttl: 720h0m0s
233334
EOF
@@ -249,6 +350,9 @@ spec:
249350
includedResources:
250351
- "*"
251352
itemOperationTimeout: 4h0m0s
353+
resourcePolicy:
354+
kind: configmap
355+
name: ${BACKUP_POLICY_NAME}-volume-policy
252356
snapshotMoveData: false
253357
storageLocation: ${VELERO_BACKUP_REPO_NAME}
254358
ttl: 720h0m0s
@@ -462,6 +566,8 @@ spec:
462566
- secrets
463567
- pods
464568
- harbors.operator.alaudadevops.io
569+
- volumesnapshots
570+
- volumesnapshotcontents
465571
itemOperationTimeout: 10h0m0s
466572
namespaceMapping:
467573
${HARBOR_NAMESPACE}: ${NEW_HARBOR_NAMESPACE}
@@ -551,3 +657,47 @@ After the instance status returns to normal, log in to HARBOR to check whether t
551657

552658
At the same time, disable the read-only mode for the restored Harbor instance (log in to Harbor and uncheck Administration -> Configuration -> System Settings -> Repository Read Only).
553659

660+
## Q & A
661+
662+
### How to determine if the PVC supports snapshot? \{#how_to_determine_if_the_pvc_supports_snapshot}
663+
664+
To determine whether a PVC supports snapshot, you need to check if its underlying StorageClass supports snapshot functionality. A PVC supports snapshot if there is a VolumeSnapshotClass in the cluster whose `driver` matches the StorageClass's `provisioner`. If such a VolumeSnapshotClass exists, the StorageClass (and therefore the PVC) supports snapshot functionality.
665+
666+
**Example Configuration:**
667+
668+
```
669+
apiVersion: storage.k8s.io/v1
670+
kind: StorageClass
671+
metadata:
672+
name: ceph
673+
provisioner: rook-ceph.cephfs.csi.ceph.com
674+
parameters:
675+
clusterID: rook-ceph
676+
csi.storage.k8s.io/controller-expand-secret-name: rook-csi-cephfs-provisioner
677+
csi.storage.k8s.io/controller-expand-secret-namespace: rook-ceph
678+
csi.storage.k8s.io/node-stage-secret-name: rook-csi-cephfs-node
679+
csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph
680+
csi.storage.k8s.io/provisioner-secret-name: rook-csi-cephfs-provisioner
681+
csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph
682+
fsName: cephfs
683+
pool: cephfs-data0
684+
reclaimPolicy: Delete
685+
volumeBindingMode: Immediate
686+
allowVolumeExpansion: true
687+
---
688+
apiVersion: snapshot.storage.k8s.io/v1
689+
kind: VolumeSnapshotClass
690+
metadata:
691+
name: csi-cephfs-snapshotclass
692+
deletionPolicy: Delete
693+
driver: rook-ceph.cephfs.csi.ceph.com
694+
parameters:
695+
clusterID: rook-ceph
696+
csi.storage.k8s.io/snapshotter-secret-name: rook-csi-cephfs-provisioner
697+
csi.storage.k8s.io/snapshotter-secret-namespace: rook-ceph
698+
```
699+
700+
**Key Points:**
701+
- StorageClass `provisioner` must exactly match VolumeSnapshotClass `driver`
702+
- Both resources must exist in the cluster
703+
- The CSI driver must support snapshot operations

‎docs/en/howto/05_template.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ The tool deployment template is defined and managed through the ConfigMap resour
2121
2. UI dynamic form: Defines the form items that the user needs to fill in when deploying the tool
2222
3. Deployment template: Contains the specific resource definitions required for tool deployment
2323

24+
{/* lint ignore code-block-split-list */}
25+
2426
```yaml
2527
apiVersion: v1
2628
kind: ConfigMap

‎docs/en/trouble_shooting/01_modify_project_permissions_error.mdx‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ rfr-acl-harbor-harbor-demo1-redis-operator harbor-harbor-demo1-redis operato
3737

3838
```
3939

40-
- before changed
40+
Before changed:
4141

4242
``` yaml
4343
# ...
@@ -55,7 +55,7 @@ status:
5555
```
5656
5757
58-
- after changed
58+
After changed:
5959
6060
``` yaml
6161
# ...
@@ -83,4 +83,3 @@ Due to the `keys` command scanning all indexes and causing the Redis service to
8383
## Related Content
8484

8585
- https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/
86-

‎docs/en/upgrade/01_upgrade_2.6.4_to_2.12.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ If the original instance is deployed with a storage class, the PVC names are fix
289289
* registry: `<instance name>-harbor-registry`
290290
* trivy: `data-<instance name>-harbor-trivy-0`
291291

292+
<!-- lint ignore code-block-split-list -->
293+
292294
```yaml
293295
# New instance configuration
294296
helmValues:
@@ -391,10 +393,10 @@ helmValues:
391393

392394
1. Check all Pod statuses:
393395

394-
```bash
395-
export INSTANCE_NAME=<harbor instance name> INSTANCE_NAMESPACE=<harbor instance namespace>
396-
kubectl get pods -n ${INSTANCE_NAMESPACE} -l release=${INSTANCE_NAME}
397-
```
396+
```bash
397+
export INSTANCE_NAME=<harbor instance name> INSTANCE_NAMESPACE=<harbor instance namespace>
398+
kubectl get pods -n ${INSTANCE_NAMESPACE} -l release=${INSTANCE_NAME}
399+
```
398400

399401
2. Verify Harbor service is accessible:
400402
* Access Harbor Web UI, verify existing projects and images are visible

‎package.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"devDependencies": {
3-
"@alauda/doom": "^0.23.5",
4-
"typescript": "^5.8.2"
3+
"@alauda/doom": "^1.10.9",
4+
"typescript": "^5.9.2"
55
},
66
"scripts": {
77
"dev": "doom dev",
88
"build": "doom build",
9+
"lint": "doom lint",
910
"serve": "doom serve",
1011
"translate": "doom translate"
1112
},

0 commit comments

Comments
 (0)