lnmp icon indicating copy to clipboard operation
lnmp copied to clipboard

Support k8s.gcr.io gcr.io local server,Docker for desktop run kubernetes

Open khs1994 opened this issue 6 years ago • 28 comments

gcr.io 国内访问有问题,所以我们开启一个 local server,让 Docker 桌面版从本地拉镜像

  • 文档 https://github.com/khs1994-docker/lnmp/blob/master/docs/kubernetes/docker-desktop.md

添加如下 hosts

# 路由器分配给电脑的 IP gcr.io k8s.gcr.io
# 例如

192.168.199.100 gcr.io k8s.gcr.io

启动

首先关闭本地监听 443 端口的程序

$ ./lnmp-docker gcr.io

$ lnmp-docker gcr.io logs

执行完毕之后,Docker 设置中开启 k8s

开启成功之后,删除启动的 local server 容器


$ lnmp-docker gcr.io down

khs1994 avatar May 19 '18 14:05 khs1994

after this setup , How to install kubernetes dashboard???

lovese avatar Sep 13 '18 09:09 lovese

after this setup , How to install kubernetes dashboard???

安装完后,如何安装Kubernetes仪表板???

Tencent AI Analytic Result :smile:

pcit-ce[bot] avatar Sep 13 '18 09:09 pcit-ce[bot]

$ kubectl apply -f kubernetes/coreos/addons/dashboard.yaml

khs1994 avatar Sep 13 '18 09:09 khs1994

@khs1994 不用设置,可以直接调用k8s的接口吗?

lovese avatar Sep 13 '18 09:09 lovese

@khs1994 不用设置,可以直接调用k8s的接口吗?

@ khs1994 do not set, you can directly call the k8s interface?

Tencent AI Analytic Result :smile:

pcit-ce[bot] avatar Sep 13 '18 09:09 pcit-ce[bot]

$ ~/.kube/config

已经自动生成好了,直接用 kubectl 就行。

$ kubectl get all -n kube-system

service/kubernetes-dashboard   NodePort    10.97.248.32   <none>        443:30508/TCP   3h

浏览器打开 https://127.0.0.1:30508 就可以了(提示证书错误,直接跳过就行),端口号这里是例子,实际是多少自己看

khs1994 avatar Sep 13 '18 09:09 khs1994

@khs1994 安装 dashboard 还要启动本地 k8s 仓库吗?这翻译机器人怎么关掉?

lovese avatar Sep 13 '18 09:09 lovese

@khs1994 安装 dashboard 还要启动本地 k8s 仓库吗?这翻译机器人怎么关掉?

@ KHS 1994 install dashboard also start the local k8s warehouse? How to turn off the translation robot?

Tencent AI Analytic Result :smile:

pcit-ce[bot] avatar Sep 13 '18 09:09 pcit-ce[bot]

安装 k8s 的时候需要,启动成功了就不需要了。

然后 kubernetes/coreos/addons 里的 yaml 文件我都把 gcr.io 的镜像替换成了 docker hub 中的镜像,具体对应关系请看这个项目 https://github.com/anjia0532/gcr.io_mirror

以后你把 yaml 文件中的 gcr.io 镜像替换成 https://github.com/anjia0532/gcr.io_mirror 这里的镜像

这个翻译机器人是我开发的一个 CI 项目,关闭功能暂时没有

khs1994 avatar Sep 13 '18 09:09 khs1994

安装 k8s 的时候需要,启动成功了就不需要了。

然后 kubernetes/coreos/addons 里的 yaml 文件我都把 gcr.io 的镜像替换成了 docker hub 中的镜像,具体对应关系请看这个项目 https://github.com/anjia0532/gcr.io_mirror

以后你把 yaml 文件中的 gcr.io 镜像替换成 https://github.com/anjia0532/gcr.io_mirror 这里的镜像

这个翻译机器人是我开发的一个 CI 项目,关闭功能暂时没有

K8s installed when the need to start a successful do not need. Then the yaml file in kubernetes / coreos / addons I replaced the image of gcr.io with the image in dockerhub, see the project HTTPS: / github.com / anjia0532 / gcr.io _ mirror. This translation robot is a CI project I developed. Ah, the shutdown function is temporarily unavailable.

Tencent AI Analytic Result :smile:

pcit-ce[bot] avatar Sep 13 '18 09:09 pcit-ce[bot]

@khs1994 好的,谢谢了!

lovese avatar Sep 13 '18 09:09 lovese

@khs1994 好的,谢谢了!

@ khs1994 OK, thanks!

Tencent AI Analytic Result :+1:

pcit-ce[bot] avatar Sep 13 '18 09:09 pcit-ce[bot]

@khs1994 请问这个怎么办,访问不了 image

lovese avatar Sep 14 '18 04:09 lovese

@khs1994 请问这个怎么办,访问不了 image

@ KHS 1994 how to do this, can not visit! [image] (HTTPS: / user-images.githubusercontent.com / 13268438 / 45529981-d959c680-b81a-11e8-8ec1-1f77fdfc38f2.png)

Tencent AI Analytic Result :-1:

pcit-ce[bot] avatar Sep 14 '18 04:09 pcit-ce[bot]

访问 dashboard ?

我在 Chrome 试了一下,重新加载 左边有一个高级按钮,点一下,有 继续前往的选项,不知道为何你这里没有

其实还有一种方法,不过麻烦一点

$ kubectl proxy

浏览器打开 http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

khs1994 avatar Sep 14 '18 04:09 khs1994

访问 dashboard ?

我在 Chrome 试了一下,重新加载 左边有一个高级按钮,点一下,有 继续前往的选项,不知道为何你这里没有

其实还有一种方法,不过麻烦一点

$ kubectl proxy

浏览器打开 http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

Access dashboard? I tried it on Chrome, and there's an advanced button on the left to reload, click, and there's an option to go on, I don't know why you don't have a method here, but there is a way to open http: / localhost: 8001 / API / V1 / namespaces / kube-system / services / HTTPS: kubernets-dashboard: / proxy /

Tencent AI Analytic Result :smile:

pcit-ce[bot] avatar Sep 14 '18 04:09 pcit-ce[bot]

image chrome://flags 我这样设置就可以了,你的不会这样可能是你的chrome不是最新版

lovese avatar Sep 14 '18 05:09 lovese

image 我这样设置就可以了,你的不会这样可能是你的chrome不是最新版

! [image] (HTTPS: / user-images.githubusercontent.com / 13268438 / 45531367-0b225b80-b822-11e8-986c-3ec5e1e7ca20.png) I can set it up like this, your will not be like this may be your Chrome is not the latest version

Tencent AI Analytic Result :+1:

pcit-ce[bot] avatar Sep 14 '18 05:09 pcit-ce[bot]

@khs1994 image 这里是添加配置文件嘛?没找到配置文件 ~/.kube/config

lovese avatar Sep 14 '18 05:09 lovese

跳过就行,也可以按照 https://github.com/khs1994-docker/lnmp-k8s/blob/master/docs/addons/dashboard.md 生成 token 或配置文件

khs1994 avatar Sep 14 '18 05:09 khs1994

@khs1994 image 我的是win 10 系统,命令不对

lovese avatar Sep 14 '18 05:09 lovese

@khs1994 image 我的是win 10 系统,命令不对

Tencent AI Analytic Result :smile:

pcit-ce[bot] avatar Sep 14 '18 05:09 pcit-ce[bot]

把命令拆开,执行吧,要不用 WSL (下载 kubectl https://github.com/khs1994-docker/kubectl-cn-mirror 把 .kube 复制到家目录)

khs1994 avatar Sep 14 '18 05:09 khs1994

把命令拆开,执行吧,要不用 WSL

Take the order apart, execute it, or not WSL

Tencent AI Analytic Result :smile:

pcit-ce[bot] avatar Sep 14 '18 05:09 pcit-ce[bot]

image 是要取这个字段嘛?

lovese avatar Sep 14 '18 06:09 lovese

image 是要取这个字段嘛?

! [image] (HTTPS: / user-images.githubusercontent.com / 13268438 / 45532432-9dc4f980-b826-11e8-9da6-51eccd169a7.png) do you want to take this field?

Tencent AI Analytic Result :smile:

pcit-ce[bot] avatar Sep 14 '18 06:09 pcit-ce[bot]

@khs1994 我登陆了,再次谢谢您!

lovese avatar Sep 14 '18 06:09 lovese

@khs1994 我登陆了,再次谢谢您!

@ KHS 1994 I landed, thank you again!

Tencent AI Analytic Result :+1:

pcit-ce[bot] avatar Sep 14 '18 06:09 pcit-ce[bot]