• 安装部署
  • KubeKey安装kubesphere和kubernetes后,刚开始网页能打开并登陆,过了一会儿登录页就打不开了

操作系统信息
虚拟机 Centos 8.4.2105 8核16G
Kubernetes版本信息
v1.20.4 单节点
KubeSphere版本信息
在线安装。全套安装。
./kk create cluster –with-kubernetes v1.20.4 –with-kubesphere v3.1.1

按这篇教程步骤:https://kubesphere.com.cn/docs/quick-start/all-in-one-on-linux/
安装完成后,看日志也没有报错,显示安装成功,访问30880端口,能打开页面并登陆, 过了一会儿,再访问30880端口就访问不了了。
安装完成后
执行 kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l app=ks-install -o jsonpath=‘{.items[0].metadata.name}’) -f
日志如下:

大佬们帮我分析分析什么原因?

ping是能ping通的

服务器本地 30880端口也是有的

但是 telnet 127.0.0.1 30880端口却不通,一直卡着,也不报超时,也不通。。。

  • hongming 我知道原因了。。。 我本地开了代理。。,把代理关了就正常能访问了。。

lidapao

看看返回的报文

curl 172.16.110.230:30880 -v

    hongming curl 172.16.110.230:30880 -v

    • Rebuilt URL to: 172.16.110.230:30880/
    • Trying 172.16.110.230…
    • TCP_NODELAY set
    • Connected to 172.16.110.230 (172.16.110.230) port 30880 (#0)

    GET / HTTP/1.1
    Host: 172.16.110.230:30880
    User-Agent: curl/7.61.1
    Accept: /

    < HTTP/1.1 302 Found
    < Vary: Accept-Encoding
    < Location: /login
    < Content-Type: text/html; charset=utf-8
    < Content-Length: 43
    < Date: Mon, 19 Jul 2021 09:45:29 GMT
    < Connection: keep-alive
    < Keep-Alive: timeout=5
    <

    • Connection #0 to host 172.16.110.230 left intact
      Redirecting to <a href=“/login”>/login</a>.

    lidapao

    再看看响应是否正常,检查一下 kubesphere-system 下的 pod 是否都正常 running

    curl -Lv 172.16.110.230:30880 

      hongming kubectl get pods -n kubesphere-system 有4个pod 都是running状态
      [root@k8s-master kubekey]# kubectl get pods -n kubesphere-system
      NAME READY STATUS RESTARTS AGE
      ks-apiserver-b48fb4df5-xqmwn 1/1 Running 0 15m
      ks-console-58b965dbf5-z74hm 1/1 Running 0 17m
      ks-controller-manager-5677b46469-ph999 1/1 Running 0 15m
      ks-installer-769994b6ff-nh2p5 1/1 Running 0 18m

      hongming
      curl -Lv 172.16.110.230:30880 返回结果:


       
       Trying 172.16.110.230...
       TCP_NODELAY set
       * Connected to 172.16.110.230 (172.16.110.230) port 30880 (#0)
       GET / HTTP/1.1
       Host: 172.16.110.230:30880
       > User-Agent: curl/7.64.1
       > Accept: */*
       >
       < HTTP/1.1 302 Found
       < Vary: Accept-Encoding
       < Location: /login
       < Content-Type: text/html; charset=utf-8
       < Content-Length: 43
       < Date: Thu, 22 Jul 2021 08:09:04 GMT
       < Connection: keep-alive
       < Keep-Alive: timeout=5
       <
       * Ignoring the response-body
       * Connection #0 to host 172.16.110.230 left intact
       * Issue another request to this URL: 'http://172.16.110.230:30880/login'
       * Found bundle for host 172.16.110.230: 0x7f959af0e1d0 [can pipeline]
       * Could pipeline, but not asked to!
       * Re-using existing connection! (#0) with host 172.16.110.230
       * Connected to 172.16.110.230 (172.16.110.230) port 30880 (#0)
       > GET /login HTTP/1.1
       > Host: 172.16.110.230:30880
       > User-Agent: curl/7.64.1
       > Accept: */*
       >
       < HTTP/1.1 200 OK
       < Vary: Accept-Encoding
       < Set-Cookie: referer=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; httponly
       < Content-Type: text/html; charset=utf-8
       < Content-Length: 15564
       < Date: Thu, 22 Jul 2021 08:09:04 GMT
       < Connection: keep-alive
       < Keep-Alive: timeout=5
       <
       
       <!DOCTYPE html>
       <html lang="en">
         <head>
           <meta charset="UTF-8" />
           <meta
             name="viewport"
             content="width=device-width, initial-scale=1, shrink-to-fit=no"
           />
           <meta http-equiv="X-UA-Compatible" content="ie=edge" />
           <title>KubeSphere</title>
           <link rel="icon" href="/assets/favicon.ico" type="image/x-icon" />
           <style>
             html {
         background-color: #eff4f9;
       }
       
       body {
         padding: 0;
         margin: 0;
       }
       
       @keyframes loading {
         from {
           transform: rotate(0deg);
         }
       
         to {
           transform: rotate(360deg);
         }
       }
       
       .loadBox {
         width: 100vw;
         height: 100vh;
         display: flex;
         justify-content: center;
         align-items: center;
       }
       
       .pageLoading {
         height: 32px;
         animation: loading 1.2s linear infinite;
       }
           </style>
               <link href="/dist/main.2fd755ba72413ff9db56.css" rel="stylesheet" media="all" />
         </head>
         <body>
           <div id="root">
             <div class="loadBox">
         <svg class="pageLoading" xmlns="http://www.w3.org/2000/svg" width="48" height="48"
           viewBox="0 0 48 48">
           <defs>
             <linearGradient id="icon-line-spinner-a" x1="4.167%" x2="4.167%" y1="0%" y2="100%">
               <stop offset="0%" stop-color="#E4EBF1"></stop>
               <stop offset="100%" stop-color="#86919C"></stop>
             </linearGradient>
             <linearGradient id="icon-line-spinner-b" x1="95.833%" x2="95.833%" y1="0%" y2="100%">
               <stop offset="0%" stop-color="#324558"></stop>
               <stop offset="100%" stop-color="#86919C"></stop>
             </linearGradient>
           </defs>
           <g fill-rule="evenodd" fill="none">
             <path
               d="M24,0 C37.254834,-2.4348735e-15 48,10.745166 48,24 C48,37.254834 37.254834,48 24,48 C10.745166,48 1.623249e-15,37.254834 0,24 C-1.623249e-15,10.745166 10.745166,2.4348735e-15 24,0 Z">
             </path>
             <path fill="url(#icon-line-spinner-a)"
               d="M24,48 L24,46 C36.1502645,46 46,36.1502645 46,24 C46,12.1554065 36.6396211,2.49704654 24.9125246,2.01858157 L24.9954814,0.0202708022 C37.7886803,0.542235439 48,11.078627 48,24 C48,37.254834 37.254834,48 24,48 Z">
             </path>
             <path fill="url(#icon-line-spinner-b)"
               d="M24,46 L24,48 C10.745166,48 0,37.254834 0,24.0000001 C0,11.0786271 10.2113197,0.542235649 23.0045134,0.0202712255 L23.0874754,2.01858177 C11.3603789,2.49704674 2,12.1554066 2,24.0000001 C2,36.1502645 11.8497355,46 24,46 Z">
             </path>
           </g>
         </svg>
       </div>
           </div>
           <script type="text/javascript">
             window.globals = JSON.parse(`{"config":{"title":"KubeSphere","description":"","version":{"kubesphere":"v3.1.1","kubernetes":"v1.19.8","openpitrix":"v0.3.5"},"issueUrl":"https://github.com/kubesphere/kubesphere/issues/new/choose","reposUrl":"https://github.com/kubesphere/kubesphere","slackUrl":"https://kubesphere.slack.com","documents":{"url":"https://v3-1.docs.kubesphere.io/docs","api":"https://v3-1.docs.kubesphere.io/docs/reference/api-docs/"},"supportLangs":[{"label":"繁體中文","value":"tc"},{"label":"简体中文","value":"zh"},{"label":"English","value":"en"},{"label":"Español","value":"es"}],"defaultLang":"en","globalNavs":[{"name":"clusters","title":"Clusters Management","desc":"CLUSTERS_MANAGE_DESC","icon":"cluster"},{"name":"access","title":"Access Control","icon":"key","authKey":"users|roles|workspaces"},{"name":"apps-manage","title":"App Store Management","icon":"openpitrix","authKey":"app-templates","authAction":"manage","ksModule":"openpitrix.appstore"},{"name":"settings","title":"Platform Settings","icon":"cogwheel","authKey":"platform-settings","authAction":"manage"}],"clusterNavs":[{"cate":"cluster","items":[{"name":"overview","title":"Overview","icon":"dashboard","skipAuth":true,"showInDisable":true},{"name":"nodes","title":"Nodes Management","icon":"nodes","children":[{"name":"nodes","title":"Cluster Nodes"},{"name":"edgenodes","title":"Edge Nodes","clusterModule":"kubeedge"}]},{"name":"components","title":"Service Components","icon":"components"},{"name":"projects","title":"NAV_PROJECTS","icon":"project"},{"name":"app-workloads","title":"Application Workloads","icon":"appcenter","children":[{"name":"workloads","title":"Workloads","tabs":[{"name":"deployments","title":"Deployments"},{"name":"statefulsets","title":"StatefulSets"},{"name":"daemonsets","title":"DaemonSets"}]},{"name":"jobs","title":"Jobs","tabs":[{"name":"jobs","title":"Jobs"},{"name":"cronjobs","title":"CronJobs"}]},{"name":"pods","title":"Pods"},{"name":"services","title":"Services"},{"name":"ingresses","title":"Routes"}]},{"name":"config","title":"Configuration Center","icon":"hammer","children":[{"name":"secrets","title":"Secrets"},{"name":"configmaps","title":"ConfigMaps"},{"name":"serviceaccounts","title":"ServiceAccounts","requiredClusterVersion":"v3.1.0"}]},{"name":"network","title":"Network Management","icon":"earth","children":[{"name":"networkpolicies","title":"Network Policies","clusterModule":"network"},{"name":"ippools","title":"Pod IP Pools","clusterModule":"network.ippool"}]},{"name":"customresources","title":"Custom Resources","icon":"select","admin":true},{"name":"storage","title":"Storage Management","icon":"database","children":[{"name":"volumes","title":"Volumes"},{"name":"volume-snapshots","title":"Snapshots","authKey":"volumes"},{"name":"storageclasses","title":"Storage Classes"}]},{"name":"monitoring-alerting","title":"Monitoring & Alerting","icon":"monitor","children":[{"name":"monitor-cluster","title":"Cluster Status","icon":"linechart","authKey":"monitoring"},{"name":"monitor-resource","title":"Application Resources","icon":"linechart","authKey":"monitoring"},{"name":"alerts","title":"Alerting Messages","icon":"loudspeaker","clusterModule":"alerting","requiredClusterVersion":"v3.1.0"},{"name":"alert-rules","title":"Alerting Policies","icon":"hammer","clusterModule":"alerting","requiredClusterVersion":"v3.1.0"},{"name":"custom-monitoring","title":"Custom Monitoring","requiredClusterVersion":"v3.1.0"}]},{"name":"cluster-settings","title":"Cluster Settings","icon":"cogwheel","showInDisable":true,"children":[{"name":"base-info","title":"Basic Info","skipAuth":true,"showInDisable":true},{"name":"visibility","title":"Cluster Visibility","authKey":"cluster-settings","multiCluster":true},{"name":"log-collections","title":"Log Collections","icon":"file","authKey":"cluster-settings","clusterModule":"logging|events|auditing"}]}]}],"accessNavs":[{"cate":"access","items":[{"name":"workspaces","title":"Workspaces","icon":"enterprise"},{"name":"accounts","title":"NAV_ACCOUNTS","icon":"human","authKey":"users"},{"name":"roles","title":"Account Roles","icon":"role"}]}],"platformSettingsNavs":[{"cate":"platformsettings","items":[{"name":"base-info","title":"Platform Info","icon":"home","authKey":"platform-settings"},{"name":"notification-management","title":"Notification Management","icon":"bell","children":[{"name":"mail","title":"Mail","authKey":"platform-settings"},{"name":"dingtalk","title":"DingTalk","authKey":"platform-settings"},{"name":"wecom","title":"WeCom","authKey":"platform-settings"},{"name":"slack","title":"Slack","authKey":"platform-settings"},{"name":"webhook","title":"Webhook","authKey":"platform-settings"}]}]}],"workspaceNavs":[{"cate":"workspace","items":[{"name":"overview","title":"Overview","icon":"dashboard","authKey":"projects"},{"name":"projects","title":"NAV_PROJECTS","icon":"project","skipAuth":true,"tabs":[{"name":"projects","title":"Projects"},{"name":"federatedprojects","title":"Multi-cluster Projects"}]},{"name":"devops","title":"DevOps Projects","icon":"strategy-group","ksModule":"devops","skipAuth":true},{"name":"apps","title":"Apps Management","icon":"appcenter","children":[{"name":"apps","title":"App Templates","icon":"appcenter","authKey":"app-templates","ksModule":"openpitrix.appstore"},{"name":"repos","title":"App Repos","authKey":"app-repos","ksModule":"openpitrix"}]},{"name":"management","title":"Workspace Settings","icon":"cogwheel","children":[{"name":"base-info","title":"Basic Info","skipAuth":true},{"name":"quota","title":"Quota Management","authKey":"workspace-settings"},{"name":"roles","title":"Workspace Roles"},{"name":"members","title":"Workspace Members"},{"name":"groups","title":"Workspace Groups"}]}]}],"manageAppNavs":[{"cate":"apps","items":[{"name":"store","title":"App Store","icon":"appcenter"},{"name":"categories","title":"App Categories","icon":"tag"},{"name":"reviews","title":"App Review","icon":"safe-notice"}]}],"projectNavs":[{"cate":"project","items":[{"name":"overview","title":"Overview","icon":"dashboard","authKey":"services"},{"name":"app-workloads","title":"Application Workloads","icon":"appcenter","children":[{"name":"applications","title":"Applications","icon":"application"},{"name":"services","title":"Services"},{"name":"workloads","title":"Workloads","tabs":[{"name":"deployments","title":"Deployments"},{"name":"statefulsets","title":"StatefulSets"},{"name":"daemonsets","title":"DaemonSets"}]},{"name":"jobs","title":"Jobs","tabs":[{"name":"jobs","title":"Jobs"},{"name":"cronjobs","title":"CronJobs"}]},{"name":"ingresses","title":"Routes"},{"name":"pods","title":"Pods"}]},{"name":"storage","title":"Storage Management","icon":"database","children":[{"name":"volumes","title":"Volumes"},{"name":"volume-snapshots","title":"Snapshots"}]},{"name":"config","title":"Configuration Center","icon":"hammer","children":[{"name":"secrets","title":"Secrets"},{"name":"configmaps","title":"ConfigMaps"},{"name":"serviceaccounts","title":"ServiceAccounts","requiredClusterVersion":"v3.1.0"}]},{"name":"grayrelease","title":"Grayscale Release","icon":"bird","authKey":"grayscale-release","clusterModule":"servicemesh"},{"name":"s2ibuilders","title":"Image Builder","icon":"vnas","clusterModule":"devops"},{"name":"monitoring","title":"Monitoring & Alerting","icon":"monitor","children":[{"name":"alerts","title":"Alerting Messages","icon":"loudspeaker","clusterModule":"alerting","requiredClusterVersion":"v3.1.0"},{"name":"alert-rules","title":"Alerting Policies","icon":"hammer","clusterModule":"alerting","requiredClusterVersion":"v3.1.0"},{"name":"custom-monitoring","title":"Custom Monitoring","requiredClusterVersion":"v3.1.0"}]},{"name":"settings","title":"Project Settings","icon":"cogwheel","children":[{"name":"base-info","title":"Basic Info","skipAuth":true},{"name":"networkpolicies","title":"Network Isolation","clusterModule":"network","authKey":"project-settings"},{"name":"roles","title":"Project Roles"},{"name":"members","title":"Project Members"},{"name":"advanced","title":"Advanced Settings","authKey":"project-settings"}]}]}],"federatedProjectNavs":[{"cate":"project","items":[{"name":"overview","title":"Overview","icon":"dashboard","skipAuth":true},{"name":"app-workloads","title":"Application Workloads","icon":"appcenter","children":[{"name":"applications","title":"Applications","icon":"application"},{"name":"services","title":"Services"},{"name":"workloads","title":"Workloads","tabs":[{"name":"deployments","title":"Deployments"},{"name":"statefulsets","title":"StatefulSets"}]},{"name":"ingresses","title":"Routes"}]},{"name":"volumes","title":"Volumes","icon":"storage"},{"name":"config","title":"Configuration Center","icon":"hammer","children":[{"name":"secrets","title":"Secrets"},{"name":"configmaps","title":"ConfigMaps"}]},{"name":"settings","title":"Project Settings","icon":"cogwheel","children":[{"name":"base-info","title":"Basic Info","skipAuth":true},{"name":"quota","title":"Quota Management","authKey":"project-settings"},{"name":"advanced","title":"Advanced Settings","authKey":"project-settings"}]}]}],"devopsNavs":[{"cate":"","items":[{"name":"pipelines","title":"Pipelines","icon":"application"},{"name":"management","title":"DEVOPS_PROJECT_MANAGEMENT","icon":"cogwheel","open":true,"children":[{"name":"base-info","title":"Basic Info","skipAuth":true},{"name":"credentials","title":"Credentials"},{"name":"roles","title":"DEVOPS_PROJECT_ROLES"},{"name":"members","title":"DEVOPS_PROJECT_MEMBERS"}]}]}],"systemWorkspace":"system-workspace","systemWorkspaceRules":{"devops":[],"members":["manage"],"projects":["view","edit","manage"],"roles":["view"],"workspaces":["view","edit"]},"systemWorkspaceProjectRules":{"alerting":["manage"],"members":["manage"],"roles":["manage"],"custom-monitoring":["manage"]},"presetUsers":["admin","sonarqube"],"presetGlobalRoles":["platform-admin","platform-regular","workspaces-manager","users-manager"],"presetClusterRoles":["cluster-admin","cluster-viewer"],"presetWorkspaceRoles":["admin","regular","viewer","self-provisioner"],"presetDevOpsRoles":["admin","operator","viewer"],"presetRoles":["admin","operator","viewer"],"preservedAnnotations":[".*kubesphere.io/","openpitrix_runtime"],"disabledLoggingSidecarNamespace":["kubesphere-logging-system"],"loadBalancerDefaultAnnotations":{"service.beta.kubernetes.io/qingcloud-load-balancer-eip-ids":"","service.beta.kubernetes.io/qingcloud-load-balancer-type":"0"},"enableErrorNotify":true,"enableImageSearch":true,"disableAuthorization":false,"enableKubeConfig":true,"thirdPartyTools":[],"resourceDocs":{"applications":"/project-user-guide/application/app-template/","composingapps":"/project-user-guide/application/compose-app/","deployments":"/project-user-guide/application-workloads/deployments/","statefulsets":"/project-user-guide/application-workloads/statefulsets/","daemonsets":"/project-user-guide/application-workloads/daemonsets/","jobs":"/project-user-guide/application-workloads/jobs/","cronjobs":"/project-user-guide/application-workloads/cronjobs/","services":"/project-user-guide/application-workloads/services/","ingresses":"/project-user-guide/application-workloads/routes/","s2i_template":"/project-user-guide/image-builder/s2i-templates/","volumes":"/project-user-guide/storage/volumes/","secrets":"/project-user-guide/configuration/secrets/","configmaps":"/project-user-guide/configuration/configmaps/","serviceaccounts":"/project-user-guide/configuration/serviceaccounts/","imageregistry":"/project-user-guide/configuration/image-registry/","grayrelease":"/project-user-guide/grayscale-release/overview/","internet":"/project-administration/project-gateway/","project_base_info":"/workspace-administration/project-quotas/","project_roles":"/project-administration/role-and-member-management/","project_members":"/project-administration/role-and-member-management/","nodes":"/cluster-administration/nodes/","storageclasses":"/cluster-administration/persistent-volume-and-storage-class/","pipelines":"/devops-user-guide/how-to-use/pipeline-settings/","cridentials":"/devops-user-guide/how-to-use/credential-management/","helm_specification":"/application-store/app-developer-guide/helm-specification/","helm_developer_guide":"/application-store/app-developer-guide/helm-developer-guide/","custom_console":"/cluster-administration/platform-settings/customize-basic-information/","kube_config":"/multicluster-management/enable-multicluster/retrieve-kubeconfig/"},"notification":{"mail":{"max_number_of_eamil":50},"dingtalk":{"max_number_of_cid":20,"max_number_of_keyword":20},"wecom":{"max_number_of_toUser":50,"max_number_of_toParty":20,"max_number_of_toTag":20},"slack":{"max_number_of_channel":20}}},"localeManifest":{"locale-en.json":"locale-en.89c8aadcdd73bc3adce2.json","locale-es.json":"locale-es.c9ab1366c6dbfb10b578.json","locale-tc.json":"locale-tc.c5db81ec73af416b5918.json","locale-zh.json":"locale-zh.36aa4e86cd2075198747.json"},"oauthServers":[]}`)
           </script>
               <script type="text/javascript" src="/dist/main.2fd755ba72413ff9db56.js"></script>
         </body>
       * Connection #0 to host 172.16.110.230 left intact
       </html>* Closing connection 0

      也看不出哪有问题。。











        5 天 后

        hongming 我知道原因了。。。 我本地开了代理。。,把代理关了就正常能访问了。。