deploy
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 178 KiB |
|
Before Width: | Height: | Size: 260 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 176 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 270 KiB |
|
Before Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 81 KiB |
25
docs/guide/example/busybox.html
Normal file
@ -1,103 +0,0 @@
|
||||
# 部署 busybox
|
||||
|
||||
## 前提
|
||||
|
||||
必须具备如下条件:
|
||||
|
||||
* Kubernetes 集群
|
||||
* 已在集群中安装 Kuboard
|
||||
|
||||
假设您已经进入了 Kuboard 名称空间界面,如下图所示。可参考 [创建名称空间](/guide/cluster/namespace.html#创建名称空间)
|
||||
|
||||

|
||||
|
||||
|
||||
## 部署 busybox
|
||||
|
||||
[查看 busybox 介绍](https://hub.docker.com/_/busybox)
|
||||
|
||||
Busybox 是一个非常小巧(不到5M)的容器,此处用它来展示如何将一个 docker image 通过 Kuboard 部署到 kubernetes 集群中。
|
||||
|
||||
* 点击 ***创建工作负载按钮***
|
||||
|
||||
填写表单如下:
|
||||
|
||||
| 字段名称 | 填写内容 | 说明 |
|
||||
| -------- | ------------ | ------------------------------------------------------------ |
|
||||
| 服务类型 | Deployment | Kubernetes 的 Deployment 类型 |
|
||||
| 服务分层 | 中间件 | 生成的Kuberenetes对象以 cloud- 作为前缀,<br />并显示在中间件分层中 |
|
||||
| 服务名称 | busybox | 显示在 Kuboard 中的名称 |
|
||||
| 副本数量 | 1 | replicas |
|
||||
| 容器名称 | busybox | |
|
||||
| 镜像 | busybox:1.29 | hub.docker.com 中的 busybox 镜像 |
|
||||
| Command | sleep | |
|
||||
| Command | 3600 | |
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
* 完成表单填写后,点击***保存***
|
||||
|
||||
Kuboard 将对表单参数进行校验,通过后,方可执行对集群的变更操作。
|
||||
|
||||

|
||||
|
||||
* 点击***应用***
|
||||
|
||||
Kuboard 执行对集群的变更操作,变更的过程中,产生的事件以通知消息的形式显示出来。
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
## 验证工作负载
|
||||
|
||||
* 点击***完成***
|
||||
|
||||
点击完成后,可查看工作负载的信息。该界面分成四个区域:
|
||||
|
||||
* 页头区
|
||||
|
||||
页头区包含对该工作负载(本案例中为 Deployment)的操作按钮。可执行的操作有:***编辑*** / ***伸缩*** / ***刷新*** / ***删除***
|
||||
|
||||
* 工作负载基本信息
|
||||
|
||||
基本信息区显示了工作负载的 ***基本信息*** 、***运行时信息***、***访问方式***(Service)、***互联网入口***(Ingress)
|
||||
|
||||
* 容器组列表
|
||||
|
||||
容器组列表区显示了该当前对应的所有容器组(Pod),容器组列表区监听集群的动态变化,当您执行伸缩操作、或者删除容器组操作时,无需刷新,就可以查看到最新的容器组信息。
|
||||
|
||||
* 容器组详情
|
||||
|
||||
容器组详情区显示了当前选中容器组的信息,其中包括:
|
||||
|
||||
* 容器组相关事件
|
||||
* 容器组基本信息,及删除容器组的操作按钮。(此区域还包括容器组相关的监控操作,监控模块在后续的章节中介绍)
|
||||
* 容器基本信息,及查看容器日志、打开容器终端的按钮。(此区域还包括容器相关的监控操作,监控模块在后续的章节中介绍)
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
* 点击***终端***
|
||||
|
||||
此时打开了该容器的控制台,Kuboard 默认使用 /bin/bash 终端程序,而 busybox 镜像中并不包含 /bin/bash,因此您会看到一个如下图所示的错误提示:
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
* 点击***切换到 /bin/sh***
|
||||
|
||||
点击屏幕左上角的 ***切换到 /bin/sh***
|
||||
|
||||

|
||||
|
||||
* 输入 *export* 并回车
|
||||
|
||||
输入 *export* 并回车后,可查看该容器当前的环境变量。您也可以在终端中执行任何容器内部的命令。在您完成容器的部署之后,终端界面是非常有效的问题诊断工具之一。
|
||||
|
||||

|
||||
|
||||
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 80 KiB |
|
Before Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 167 KiB |
|
Before Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 294 KiB |
|
Before Width: | Height: | Size: 109 KiB |
58
docs/guide/example/import.html
Normal file
@ -1,165 +0,0 @@
|
||||
# 导入 example 微服务
|
||||
|
||||
## 前提
|
||||
|
||||
必须具备如下条件:
|
||||
|
||||
* Kubernetes 集群 (安装在阿里云,本文将使用阿里云的 NFS 服务作为存储资源,Kuboard 也可以运行在其他云环境或者私有环境中。)
|
||||
* 已在集群中安装 Kuboard
|
||||
|
||||
## 创建存储资源
|
||||
|
||||
example中用到了存储卷声明,请在 Kuboard 中 [创建存储类](/guide/cluster/storage?id=创建存储类) ,否则不能完成 example 的导入操作。
|
||||
|
||||
## 创建名称空间
|
||||
|
||||
创建新的名称空间,用来导入 exmaple。可参考 [创建名称空间](/guide/cluster/namespace?id=创建名称空间)
|
||||
|
||||
假设您已经进入了 Kuboard 名称空间界面,如下图所示:
|
||||
|
||||

|
||||
|
||||
## 导入 example
|
||||
|
||||
* 下载 <a :href="$withBase('/kuboard_example.yaml')" download="kuboard_example.yaml">kuboard_example.yaml</a> 文件
|
||||
|
||||
> 在 Kuboard 中,您无需手写 yaml 文件,此 yaml 文件的内容生成步骤如下:
|
||||
> * 通过 [创建工作负载](busybox) 完成微服务应用的部署
|
||||
> * 通过 **导出工作负载** 将名称空间中的微服务配置导出到一个 yaml 文件中
|
||||
|
||||
* 点击 ***导入工作负载*** 按钮
|
||||
|
||||

|
||||
|
||||
* 点击 ***上传文件*** 按钮
|
||||
|
||||
并选择刚才下载的 export_example.yaml 文件
|
||||
|
||||

|
||||
|
||||
* 点击 ***下一步***
|
||||
|
||||
默认选择所有的工作负载
|
||||
|
||||

|
||||
|
||||
* 点击***下一步***
|
||||
|
||||
默认选择所有要导入的配置,example中没有使用到配置信息
|
||||
|
||||

|
||||
|
||||
* 点击 ***下一步***
|
||||
|
||||
默认选择所有 Secrets
|
||||
|
||||

|
||||
|
||||
* 点击***下一步***
|
||||
|
||||
填写表单:
|
||||
|
||||
| 字段名称 | 填写内容 | 说明 |
|
||||
| ------------------ | ------------------ | ------------------------------------------------------------ |
|
||||
| 数据卷类型 | db-example-storage | NFS:容器组直连NFS<br />存储卷声明:容器组使用存储卷声明 |
|
||||
| 是否新建存储卷声明 | 创建新存储卷声明 | 使用已有存储卷声明:可以使用事先创建好的存储卷声明<br />创建新存储卷声明:可以创建新存储卷声明 |
|
||||
| 分配模式 | 动态分配 | |
|
||||
| 读写模式 | 可被多节点读写 | 只能被单节点读写、可被多节点只读、可被多节点读写 |
|
||||
| 总量 | 2Gi | 2Gi代表 2G空间 |
|
||||
|
||||
|
||||

|
||||
|
||||
* 点击***下一步***
|
||||
|
||||
填写表单:
|
||||
|
||||
| 字段名称 | 填写内容 | 说明 |
|
||||
| ---------------- | ---------------------------------- | ------------------------------------------------------------ |
|
||||
| cloud-eureka域名 | cloud-eureka.example.demo.eip.work | 使用您自己的域名,<br />在测试环境建议使用如下域名格式:<br />workloadname.namespace-name.cluster-name.domain.com<br />该域名应该解析到您worker节点的外网地址,或者worker 节点 80/443 端口对应负载均衡服务器的外网地址。 |
|
||||
| web-example | web-example.example.demo.eip | |
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
* 点击***下一步***
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
* 点击 ***确定***
|
||||
|
||||

|
||||
|
||||
* 点击 ***应用***
|
||||
|
||||

|
||||
|
||||
* 点击 ***完成***
|
||||
|
||||

|
||||
|
||||
* 点击 ***已完成***
|
||||
|
||||
可再名称空间中查看到刚才导入的 example 的所有工作负载及存储卷声明
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 验证 web-example
|
||||
|
||||
* 点击工作负载 ***web-example***
|
||||
|
||||

|
||||
|
||||
* 点击 互联网入口中的域名 ***http://web-example.example.demo.eip.work***
|
||||
|
||||
**Example 部署成功**
|
||||
|
||||

|
||||
|
||||
> web-example容器的日志中会出现如下异常,错误原因是,example使用了一个监控套件,该监控套件要求将容器注册到monitor-eureka中,当下我们并没有安装该监控套件。此错误并不影响 example 程序的使用。暂时忽略该异常。
|
||||
>
|
||||
> ```
|
||||
> [DiscoveryClient-InstanceInfoReplicator-0] WARN com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient - Request execution failed with message: java.net.UnknownHostException: monitor-eureka
|
||||
> [DiscoveryClient-InstanceInfoReplicator-0] WARN com.netflix.discovery.DiscoveryClient - DiscoveryClient_WEB-ADMIN/web-example-7f668c75db-j7ncx - registration failed Cannot execute request on any known server
|
||||
> com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
|
||||
> at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:112)
|
||||
> at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
|
||||
> at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
|
||||
> at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)
|
||||
> at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
|
||||
> at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:829)
|
||||
> at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:121)
|
||||
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
|
||||
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
|
||||
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
|
||||
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
|
||||
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
|
||||
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
|
||||
> at java.lang.Thread.run(Thread.java:748)
|
||||
> [DiscoveryClient-InstanceInfoReplicator-0] WARN com.netflix.discovery.InstanceInfoReplicator - There was a problem with the instance info replicator
|
||||
> com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
|
||||
> at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:112)
|
||||
> at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
|
||||
> at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59)
|
||||
> at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)
|
||||
> at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56)
|
||||
> at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:829)
|
||||
> at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:121)
|
||||
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
|
||||
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
|
||||
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
|
||||
> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
|
||||
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
|
||||
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
|
||||
> at java.lang.Thread.run(Thread.java:748)
|
||||
> ```
|
||||
>
|
||||
>
|
||||
|
||||
|
Before Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 125 KiB |
|
Before Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 161 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 120 KiB |
|
Before Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 296 KiB |
26
docs/guide/example/monitor.html
Normal file
@ -1,211 +0,0 @@
|
||||
|
||||
|
||||
# 监控 example (alpha)
|
||||
|
||||
## 前提
|
||||
|
||||
必须具备如下条件:
|
||||
|
||||
* 已完成 [导入 example 微服务](/guide/example/import)
|
||||
|
||||
!> 监控套件相关的功能目前处于 alpha 状态,虽然在实际投产项目中取得了非常好的效果,但是产品化封装还需要进一步改进。
|
||||
|
||||
假设您已进入 example 名称空间,如下图所示:
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
## 安装监控套件
|
||||
|
||||
### 安装全局监控套件
|
||||
|
||||
* 在 master 节点执行
|
||||
|
||||
```bash
|
||||
kubectl -n kube-system create secret generic etcd-certs --from-file=/etc/kubernetes/pki/etcd/server.crt --from-file=/etc/kubernetes/pki/etcd/server.key
|
||||
```
|
||||
|
||||
* 将鼠标移到 ***设置*** 菜单
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
* 点击 ***监控套件 - example***
|
||||
|
||||

|
||||
|
||||
* 点击 ***全局监控套件 / 查找并安装***
|
||||
|
||||

|
||||
|
||||
* 点击 ***资源层监控套件 / 安装***
|
||||
|
||||

|
||||
|
||||
* 点击 ***全局监控套件 / 资源层监控套件 / 安装***
|
||||
|
||||

|
||||
|
||||
* 根据向导提示,完成工作负载的导入
|
||||
|
||||

|
||||
|
||||
* 点击 ***资源层监控套件 / 初始化***
|
||||
|
||||
由于下载镜像需要时间,您可能需要等待5-10分钟后,才能成功执行初始化。初始化成功的话,您将看到如下提示信息。
|
||||
|
||||

|
||||
|
||||
### 安装名称空间监控套件
|
||||
|
||||
* 点击 ***名称空间监控套件 example / 查找并安装***
|
||||
|
||||

|
||||
|
||||
* 重复前述过程,安装监控套件
|
||||
|
||||
重复前述过程,完成如下监控套件的安装和初始化:
|
||||
|
||||
* Pinpoint 监控套件
|
||||
* Prometheus 监控套件
|
||||
* 熔断及限流 Sentinel
|
||||
|
||||
安装完成后,界面如下图所示:
|
||||
|
||||

|
||||
|
||||
### 查看监控套件的工作负载
|
||||
|
||||
* 点击 ***后退***
|
||||
|
||||
回到名称空间后,可查看到刚才安装监控套件时导入的监控层工作负载。
|
||||
|
||||
> 全局监控套件安装在 kube-system 名称空间
|
||||
|
||||

|
||||
|
||||
## 重启 example 容器组
|
||||
|
||||
* 点击导航栏中的 ***容器组列表***
|
||||
|
||||
在筛选条件中选择
|
||||
|
||||
* 展现层
|
||||
* 网关层
|
||||
* 服务层
|
||||
* 持久层
|
||||
* 中间件
|
||||
|
||||
并点击刷新
|
||||
|
||||
> * Kuboard 创建工作负载时,默认将其 imagePullPolicy 设置为 **Always**;
|
||||
>
|
||||
> * 删除容器组时,Kubernetes 将为该工作负载启动一个新的容器组,以尽可能地使工作负载的容器组数量等于该工作负载期望的副本数(replicas);
|
||||
> * Kubernetes 在启动容器组时,根据 imagePullPolicy 的设置 Always,将会尝试从镜像仓库抓取最新镜像,这一特性,可以用于开发环境和测试环境的版本更新,因为您的 devops 系统肯能不会为 daily build 生成新的镜像标签;
|
||||
> * 此处删除容器组的目的是,重新启动容器,以便容器中的监控探针能够检测到其对应监控套件的存在。
|
||||
|
||||

|
||||
|
||||
* 在列表中选择
|
||||
|
||||
选中如下容器组:
|
||||
|
||||
* cloud-eureka-0
|
||||
|
||||
* db-example-xxxxxx-xxxx
|
||||
|
||||
* gateway-example-xxxxxx-xxxx
|
||||
|
||||
* svc-example-xxxxxx-xxxx
|
||||
|
||||
* web-example-xxxxxx-xxxx
|
||||
|
||||

|
||||
|
||||
* 点击 ***删除*** 按钮
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
* 点击 ***确定***
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
* 点击 ***应用***
|
||||
|
||||

|
||||
|
||||
* 等待,直到容器组调整完成
|
||||
|
||||

|
||||
|
||||
* 点击 ***后退***
|
||||
|
||||

|
||||
|
||||
## 查看监控信息
|
||||
|
||||
### 查看资源层监控信息
|
||||
|
||||
* 点击 ***展现层 / web-example***
|
||||
|
||||
如果您在下图中没有看到 ***Nginx 监控***, ***容器组监控*** 等,请刷新您的页面,因为监控套件初始化之后需要刷新页面才能加载并显示。
|
||||
|
||||

|
||||
|
||||
* 点击 ***所在节点监控***
|
||||
|
||||
可查看所在节点的资源使用情况监控信息
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### 查看中间件层监控信息
|
||||
|
||||
#### 查看 Nginx 监控
|
||||
|
||||
* 点击 Nginx 监控
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
#### 查看 MySQL 监控
|
||||
|
||||
* 返回 ***example*** 名称空间
|
||||
* 点击 ***持久层 / example db***
|
||||
* 点击 ***MySQL 监控***
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
#### 查看 JVM 监控
|
||||
|
||||
* 返回 ***example*** 名称空间
|
||||
* 点击 ***微服务层 / example***
|
||||
* 点击 ***Java 虚拟机监控***
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
### 查看链路追踪监控信息
|
||||
|
||||
* 在 ***微服务层 / example*** 中点击 ***链路追踪***
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||
|
Before Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 76 KiB |