官方源码:https://github.com/kubernetes/dashboard

开发文档:https://github.com/kubernetes/dashboard/wiki/Getting-started

1.    环境安装

1)     操作系统安装

操作系统:CentOS-7-x86_64-Minimal-1708

mac也可以,但在mac生成的镜像好像不能放在centos下运行,有报错,以下以centos安装为例,可以在mac下运行dashboard但是好像登录认证是假的,而且只有英文版。

2)     相关依赖安装

可以使用cnpm下载包的速度更快:

#npm install -g cnpm --registry=https://registry.npm.taobao.org

#cnpm install --global gulp-cli

#cnmp install --global gulp

 

3编译

如果本机环境不是k8s结点,那需要设置环境变量:export KUBE_DASHBOARD_APISERVER_HOST="http://<APISERVER_IP>:<APISERVER_PORT>"  

把GOPATH目录设置好

把源码解压到这个目录下:$GOPATH/src/github.com/kubernetes/dashboard

进入项目

cnpm install 安装模块 

如果有包下载不下来,或有权限问题用:npm i –unsafe-perm

如果有遇到错误,注意要把node_mdule文件夹删除再试,还不行,再把packeage.lock.son删除再试

gulp build  工程编译

运行 gulp serve

浏览器访问:localhost:9090

 

如果需要生成镜像:运行命令

gulp docker-image:head 生成tag为head的镜像

 

注意:Failed to load external module @babel/register  这个报错可以忽略

 

相关文章:

  • 2021-12-29
  • 2021-04-16
  • 2022-01-06
  • 2021-06-07
  • 2021-04-14
  • 2021-04-24
  • 2022-01-13
  • 2021-07-22
猜你喜欢
  • 2021-10-04
  • 2021-08-03
  • 2021-12-02
  • 2021-06-04
  • 2021-11-15
  • 2021-11-11
  • 2022-12-23
相关资源
相似解决方案