未使用自定义secret并且使用helm安装harhor证书过期处理方法

直接使用helm安装harbor,在secret中的harbor-ingress的证书有效期是1年,过期后的处理方法需要用helm卸载harhor,并用harbor在原配置的基础上再重装一次就可以解决。我承认这是个笨方法,也许还有别的办法,不过我这里是使用上述办法实验成功的。重装不用害怕数据丢失只要你之前harbor安装时数据已经持久化到存储或本地硬盘上了,一般重装不会丢数据。操作步骤如下:

//cd 到之前使用helm安装harbor的安装目录,之前使用正常,配置文件就不需要任何改动
helm uninstall harbor -n harbor
kubectl get secret -n harbor
kubectl delete secret harbor-ingress -n harbor
cd harbor
/***
    修改values.yaml
   
  # If true, the registry returns relative URLs in Location headers. The client is responsible for resolving the correct URL.
  relativeurls: true  //这里修改解决push反复Retrying 不能上传的问题

/***
helm install -n harbor harbor .
kubectl get secret harbor-ingress -n harbor -o jsonpath="{.data.ca\.crt}" | base64 --decode > ca.crt
//查看证书有效期命令 openssl x509 -in ca.crt -noout -dates
cp ca.crt /etc/docker/certs.d/core.harbor.shell.com:32042/
sudo systemctl daemon-reload
sudo systemctl restart docker

//检查ssl是否生效
sudo cp ca.crt /etc/ssl/certs/ca-certificates.crt
curl -u "admin:Harbor12345" -k -i -v https://core.harbor.shell.com:32042
200

你可能感兴趣的:(云原生)