【云原生运维问题记录】kubesphere登录不跳转问题

文章目录

结论先行:kubesphere-system名称空间下reids宕机重启,会判断是否通过registry-proxy重新拉取镜像,该镜像原本是通过阿里云上拉取,代理上没有出现超时情况,导致失败。
解决方案:删除registry-proxy或修改registry-proxy配置

现象

kubesphere控制台点击登录不跳转
image.png

问题排查

  1. 查看kubesphere-system空间情况
kubectl get all -n kubesphere-system

发现redis没起来

  1. kubesphere控制台模块ks-console,查看日志确认问题是什么引起
kubectl logs <ks-console> -n kubesphere-system

image.png
结论:reids没起来导致的kubesphere登录不上

  1. 定位reids启动失败原因

由于reids pod没有创建 只能通过事件定位,查看kubesphere-system空间下事件

kubectl get events  -n kubesphere-system

image.png

m27s       Warning   FailedCreate        replicaset/redis-57f4b4584b                       Error creating: Internal error occurred: failed calling webhook "registry-proxy.registry-proxy.svc": failed to call webhook: Post "https://registry-proxy.registry-proxy.svc:443/mutate?timeout=3s": dial tcp 10.20.3.39:443: connect: connection refused

失败原因是通过registry-proxy调用错误,卸载registry-proxy,删除registry-proxy命名空间下所有资源,看是否恢复

  1. 卸载registry-proxy

卸载参考:https://ketches.cn/registry-proxy/

  1. 修改reids副本,重启
kubectl scale deployment redis --replicas=0 -n kubesphere-system
kubectl scale deployment redis --replicas=1 -n kubesphere-system
  1. 查看部署情况
kubectl get deployments -n kubesphere-system

image.png

  1. 再次登录成功

image.png

  1. registry-proxy用途还是比较大的,采用修改配置解决上述问题

配置参考:https://ketches.cn/registry-proxy/
修改默认配置:excludeNamespaces中添加kubesphere-system

apiVersion: v1
kind: ConfigMap
metadata:
  name: registry-proxy-config
  namespace: registry-proxy
data:
  config.yaml: |
    enabled: true
    proxies:
      docker.io: docker.ketches.cn
      registry.k8s.io: k8s.ketches.cn
      quay.io: quay.ketches.cn
      ghcr.io: ghcr.ketches.cn
      gcr.io: gcr.ketches.cn
      k8s.gcr.io: k8s-gcr.ketches.cn
      docker.cloudsmith.io: cloudsmith.ketches.cn
    excludeNamespaces:
    - kube-system
    - kube-public
    - kube-node-lease
    - registry-proxy
    - kubesphere-system
    includeNamespaces:
    - *
  • 12
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值