Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure a highly available Harbor image repository for Harbor2.0

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "how Harbor2.0 configures a high-availability Harbor image repository". It is easy to understand and well-organized. I hope it can help you solve your doubts. Let the editor lead you to study and learn this article "how Harbor2.0 configures a high-availability Harbor image repository".

Replication Adapters

Harbor provides mirror replication between harbor and non-harbor services. By replicating mirrors, private images on DockerHub can be synchronized locally in batches, or multiple Harbor instances can be synchronized so that multiple copies of images and high availability of data can be achieved. As shown in the following figure, Harbor supports synchronization with well-known image repositories such as harbor, query.io, Docker-hub, and between helm charts such as helm-hub:

Let's take a look at the mirror replication function of Harbor through synchronization between harbor and harbor instances.

Harbor To Harbor

Based on the enterprise practice of Harbor open source image warehouse in the previous section, a harbor instance with the domain name harbor.devopsman.cn is installed, a new instance is installed in the same way, and its domain name is configured as harbor.kubemaster.top. We synchronize the image devopsman/kube-proxy:v1.18.0 images pushed to harbor.devopsman.cn in the previous section to harbor.kubemaster.top, after preparing these environments. Let's start configuring synchronization between mirrors.

First, add a repository target to harbor.kubemaster.top, as shown in the following figure. After configuring the address, user name and password of the current image repository, click Test Save.

Then, in the replication management office under system management, add a new replication policy, as shown below:

Select the harbor instance that we configured in the warehouse management office at the source mirror warehouse, and then configure the source resource filter information. The matching information is as follows, where (Y) indicates legal, and (N) indicates invalid.

PatternString (Match or not) library/*library/hello-world (Y) library/my/hello-world (N) library/**library/hello-world (Y) library/my/hello-world (Y) {library,goharbor} / * * library/hello-world (Y) goharbor/harbor-core (Y) google/hello-world (N) 1.31 (Y) 1.01 (N)

Then fill in the custom filter rules and save them. Then, in the replication management function, locate and select the replication rule you just created, and click copy:

In this way, the replication is triggered manually, and its status is InProgress. If we click on the corresponding task ID, we can see more replication information, such as success status information, synchronized log information, etc.

In this way, the mirrors in the target private mirror repository are synchronized, and harbor also supports scheduled task synchronization, which implements automatic synchronization of mirrors between private mirror repositories according to the syntax rules of cron.

Harbor High availability

If you want to ensure the high availability of harbor instance data, you can configure synchronization policies among multiple harbor through replication management. If a mirror is pushed on any instance based on push mode, it will be automatically synchronized to other instances. Combined with the scheduled task of cron, you can basically realize the high availability of harbor data to avoid irretrievable data caused by a single instance.

These are all the contents of the article "how to configure a highly available Harbor Image Repository for Harbor2.0". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report