Skip to content

Commit

Permalink
docker mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
shaohq committed Feb 10, 2020
1 parent cf6113d commit 5549eea
Show file tree
Hide file tree
Showing 12 changed files with 221 additions and 77 deletions.
16 changes: 8 additions & 8 deletions .vuepress/components/ad-list.js
Expand Up @@ -47,14 +47,14 @@ module.exports = [
url: 'https://kubetrain.cn/?from=kuboard-ads',
weight: 60
},
{
name: '12元直播课',
description: 'Kubernetes集群安装详解,安装脚本定制',
strong: '入门起点',
action: '捧个场',
url: 'https://ke.qq.com/course/477593?flowToken=1016937',
weight: 60
}
// {
// name: '12元直播课',
// description: 'Kubernetes集群安装详解,安装脚本定制',
// strong: '入门起点',
// action: '捧个场',
// url: 'https://ke.qq.com/course/477593?flowToken=1016937',
// weight: 60
// }

// {
// name: '宝塔面板',
Expand Down
1 change: 1 addition & 0 deletions .vuepress/config-sidebar.js
Expand Up @@ -38,6 +38,7 @@ module.exports = {
'install-kubernetes',
'sealos/',
'install-node-port-range',
'docker-mirror',
'k8s-restart',
]
},
Expand Down
11 changes: 7 additions & 4 deletions .vuepress/theme/components/Page.vue
Expand Up @@ -4,7 +4,7 @@
</div>
<div v-show="!$isSharing && !$frontmatter.lessAds" class="page-nav" style="max-width: 1000px; margin: auto;">
<div class="tip custom-block row" style="padding: 1rem; margin-top: 0;">
<div style="display: inline-block; vertical-align: top; line-height: 1.6rem;" class="col-md-10">
<div style="display: inline-block; vertical-align: top; line-height: 1.6rem;" class="col-md-8">
<li>
<span style="color: red; font-weight: 500;">免费</span>
Kubernetes教程K8S教程,绝不降低品质
Expand All @@ -23,10 +23,13 @@
</span> -->
</li>
</div>
<div class="col-md-2">
<a href="https://ke.qq.com/course/477593?flowToken=1017366" target="_blank">
<div class="col-md-4">
<span style="font-size: 18px; font-weight: 600;">Kuboard</span>
<br/>
<span style="font-size: 14px; color: #666;">- 快速在 Kubernetes 落地微服务</span>
<!-- <a href="https://ke.qq.com/course/477593?flowToken=1017366" target="_blank">
<FancyImage src="/images/courses/kubeadm.png" title="K8S高薪培训" description="360讲师授课" alt="K8S培训_高薪培训" type="Rectangle"/>
</a>
</a> -->
</div>
</div>
</div>
Expand Down
70 changes: 40 additions & 30 deletions docker-compose.yaml
@@ -1,38 +1,48 @@
version: "3"
services:
web:
# replace username/repo:tag with your name and image details
image: eipwork/kuboard-press:latest
deploy:
replicas: 1
resources:
limits:
cpus: "0.1"
memory: 500M
restart_policy:
condition: on-failure
kuboard:
image: eipwork/kuboard:lua
ports:
- "8081:80"
- "8083:80"
volumes:
- ./docs:/usr/share/nginx/html
networks:
- webnet
kubetrain:
# replace username/repo:tag with your name and image details
image: eipwork/kuboard-press:latest
deploy:
replicas: 1
resources:
limits:
cpus: "0.1"
memory: 500M
restart_policy:
condition: on-failure
ports:
- "8082:80"
volumes:
- /Users/shaohuanqing/Kuboard/kuboard-workspace/kubetrain/root:/usr/share/nginx/html
- /Users/shaohuanqing/Kuboard/kuboard-workspace/nginx-lua/docker/nginx.80.conf:/etc/nginx/conf.d/nginx.80.conf
- /Users/shaohuanqing/Kuboard/kuboard-workspace/kuboard-press/docs:/usr/share/nginx/html
- /Users/shaohuanqing/Kuboard/kuboard-workspace/nginx-lua/docker/nginx-jwt.lua:/usr/local/openresty/nginx/jwt-lua/resty/nginx-jwt.lua
networks:
- webnet
# web:
# # replace username/repo:tag with your name and image details
# image: eipwork/kuboard-press:latest
# deploy:
# replicas: 1
# resources:
# limits:
# cpus: "0.1"
# memory: 500M
# restart_policy:
# condition: on-failure
# ports:
# - "8081:80"
# volumes:
# - ./docs:/usr/share/nginx/html
# networks:
# - webnet
# kubetrain:
# # replace username/repo:tag with your name and image details
# image: eipwork/kuboard-press:latest
# deploy:
# replicas: 1
# resources:
# limits:
# cpus: "0.1"
# memory: 500M
# restart_policy:
# condition: on-failure
# ports:
# - "8082:80"
# volumes:
# - /Users/shaohuanqing/Kuboard/kuboard-workspace/kubetrain/root:/usr/share/nginx/html
# networks:
# - webnet
networks:
webnet:
84 changes: 84 additions & 0 deletions install/docker-mirror.md
@@ -0,0 +1,84 @@
---
vssueId: 115
description: 修改 docker 镜像仓库地址,加快 docker 镜像的下载速度
meta:
- name: keywords
content: docker镜像加速
---

# Docker镜像加速

* docker 中,只能够为 docker 官方镜像仓库 hub.docker.com 提供 mirror 加速,自建的 docker 镜像仓库是不能配置 mirror 加速的;
* 如果您参考 kuboard.cn 提供的 kubernetes 安装文档,默认使用的 docker mirror 是 https://registry.cn-hangzhou.aliyuncs.com

## 修改镜像仓库 mirror 地址

本文提供了快速修改的方式和手工修改的方式,效果相同


<b-tabs content-class="mt-3">
<b-tab title="快速修改" active>

* 下面提供了四个 mirror 地址,您可以去掉其中任意一个地址的注释,以使用该 mirror 地址。

``` sh
# Docker中国 mirror
# export REGISTRY_MIRROR="https://registry.docker-cn.com"
# 腾讯云 docker hub mirror
# export REGISTRY_MIRROR="https://mirror.ccs.tencentyun.com"
# DaoCloud 镜像
# export REGISTRY_MIRROR="http://f1361db2.m.daocloud.io"
# 阿里云 docker hub mirror
export REGISTRY_MIRROR=https://registry.cn-hangzhou.aliyuncs.com
curl -sSL https://kuboard.cn/install-script/set_mirror.sh | sh -s ${REGISTRY_MIRROR}
systemctl daemon-reload
systemctl restart docker
systemctl start kubelet # 假设您安装了 kubenetes
```

</b-tab>
<b-tab title="手工修改">

* 修改 /etc/docker/daemon.json 文件(如果没有,则创建):
``` sh
vim /etc/docker/daemon.json
```
* 添加 registry-mirrors 字段:
``` json
{
"registry-mirrors": ["https://registry.cn-hangzhou.aliyuncs.com"]
}
```
* 重启 docker/kubelet

```sh
systemctl daemon-reload
systemctl restart docker
systemctl start kubelet # 假设您安装了 kubenetes
```

</b-tab>
</b-tabs>

## 查看修改结果
* 执行命令
``` sh
docker info
```
* 查看结果
``` log {12}
...
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Registry Mirrors:
https://registry.cn-hangzhou.aliyuncs.com
Live Restore Enabled: false
Product License: Community Engine
```
19 changes: 10 additions & 9 deletions install/install-dashboard.md
Expand Up @@ -35,13 +35,13 @@ Kuboard 是 Kubernetes 的一款图形化管理界面。

| Kubernetes 版本 | Kuboard 版本 | 兼容性 | 说明 |
| --------------- | -------------- | ------ | ------------------------------------------------------------ |
| v1.17 | v1.0 | <span style="font-size: 24px;">😄</span> | 已验证 |
| v1.16 | v1.0 | <span style="font-size: 24px;">😄</span> | 已验证 |
| v1.15 | v1.0 | <span style="font-size: 24px;">😄</span> | 已验证 |
| v1.14 | v1.0 | <span style="font-size: 24px;">😄</span> | 已验证 |
| v1.13 | v1.0 | <span style="font-size: 24px;">😄</span> | 已验证 |
| v1.12 | v1.0 | <span style="font-size: 24px;">😐</span> | Kubernetes Api v1.12 不支持 dryRun,<br />忽略Kuboard在执行命令时的参数校验错误,可正常工作 |
| v1.11 | v1.0 | <span style="font-size: 24px;">😐</span> | 同上 |
| v1.17 | v1.0.x | <span style="font-size: 24px;">😄</span> | 已验证 |
| v1.16 | v1.0.x | <span style="font-size: 24px;">😄</span> | 已验证 |
| v1.15 | v1.0.x | <span style="font-size: 24px;">😄</span> | 已验证 |
| v1.14 | v1.0.x | <span style="font-size: 24px;">😄</span> | 已验证 |
| v1.13 | v1.0.x | <span style="font-size: 24px;">😄</span> | 已验证 |
| v1.12 | v1.0.x | <span style="font-size: 24px;">😐</span> | Kubernetes Api v1.12 不支持 dryRun,<br />Kuboard 不支持 Kubernetes v1.12 |
| v1.11 | v1.0.x | <span style="font-size: 24px;">😐</span> | Kuboard 不支持 Kubernetes v1.11 |
## 安装


Expand Down Expand Up @@ -92,6 +92,7 @@ kuboard-54c9c4f6cb-6lf88 1/1 Running 0 45s

``` sh
kubectl delete -f https://kuboard.cn/install-script/kuboard.yaml
kubectl delete -f https://addons.kuboard.cn/metrics-server/0.3.6/metrics-server.yaml
```

</b-tab>
Expand Down Expand Up @@ -215,7 +216,7 @@ kubectl port-forward service/kuboard 8080:80 -n kube-system
如需要无登录访问集群概览页面,可使用如下格式的 url 进入:

```
http://任意一个Worker节点的IP地址:32567/#/dashboard?k8sToken=yourtoken
http://任意一个Worker节点的IP地址:32567/dashboard?k8sToken=yourtoken
```

::: tip 其他界面
Expand All @@ -226,7 +227,7 @@ http://任意一个Worker节点的IP地址:32567/#/dashboard?k8sToken=yourtoken

如果想要无登录直接访问容器组的控制台,可使用如下格式的 url 进入:
```
http://任意一个Worker节点的IP地址:32567/#/console/yournamespace/yourpod?containerName=yourcontainer&shell=bash&k8sToken=yourtoken
http://任意一个Worker节点的IP地址:32567/console/yournamespace/yourpod?containerName=yourcontainer&shell=bash&k8sToken=yourtoken
```

其中,shell 参数可选取值有:
Expand Down
16 changes: 8 additions & 8 deletions install/upgrade-k8s/1.15.x-1.15.4.md
@@ -1,12 +1,12 @@
---
vssueId: 92
description: Kubernete升级_使用kubeadm升级K8S集群到v1.15.5
description: Kubernete升级_使用kubeadm升级K8S集群到v1.15.7
meta:
- name: keywords
content: Kubernetes升级,K8S升级,升级Kuberentes1.15.5
content: Kubernetes升级,K8S升级,升级Kuberentes1.15.7
---

# K8S从1.15.x升级到 1.15.5
# K8S从1.15.x升级到 1.15.7

<AdSenseTitle/>

Expand All @@ -16,10 +16,10 @@ meta:
## 前提条件

* 您使用 kubeadm 安装了 kubernetes v1.15.0 / v1.15.1 / v1.15.2 / v1.15.3 / v1.15.4 集群
* 您想要将其升级到最新的版本 kubernetes v1.15.5
* 您想要将其升级到最新的版本 kubernetes v1.15.7

::: tip
www.kuboard.cn 是一款免费的基于 Kubernetes 的微服务管理界面,目前只能提供 kubernetes v1.15.0 / v1.15.1 / v1.15.2 / v1.15.3 到 kubernetes v1.15.5 的升级文档,其他版本的集群,请参考 kubernetes 官网文档 [kubeadm upgrade](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-upgrade/)
www.kuboard.cn 是一款免费的基于 Kubernetes 的微服务管理界面,目前只能提供 kubernetes v1.15.0 / v1.15.1 / v1.15.2 / v1.15.3 到 kubernetes v1.15.7 的升级文档,其他版本的集群,请参考 kubernetes 官网文档 [kubeadm upgrade](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-upgrade/)
:::

## 升级 kubeadm/kubelet/kubectl
Expand All @@ -28,7 +28,7 @@ www.kuboard.cn 是一款免费的基于 Kubernetes 的微服务管理界面,

``` sh
# 在所有节点执行(包括 master 和 worker 节点)
yum install -y kubelet-1.15.5 kubeadm-1.15.5 kubectl-1.15.5
yum install -y kubelet-1.15.7 kubeadm-1.15.7 kubectl-1.15.7
systemctl daemon-reload
systemctl restart kubelet
```
Expand Down Expand Up @@ -74,7 +74,7 @@ scheduler: {}

文件内容如下所示,根据前面 `kubeadm config view` 的执行结果,修改了如下字段:
* imageRepository 的值修改为:registry.cn-hangzhou.aliyuncs.com/google_containers
* kubernetesVersion 的值修改为: v1.15.5
* kubernetesVersion 的值修改为: v1.15.7
``` yaml {15,17}
apiServer:
extraArgs:
Expand All @@ -92,7 +92,7 @@ etcd:
dataDir: /var/lib/etcd
imageRepository: registry.cn-hangzhou.aliyuncs.com/google_containers
kind: ClusterConfiguration
kubernetesVersion: v1.15.5
kubernetesVersion: v1.15.7
networking:
dnsDomain: cluster.local
serviceSubnet: 10.96.0.0/12
Expand Down
8 changes: 5 additions & 3 deletions learning/k8s-advanced/sec/kuboard.md
Expand Up @@ -15,17 +15,19 @@ meta:



首先,确保您已经 [安装了 Kuboard](/install/install-dashboard-upgrade.html) <Badge>Kuboard v1.0.6-beta.3</Badge>,并且使用 [管理员用户](/install/install-dashboard.html#获取token)) 登录Kuboard
首先,确保您已经 [安装了 Kuboard](/install/install-dashboard-upgrade.html) <Badge>Kuboard v1.0.6</Badge>,并且使用 [管理员用户](/install/install-dashboard.html#获取token)) 登录Kuboard



## 为名称空间创建管理员用户

::: tip 用户名密码?
* 当前只支持 [ServiceAccount](/learning/k8s-advanced/sec/sa-admin.html#user-accounts-vs-service-accounts)
* 用户名密码(OpenID Connect)的登录方式将在2020年2月提供
* 本文档以 [ServiceAccount](/learning/k8s-advanced/sec/sa-admin.html#user-accounts-vs-service-accounts) 为例
* 用户名密码(OpenID Connect)的登录方式请参考 [使用 GitHub/GitLab 账号登录 Kubernetes](/learning/k8s-advanced/sec/authenticate/install.html)
:::

<Course courseId="484058" />

按照下面的步骤,可以快速为 Kubernetes 中的某个名称空间创建管理用户

* 进入 Kuboard 名称空间页面,如下图所示:
Expand Down
13 changes: 6 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -6,8 +6,6 @@
"devDependencies": {
"@vssue/api-github-v4": "^1.2.1",
"@vssue/vuepress-plugin-vssue": "^1.2.0",
"@vuepress/plugin-active-header-links": "^1.0.0-rc.1",
"@vuepress/plugin-back-to-top": "^1.2.0",
"@vuepress/plugin-google-analytics": "^1.2.0",
"@vuepress/plugin-medium-zoom": "^1.2.0",
"@vuepress/plugin-nprogress": "^1.2.0",
Expand All @@ -21,6 +19,8 @@
"vuepress-plugin-sitemap": "^2.1.2"
},
"dependencies": {
"@vuepress/plugin-active-header-links": "^1.3.0",
"@vuepress/plugin-back-to-top": "^1.3.0",
"@vuepress/plugin-pwa": "^1.2.0",
"animated-number-vue": "^1.0.0",
"aos": "^3.0.0-beta.6",
Expand Down

0 comments on commit 5549eea

Please sign in to comment.