近期彤哥在研究k8s的东西,今天使用helm装了一个harbor之后,通过NodePort方式暴露了一个端口出去,结果死活登录不上,一直提示“用户名或密码错误”:
最后,查遍各种资料,才发现k8s中的harbor暂时只支持ingress方式访问,其实在装harbor的时候默认已经配置好了ingress:
[root@master ~]# kubectl get ingress -n harbor
NAME HOSTS ADDRESS PORTS AGE
harbor-harbor-ingress core.harbor.domain,notary.harbor.domain 80, 443 85m
[root@master ~]# kubectl edit ingress harbor-harbor-ingress -n harbor
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/proxy-body-size: "0"
ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "0