mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-19 09:11:30 +02:00
32 lines
2.1 KiB
Markdown
32 lines
2.1 KiB
Markdown
# Create Replication Rules
|
|
|
|
Login as a system administrator user, click `NEW REPLICATION RULE` under `Administration->Replications` and fill in the necessary fields. You can choose different replication modes, [resource filters](#resource-filter) and [trigger modes](#trigger-mode) according to the different requirements. If there is no endpoint available in the list, follow the instructions in the [Creating replication endpoints](#creating-replication-endpoints) to create one. Click `SAVE` to create a replication rule.
|
|
|
|
![browse project](../../img/create_rule.png)
|
|
|
|
#### Resource filter
|
|
Three resource filters are supported:
|
|
* **Name**: Filter resources according to the name.
|
|
* **Tag**: Filter resources according to the tag.
|
|
* **Resource**: Filter images according to the resource type.
|
|
|
|
The terms supported in the pattern used by name filter and tag filter are as follows:
|
|
* **\***: Matches any sequence of non-separator characters `/`.
|
|
* **\*\***: Matches any sequence of characters, including path separators `/`.
|
|
* **?**: Matches any single non-separator character `/`.
|
|
* **{alt1,...}**: Matches a sequence of characters if one of the comma-separated alternatives matches.
|
|
|
|
**Note:** `library` must be added if you want to replicate the official images of Docker Hub. For example, `library/hello-world` matches the official hello-world images.
|
|
|
|
Pattern | String(Match or not)
|
|
---------- | -------
|
|
`library/*` | `library/hello-world`(Y)<br> `library/my/hello-world`(N)
|
|
`library/**` | `library/hello-world`(Y)<br> `library/my/hello-world`(Y)
|
|
`{library,goharbor}/**` | `library/hello-world`(Y)<br> `goharbor/harbor-core`(Y)<br> `google/hello-world`(N)
|
|
`1.?` | `1.0`(Y)<br> `1.01`(N)
|
|
|
|
#### Trigger mode
|
|
* **Manual**: Replicate the resources manually when needed. **Note**: The deletion operations are not replicated.
|
|
* **Scheduled**: Replicate the resources periodically. **Note**: The deletion operations are not replicated.
|
|
* **Event Based**: When a new resource is pushed to the project, it is replicated to the remote registry immediately. Same to the deletion operation if the `Delete remote resources when locally deleted` checkbox is selected.
|