Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
khs1994 opened this issue May 19, 2018 · 28 comments
Closed

Comments

@khs1994
Copy link
Member

khs1994 commented May 19, 2018

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

添加如下 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 added a commit that referenced this issue May 19, 2018
* Update PowerShell script
@khs1994 khs1994 changed the title [Tips] 支持 gcr.io local server,避开网络问题,支持 Docker 桌面版开启 kubernetes [Tips] 支持 k8s.gcr.io gcr.io local server,避开网络问题,支持 Docker 桌面版开启 kubernetes Jun 9, 2018
@khs1994 khs1994 closed this as completed Jul 18, 2018
@khs1994 khs1994 changed the title [Tips] 支持 k8s.gcr.io gcr.io local server,避开网络问题,支持 Docker 桌面版开启 kubernetes Support k8s.gcr.io gcr.io local server,Docker for desktop run kubernetes Aug 22, 2018
@khs1994 khs1994 reopened this Aug 22, 2018
@lovese
Copy link

lovese commented Sep 13, 2018

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

@pcit-ce

This comment has been minimized.

@khs1994
Copy link
Member Author

khs1994 commented Sep 13, 2018

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

@khs1994-docker khs1994-docker deleted a comment from pcit-ce bot Sep 13, 2018
@lovese
Copy link

lovese commented Sep 13, 2018

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

@khs1994-docker khs1994-docker deleted a comment from pcit-ce bot Sep 13, 2018
@pcit-ce
Copy link
Contributor

pcit-ce bot commented Sep 13, 2018

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

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

Tencent AI Analytic Result 😄

@khs1994
Copy link
Member Author

khs1994 commented Sep 13, 2018

$ ~/.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-docker khs1994-docker deleted a comment from pcit-ce bot Sep 13, 2018
@lovese
Copy link

lovese commented Sep 13, 2018

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

@pcit-ce
Copy link
Contributor

pcit-ce bot commented Sep 13, 2018

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

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

Tencent AI Analytic Result 😄

@khs1994
Copy link
Member Author

khs1994 commented Sep 13, 2018

安装 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 项目,关闭功能暂时没有

@pcit-ce
Copy link
Contributor

pcit-ce bot commented Sep 13, 2018

安装 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 😄

@lovese
Copy link

lovese commented Sep 13, 2018

@khs1994 好的,谢谢了!

@pcit-ce
Copy link
Contributor

pcit-ce bot commented Sep 13, 2018

@khs1994 好的,谢谢了!

@ khs1994 OK, thanks!

Tencent AI Analytic Result 👍

@lovese
Copy link

lovese commented Sep 14, 2018

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

@pcit-ce

This comment has been minimized.

@khs1994
Copy link
Member Author

khs1994 commented Sep 14, 2018

访问 dashboard ?

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

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

$ kubectl proxy

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

@pcit-ce

This comment has been minimized.

@lovese
Copy link

lovese commented Sep 14, 2018

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

@pcit-ce

This comment has been minimized.

@lovese
Copy link

lovese commented Sep 14, 2018

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

@khs1994-docker khs1994-docker deleted a comment from pcit-ce bot Sep 14, 2018
@khs1994
Copy link
Member Author

khs1994 commented Sep 14, 2018

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

@khs1994-docker khs1994-docker deleted a comment from pcit-ce bot Sep 14, 2018
@lovese
Copy link

lovese commented Sep 14, 2018

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

@pcit-ce

This comment has been minimized.

@khs1994
Copy link
Member Author

khs1994 commented Sep 14, 2018

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

@pcit-ce
Copy link
Contributor

pcit-ce bot commented Sep 14, 2018

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

Take the order apart, execute it, or not WSL

Tencent AI Analytic Result 😄

@lovese

This comment has been minimized.

@pcit-ce

This comment has been minimized.

@lovese
Copy link

lovese commented Sep 14, 2018

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

@pcit-ce
Copy link
Contributor

pcit-ce bot commented Sep 14, 2018

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

@ KHS 1994 I landed, thank you again!

Tencent AI Analytic Result 👍

@khs1994 khs1994 closed this as completed Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants