helm安装harbor

安装步骤

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
[root@exxk ~]# helm repo add harbor https://helm.goharbor.io
#下载harbor相关配置到当前目录
[root@exxk ~]# helm fetch harbor/harbor --untar
[root@exxk ~]# cd harbor/
[root@exxk harbor]# ls
Chart.yaml LICENSE README.md templates values.yaml
#前提,需要有挂载卷
1. 创建nfs,参考https://www.iexxk.com/2022/07/26/k8s-nfs/?highlight=nfs#%E5%88%9B%E5%BB%BAnfs%E6%9C%8D%E5%8A%A1
2. 创建 StorageClass
....
kind: StorageClass
metadata:
annotations:
k8s.kuboard.cn/storageType: nfs_client_provisioner
name: nfs-172.16.30.165
reclaimPolicy: Delete
volumeBindingMode: Immediate
##创建空间
[root@exxk harbor]# kubectl create namespace harbor
##修改values.yaml
# expose:tls:enable 设置为false #关闭证书
# ingress:hosts:core: 设置为harbor.iexxk.io #根据自己的域名后缀来
# externalURL: 设置为自己实际的访问地址harbor.iexxk.io
# ingress:className: 设置为myingress #根据自己的ingressClassName来
# storageClass设置为刚刚创建的nfs-172.16.30.165
[root@exxk harbor]# helm install my-harbor . -n harbor
NAME: my-harbor
LAST DEPLOYED: Wed Sep 27 14:47:16 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Please wait for several minutes for Harbor deployment to complete.
Then you should be able to visit the Harbor portal at https://core.harbor.domain
For more details, please visit https://github.com/goharbor/harbor
#卸载
[root@exxk ~]# helm uninstall my-harbor -n harbor

通过harbor.iexxk.io进行访问,注意进行域名映射,默认登录用户名密码admin/Harbor12345

问题

  1. 登录输入正确密码也提示密码错误

    1
    2
    3
    4
    5
    6
    7
    8
    Request URL:
    http://harbor.iexxk.io/c/login
    Request Method:
    POST
    Status Code:
    403 Forbidden
    接口返回
    {"errors":[{"code":"FORBIDDEN","message":"CSRF token invalid"}]}

    解决:修改externalURL: https://core.harbor.domain为自己实际的访问地址`harbor.iexxk.io`