K8S|解决dashboard在chrome无法访问问题

前面的文章中,介绍了dashboard的基本访问,但是留下两个问题
只能Firefox浏览器访问
Token需要手动输入
本篇解决这两个问题
解决办法就是:前置nginx,将这两个麻烦交给它去解决.
运行一个nginx

docker run \
--restart=always \
-dt \
--name nginx \
-p 80:80 \
nginx

ff312e65ccfadcde55dd9aab3af4d91608ce33f1367bcabee0ea62e8894e49b9

运行一个bash

docker exec -it nginx bash
root@ff312e65ccfa:/# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@ff312e65ccfa:/# cd /etc/nginx/
conf.d/         fastcgi_params  koi-utf         koi-win         mime.types      modules/        nginx.conf      scgi_params     uwsgi_params    win-utf
root@ff312e65ccfa:/# cd /etc/nginx/conf.d/
root@ff312e65ccfa:/etc/nginx/conf.d# ls
default.conf
root@ff312e65ccfa:/etc/nginx/conf.d# vi
bash: vi: command not found

发现没有vi
改一下阿里源,安装一下

cat >/etc/apt/sources.list<<'EOF'
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
EOF

apt-get update&&apt-get install vim -y

直接替换default.conf内容

雨鸟飞行此处内容已经被作者隐藏,请输入验证码查看内容
验证码:
请关注本站微信公众号,回复“vx”,获取验证码。在微信里搜索“雨鸟飞行”或者“cnrainbird”或者微信扫描右侧二维码都可以关注本站微信公众号。


相关博文

About rainbird

IOS攻城狮
This entry was posted in K8S and tagged , , , , , , , . Bookmark the permalink.

发表评论