Skip to content

Commit ded27c2

Browse files
author
rulin
committed
update
1 parent 1300059 commit ded27c2

14 files changed

+465
-235
lines changed

harbor/Harbor-HA-with-aliyun-OSS.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
| OSS | my-harbor-registry.oss-cn-beijing.aliyuncs.com | - | harbor-storage |
1212
| SLB | 123.123.123.123/192.168.10.12 | - | 公网+私网 |
1313

14-
15-
1614
## Harbor 配置
1715

1816
### PostgreSQL 数据库

harbor/Harbor-HA.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Harbor HA
2+
3+
本文档指导在IDC中基于离线模式部署高可用 Harbor。
4+
5+
## 资源
6+
7+
### 服务器信息
8+
| 类型 | 地址/名称 | 配置 | 备注 |
9+
| -- | -- | -- | -- |
10+
| VM | 192.168.10.11 | 4C/8G/100G | nginx-proxy-1, VIP 192.168.10.10 |
11+
| VM | 192.168.10.12 | 4C/8G/100G | nginx-proxy-2 |
12+
| VM | 192.168.10.11 | 2C/8G/100G | Harbor Server 1 |
13+
| VM | 192.168.10.12 | 2C/8G/100G | Harbor Server 2 |
14+
15+
16+
17+
18+
19+
## 准备
20+
21+
### PostgreSQL 数据库
22+
23+
24+
TODO: PG HA
25+
26+
### 下载安装包
27+
28+
29+
30+
### Harbor 配置文件
31+
32+
复制 harbor 安装包内的 harbor.yml.tmpl 为 harbor.yml, 并做如下修改。
33+
34+
```yaml
35+
hostname: registry.myharbor.com
36+
http:
37+
port: 80
38+
https:
39+
port: 443
40+
certificate: /data/harbor/ssl/myharbor.com.pem
41+
private_key: /data/harbor/ssl/myharbor.com.key
42+
harbor_admin_password: Harbor.123456
43+
data_volume: /data/harbor
44+
storage_service:
45+
46+
```
47+
48+
49+
50+
### 生成配置
51+
52+
执行如下命令生成相关配置。
53+
54+
```shell
55+
./prepare --with-trivy
56+
```
57+
58+
59+
### 配置 SELinux 策略
60+
61+
> 允许容器访问生成的配置文件。
62+
```shell
63+
chcon -R -u system_u -t container_file_t /data/in/harbor/common
64+
```
65+
66+
67+
## 部署
68+
69+
##### [安装 Docker-CE](https://github.com/Statemood/documents/blob/master/docker/how-install-docker-ce.md)
70+
71+
72+
##### 安装并启动 Harbor
73+
74+
```shell
75+
./install.sh --with-trivy
76+
```
77+
78+
79+
80+
81+
82+
查看状态
83+
84+
```shell
85+
docker ps -a
86+
```
87+
88+
如有不能启动的容器, 通过 /data/harbor/log 目录下日志进行排查。
89+
90+
91+
92+
### 防火墙
93+
94+
iptables -A INPUT -p tcp -d 192.168.10.12 --dport 80 -j ACCEPT
95+
iptables -A INPUT -p tcp -d 192.168.10.12 --dport 443 -j ACCEPT
96+
97+
98+
99+
### 附录
100+
101+
- #### 参考引用
102+
103+
[1]. [Harbor High Availability Guide](https://github.com/vmware/harbor/blob/master/docs/high_availability_installation_guide.md)
104+
105+
[2]. [Harbor HA solution proposals #3582](https://github.com/vmware/harbor/issues/3582)
106+
107+
[3]. [Docker push through nginx proxy fails trying to send a 32B layer #970](https://github.com/docker/distribution/issues/970)
108+
109+
110+
111+
112+
113+
- #### 致谢
114+
- 感谢 Habor 开源项目群2 提供技术支持
115+
- 特别感谢 yixing@VMware

kubernetes/install/091.config-kernel-parameters.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ EOF
5656
按如下配置修改 */etc/sysctl.d/99-k8s.conf,* 并执行 `sysctl -p` 生效。
5757

5858
```shell
59+
cat << EOF > /etc/sysctl.d/99-k8s.conf
5960
# sysctl settings are defined through files in
6061
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
6162
#
@@ -78,4 +79,5 @@ net.bridge.bridge-nf-call-ip6tables = 1
7879
7980
vm.max_map_count = 500000
8081
vm.swappiness = 0
82+
EOF
8183
```

0 commit comments

Comments
 (0)