最近在浏览github的时候,发现vmware公司开源了一款k8s的可视化Dashboard工具Octant,出于好奇就在测试环境进行了部署测试。

Octant的GitHub地址: Octant

下载并安装

我使用的是centos系统,所以我们下载最新版的.rpm包进行下载安装

# wget https://github.com/vmware-tanzu/octant/releases/download/v0.23.0/octant_0.23.0_Linux-64bit.rpm

使用rpm命令安装即可

# rpm -ivh octant_0.23.0_Linux-64bit.rpm
启动

安装完成后,使用octant命令启动即可,启动前需要指定一些参数,使用octant --help可查命令帮助

命令帮助
# octant --help
octant is a dashboard for high bandwidth cluster analysis operations

Usage:
  octant [flags]
  octant [command]

Available Commands:
  completion  generate the autocompletion script for the specified shell
  help        Help about any command
  version     Show version

Flags:
      --context string                 initial context
      --disable-cluster-overview       disable cluster overview
      --enable-feature-applications    enable applications feature
      --kubeconfig string              absolute path to kubeConfig file
  -n, --namespace string               initial namespace
      --namespace-list strings         a list of namespaces to use on start
      --plugin-path string             plugin path
  -v, --verbose                        turn on debug logging
      --client-max-recv-msg-size int   client max receiver message size (default 16777216)
      --accepted-hosts string          accepted hosts list [DEV]
      --client-qps float32             maximum QPS for client [DEV] (default 200)
      --client-burst int               maximum burst for client throttle [DEV] (default 400)
      --disable-open-browser           disable automatic launching of the browser [DEV]
      --disable-origin-check           disable cross origin resource check
  -c, --enable-opencensus              enable open census [DEV]
      --klog-verbosity int             klog verbosity level [DEV]
      --listener-addr string           listener address for the octant frontend [DEV]
      --local-content string           local content path [DEV]
      --proxy-frontend string          url to send frontend request to [DEV]
      --ui-url string                  dashboard url [DEV]
      --browser-path string            the browser path to open the browser on
      --memstats string                log memory usage to this file
      --meminterval string             interval to poll memory usage (requires --memstats), valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h". (default "100ms")
  -h, --help                           help for octant

Use "octant [command] --help" for more information about a command.

--kubeconfig 指定k8s集群的config文件

--listener-addr 指定访问监听的地址及端口

--ui-url Dashboard面板访问域名

--browser-path 访问路径

# octant --kubeconfig=/root/.kube/config --listener-addr=0.0.0.0:8000 --ui-url=k8s.octant.com
页面访问

浏览器输入http://k8s.octant.com:8000 (需要修改windows机器hosts文件) image.png image.png image.png image.png

可以看到功能基本上和官方的Dashboard区别不大,不过Octant提供的核心的插件功能,有极大的扩展空间,有兴趣的可以研究一番 image.png