当前位置: 首页 > 知识库问答 >
问题:

Minikube仪表板入口

陶刚豪
2023-03-14

我正在尝试使用嵌入式仪表板内部服务进入minikube仪表板。

我启用了< code>ingress和< code>dashboard minikube插件。

我还编写了这个入口YAML文件:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dashboard-ingress
  namespace: kubernetes-dashboard
spec:
  rules:
  - host: dashboard.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: kubernetes-dashboard
            port: 
              number: 80

正如你所看到的,我的入口创建得很好:

NAME                CLASS   HOSTS           ADDRESS     PORTS   AGE
dashboard-ingress   nginx   dashboard.com   localhost   80      15s

我编辑了我的< code>/etc/hosts来添加这一行:< code > 127 . 0 . 0 . 1 dashboard . com 。

现在,我正试图通过< code>dashboard.com访问仪表板。但是没用。

kubectl 描述 ingress dashboard-ingress -n kubernetes-dashboard 给了我这个:

Name:             dashboard-ingress
Namespace:        kubernetes-dashboard
Address:          localhost
Default backend:  default-http-backend:80 (<error: endpoints "default-http-backend" not found>)
Rules:
  Host           Path  Backends
  ----           ----  --------
  dashboard.com  
                 /   kubernetes-dashboard:80 (172.17.0.4:9090)
Annotations:     <none>
Events:
  Type    Reason  Age                From                      Message
  ----    ------  ----               ----                      -------
  Normal  Sync    14m (x2 over 14m)  nginx-ingress-controller  Scheduled for sync

我不太明白是什么

kubectl获取pods-n入口nginx结果:

NAME                                        READY   STATUS      RESTARTS   AGE
ingress-nginx-admission-create--1-8krc7     0/1     Completed   0          100m
ingress-nginx-admission-patch--1-qblch      0/1     Completed   1          100m
ingress-nginx-controller-5f66978484-hvk9j   1/1     Running     0          100m

nginx控制器盒的日志:

-------------------------------------------------------------------------------
NGINX Ingress controller
  Release:       v1.0.4
  Build:         9b78b6c197b48116243922170875af4aa752ee59
  Repository:    https://github.com/kubernetes/ingress-nginx
  nginx version: nginx/1.19.9

-------------------------------------------------------------------------------

W1205 19:33:42.303136       7 client_config.go:615] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I1205 19:33:42.303261       7 main.go:221] "Creating API client" host="https://10.96.0.1:443"
I1205 19:33:42.319750       7 main.go:265] "Running in Kubernetes cluster" major="1" minor="22" git="v1.22.3" state="clean" commit="c92036820499fedefec0f847e2054d824aea6cd1" platform="linux/amd64"
I1205 19:33:42.402223       7 main.go:104] "SSL fake certificate created" file="/etc/ingress-controller/ssl/default-fake-certificate.pem"
I1205 19:33:42.413477       7 ssl.go:531] "loading tls certificate" path="/usr/local/certificates/cert" key="/usr/local/certificates/key"
I1205 19:33:42.420838       7 nginx.go:253] "Starting NGINX Ingress controller"
I1205 19:33:42.424731       7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"ingress-nginx-controller", UID:"f2d27cc7-b103-490f-807f-18ccaa614e6b", APIVersion:"v1", ResourceVersion:"664", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/ingress-nginx-controller
I1205 19:33:42.427171       7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"tcp-services", UID:"e174971d-df1c-4826-85d4-194598ab1912", APIVersion:"v1", ResourceVersion:"665", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/tcp-services
I1205 19:33:42.427195       7 event.go:282] Event(v1.ObjectReference{Kind:"ConfigMap", Namespace:"ingress-nginx", Name:"udp-services", UID:"0ffc7ee9-2435-4005-983d-ed41aac1c9aa", APIVersion:"v1", ResourceVersion:"666", FieldPath:""}): type: 'Normal' reason: 'CREATE' ConfigMap ingress-nginx/udp-services
I1205 19:33:43.622661       7 nginx.go:295] "Starting NGINX process"
I1205 19:33:43.622746       7 leaderelection.go:243] attempting to acquire leader lease ingress-nginx/ingress-controller-leader...
I1205 19:33:43.623402       7 nginx.go:315] "Starting validation webhook" address=":8443" certPath="/usr/local/certificates/cert" keyPath="/usr/local/certificates/key"
I1205 19:33:43.623683       7 controller.go:152] "Configuration changes detected, backend reload required"
I1205 19:33:43.643547       7 leaderelection.go:253] successfully acquired lease ingress-nginx/ingress-controller-leader
I1205 19:33:43.643635       7 status.go:84] "New leader elected" identity="ingress-nginx-controller-5f66978484-hvk9j"
I1205 19:33:43.691342       7 controller.go:169] "Backend successfully reloaded"
I1205 19:33:43.691395       7 controller.go:180] "Initial sync, sleeping for 1 second"
I1205 19:33:43.691435       7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"ingress-nginx", Name:"ingress-nginx-controller-5f66978484-hvk9j", UID:"55d45c26-eda7-4b37-9b04-5491cde39fd4", APIVersion:"v1", ResourceVersion:"697", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
I1205 21:06:47.402756       7 main.go:101] "successfully validated configuration, accepting" ingress="dashboard-ingress/kubernetes-dashboard"
I1205 21:06:47.408929       7 store.go:371] "Found valid IngressClass" ingress="kubernetes-dashboard/dashboard-ingress" ingressclass="nginx"
I1205 21:06:47.409343       7 controller.go:152] "Configuration changes detected, backend reload required"
I1205 21:06:47.409352       7 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"kubernetes-dashboard", Name:"dashboard-ingress", UID:"be1ebfe9-fdb3-4d0c-925b-0c206cd0ece3", APIVersion:"networking.k8s.io/v1", ResourceVersion:"5529", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync
I1205 21:06:47.458273       7 controller.go:169] "Backend successfully reloaded"
I1205 21:06:47.458445       7 event.go:282] Event(v1.ObjectReference{Kind:"Pod", Namespace:"ingress-nginx", Name:"ingress-nginx-controller-5f66978484-hvk9j", UID:"55d45c26-eda7-4b37-9b04-5491cde39fd4", APIVersion:"v1", ResourceVersion:"697", FieldPath:""}): type: 'Normal' reason: 'RELOAD' NGINX reload triggered due to a change in configuration
I1205 21:07:43.654037       7 status.go:300] "updating Ingress status" namespace="kubernetes-dashboard" ingress="dashboard-ingress" currentValue=[] newValue=[{IP: Hostname:localhost Ports:[]}]
I1205 21:07:43.660598       7 event.go:282] Event(v1.ObjectReference{Kind:"Ingress", Namespace:"kubernetes-dashboard", Name:"dashboard-ingress", UID:"be1ebfe9-fdb3-4d0c-925b-0c206cd0ece3", APIVersion:"networking.k8s.io/v1", ResourceVersion:"5576", FieldPath:""}): type: 'Normal' reason: 'Sync' Scheduled for sync

有人知道我如何解决我的问题吗?

(我使用minikube v1.24.0)

问候,


共有2个答案

姚昊焱
2023-03-14

我在Minikube的Ingress上也遇到过类似的问题,但我用的是Windows。

经过深入搜索,我发现问题出在Docker的驱动程序上。

我将驱动程序更改为VirtualBox,Ingress开始按预期运行。

该条目提供了进一步的详细信息。

公良英资
2023-03-14
匿名用户

我在本地运行minikube(v1.25.1)时也遇到了同样的问题。

< code > kubectl get ingress-n kubernetes-dashboard

NAME                CLASS   HOSTS           ADDRESS     PORTS   AGE
dashboard-ingress   nginx   dashboard.com   localhost   80      34m

经过调试,我发现了这一点。"如果您在本地运行Minikube,请使用minikube ip获取外部ip。入口列表中显示的IP地址将是内部IP”。

运行此命令

minikube ip
XXX.XXX.64.2

将此ip添加到主机文件中,然后我就可以访问dashboard.com

 类似资料:
  • 共享仪表板 您也可以向其他用户共享一个 Kibana 仪表板的链接,或者将仪表板嵌入到网页中。用户必须具有 Kibana 权限才能访问嵌入式仪表板。 如何分享一个仪表板: 点击侧边导航栏中的 Dashboard 。 打开您想共享的仪表板。 点击 Share 。 复制您想分享的链接或者您想嵌套的 iframe。您可以分享动态仪表板或者当前时间点的静态快照。 当共享仪表板快照链接的时候,请使用 Sho

  • 加载仪表板 如何打开一个保存的仪表板: 点击侧边导航栏中的 Dashboard 。 选中一个仪表板并点击 Open 。如果您有很多仪表板,您可以敲入 Filter 字符串来过滤仪表板列表。 要导入、导出和删除仪表板,请点击 Manage Dashboards 链接打开 Management/Kibana/Saved Objects/Dashboards 。

  • “概览”仪表板页面显示 Navicat Monitor 监控的所有实例。你可以获取高级摘要信息和实例的健康状态,识别需要重点关注的实例。 实例卡片 通过实例卡片你可以识别服务器状态和系统资源使用率。若要创建一个新实例来监控你的服务器,请点击“+ 新建实例”并选择服务器类型。然后,在新建实例窗口中输入适当的信息。请参阅创建实例的详细信息。 默认情况下,实例卡片显示所有可用的系统资源使用率。点击“卡片

  • 你可以在整个屏幕上显示仪表板。在此模式下,标题栏、工具栏、选项卡栏、页面窗格、控件列表和属性窗格将被隐藏。若要以显示视图打开仪表板,请点击 “显示”。 如果你在仪表板上添加了控件图表,则可以使用控件筛选所有图表的数据系列。 若要退出显示视图,请按 ESC 键,工作区窗口将返回其先前状态。

  • 创建仪表板的基本步骤: 在工作区窗口中,点击 “新建仪表板”。 输入仪表板的名。 点击“确定”。 一个选项卡将打开,让你编辑仪表板。 设计你的仪表板。 在右窗格中选择可以进一步自定义仪表板的属性。 【注意】每个对象都有不同的属性。 【提示】你可以刷新仪表板,以使用来自各自数据源的最新数据来更新图表中的数据。若要手动刷新仪表板,请单击 “刷新数据”。 使用网格 显示网格 若要在仪表板启用网格,从菜单

  • 仪表板是图表的集合,可让你创建和查看数据可视化。当你修改图表时,包含该图表的所有仪表板都将反映所做的更改。 页面窗格 页面窗格显示仪表板中每个页面的缩略图。如果页面窗格已隐藏,从菜单栏选择“查看”->“显示页面”。 仪表板工具栏 仪表板工具栏提供可用于刷新数据和显示仪表板的控件。 控件列表窗格 控件列表窗格让你设计仪表板,例如添加图表、标签、图像。如果控件列表窗格已隐藏,从菜单栏选择“查看”->“