From 959296e3ae6c96f808b8195278cbd7f0454a8da0 Mon Sep 17 00:00:00 2001 From: "huanqing.shao" Date: Sat, 28 Sep 2019 17:42:44 +0800 Subject: [PATCH] vssue --- .vuepress/config.js | 12 +- .../install-script/v1.16.0/init_master.sh | 3 + .../install-script/v1.16.0/install_kubelet.sh | 3 + .vuepress/theme/components/PageVssue.vue | 12 +- README.md | 2 + learning/README.md | 4 +- .../k8s-intermediate/config/secrets/index.md | 2 +- learning/k8s-intermediate/persistent/nfs.md | 1 + learning/k8s-practice/ocp/auth-server.md | 113 ++++++++++++++++++ learning/k8s-practice/ocp/index.md | 2 +- 10 files changed, 145 insertions(+), 9 deletions(-) create mode 100644 learning/k8s-practice/ocp/auth-server.md diff --git a/.vuepress/config.js b/.vuepress/config.js index f6686b9..f54d886 100644 --- a/.vuepress/config.js +++ b/.vuepress/config.js @@ -40,7 +40,7 @@ module.exports = { // set `platform` rather than `api` platform: 'github', locale: 'zh-CN', - autoCreateIssue: true, + autoCreateIssue: false, admins: ['shaohq'], // all other options of Vssue are allowed owner: 'eip-work', @@ -162,10 +162,17 @@ module.exports = { 'install-docker-desktop', ['install-k8s', '安装Kubernetes单Master节点'], 'install-kubernetes', - ['install-k8s-upgrade', '升级Kubernetes集群'], 'install-kubectl' ] }, + { + title: '升级 Kubernetes', + collapsable: false, + children: [ + // ['install-k8s-upgrade', '升级Kubernetes集群'], + 'upgrade-k8s/1.15.x-1.15.4', + ] + }, { title: '安装 Kuboard', collapsable: false, @@ -348,6 +355,7 @@ module.exports = { 'k8s-practice/ocp/eureka-server', 'k8s-practice/ocp/mysql', 'k8s-practice/ocp/redis', + 'k8s-practice/ocp/auth-server', ] }, ] diff --git a/.vuepress/public/install-script/v1.16.0/init_master.sh b/.vuepress/public/install-script/v1.16.0/init_master.sh index f15a383..e16b4fa 100644 --- a/.vuepress/public/install-script/v1.16.0/init_master.sh +++ b/.vuepress/public/install-script/v1.16.0/init_master.sh @@ -2,6 +2,9 @@ # 只在 master 节点执行 +# 脚本出错时终止执行 +set -e + # 查看完整配置选项 https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2 rm -f ./kubeadm-config.yaml cat < ./kubeadm-config.yaml diff --git a/.vuepress/public/install-script/v1.16.0/install_kubelet.sh b/.vuepress/public/install-script/v1.16.0/install_kubelet.sh index f4d90e5..02fc1cb 100644 --- a/.vuepress/public/install-script/v1.16.0/install_kubelet.sh +++ b/.vuepress/public/install-script/v1.16.0/install_kubelet.sh @@ -2,6 +2,9 @@ # 在 master 节点和 worker 节点都要执行 +# 脚本出错时终止执行 +set -e + # 安装 docker # 参考文档如下 # https://docs.docker.com/install/linux/docker-ce/centos/ diff --git a/.vuepress/theme/components/PageVssue.vue b/.vuepress/theme/components/PageVssue.vue index ac3e08c..8504149 100644 --- a/.vuepress/theme/components/PageVssue.vue +++ b/.vuepress/theme/components/PageVssue.vue @@ -3,8 +3,11 @@
-
请创建 VssueId
- + 请创建 VssueId +
+
+ 请填写 vusseId - {{refreshId}} +
@@ -14,7 +17,8 @@ export default { data() { return { - vssues: {} + vssues: {}, + refreshId: undefined } }, computed: { @@ -31,7 +35,7 @@ export default { let result = { platform: 'github', locale: 'zh-CN', - autoCreateIssue: false, + autoCreateIssue: true, admins: ['shaohq'], // all other options of Vssue are allowed owner: 'eip-work', diff --git a/README.md b/README.md index 87efb71..ee04a2d 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,8 @@ Kubernetes教程的主要依据是:Kubernetes 官网文档,以及使用 Kubo * [构建Docker镜像并推送到仓库](https://kuboard.cn/learning/k8s-practice/ocp/build.html) * [部署顺序](https://kuboard.cn/learning/k8s-practice/ocp/sequence.html) * [在K8S上部署eureka-server](https://kuboard.cn/learning/k8s-practice/ocp/eureka-server.html) +* [在K8S上部署mysql](https://kuboard.cn/learning/k8s-practice/ocp/mysql.html) +* [在K8S上部署redis](https://kuboard.cn/learning/k8s-practice/ocp/redis.html) * [在K8S上部署auth-server] * [在K8S上部署user-center] * [在K8S上部署api-gateway] diff --git a/learning/README.md b/learning/README.md index 3b15719..cd57637 100644 --- a/learning/README.md +++ b/learning/README.md @@ -89,7 +89,9 @@ description: Kubernetes免费中文教程目录 * [构建docker镜像并推送到仓库](/learning/k8s-practice/ocp/build.html) * [部署顺序](/learning/k8s-practice/ocp/sequence.html) * [在K8S上部署eureka-server](/learning/k8s-practice/ocp/eureka-server.html) -* [在K8S上部署auth-server] +* [在K8S上部署mysql](/learning/k8s-practice/ocp/mysql.html) +* [在K8S上部署redis](/learning/k8s-practice/ocp/redis.html) +* [在K8S上部署auth-center](/learning/k8s-practice/ocp/auth-server.html) * [在K8S上部署user-center] * [在K8S上部署api-gateway] * [在K8S上部署back-center] diff --git a/learning/k8s-intermediate/config/secrets/index.md b/learning/k8s-intermediate/config/secrets/index.md index 925f3e0..76ac1cf 100644 --- a/learning/k8s-intermediate/config/secrets/index.md +++ b/learning/k8s-intermediate/config/secrets/index.md @@ -42,4 +42,4 @@ Kubernetes 自动创建包含访问 Kubernetes APIServer 身份信息的 Secret ## 解码和编辑 -Kubenetes 中,Secret 使用 base64 编码存储,您可以将其 [解码](./decode-edit.html) 获得对饮信息的原文,创建 Secret 之后,您也可以再次 [编辑](./decode-edit.html) Secret +Kubenetes 中,Secret 使用 base64 编码存储,您可以将其 [解码](./decode-edit.html) 获得对应信息的原文,创建 Secret 之后,您也可以再次 [编辑](./decode-edit.html) Secret diff --git a/learning/k8s-intermediate/persistent/nfs.md b/learning/k8s-intermediate/persistent/nfs.md index e8a1fd8..275702c 100644 --- a/learning/k8s-intermediate/persistent/nfs.md +++ b/learning/k8s-intermediate/persistent/nfs.md @@ -1,4 +1,5 @@ --- +vssueId: 91 layout: LearningLayout description: Kubernetes教程_本文描述如何搭建NFS服务_并在Kubernetes中配置StorageClass使用该NFS服务作为存储 --- diff --git a/learning/k8s-practice/ocp/auth-server.md b/learning/k8s-practice/ocp/auth-server.md new file mode 100644 index 0000000..2fd412c --- /dev/null +++ b/learning/k8s-practice/ocp/auth-server.md @@ -0,0 +1,113 @@ +--- +vssueId: 94 +layout: LearningLayout +description: Kubernetes教程_使用Kuboard在Kubernetes上部署Spring_Cloud_open_capacity_platform微服务能力开放平台_部署auth-center +--- + +# 在K8S上部署auth-center + +本文假设您已经完成了 [在Kubernetes 上部署 Spring Cloud - OCP](./) 系列教程的前面部分,并已经完成了 eureka-server、auth-center-mysql、redis 在 K8S 上的部署。 + +## 理解auth-server + +auth-server 是一个 Spring Boot 项目,其配置文件位于路径 `oauth-center/auth-server/src/main/resources`,该目录内容如下所示: + +``` sh +├── application.yml +├── bootstrap.yml +└── mybatis.cfg.xml +``` + +### 监听端口 + +参考 `bootstrap.yml` 的如下代码片段,auth-server 监听 8000 端口 + +``` yaml {3} +#端口 +server: + port: 8000 +# port: ${randomServerPort.value[8000,8000]} #随机端口 +``` + +### 依赖项 + +auth-server 的部署依赖有: +* eureka-server +* mysql +* redis + +上述依赖在教程的前面部分都已经完成部署。 + +* **eureka-server** 依赖项 + +参考 `bootstrap.yml` 的如下代码片段,auth-server 中默认配置的 eureka-server 的地址为 `http://127.0.0.1:1111/eureka` + +``` yaml {5} +#eureka client 配置 +eureka: + client: + serviceUrl: + defaultZone: http://127.0.0.1:1111/eureka #http://130.75.131.241:8761/eureka,http://130.75.131.248:8762/eureka + #http://134.224.249.33:1111/eureka/ 正式库 + #http://134.224.249.33:1111/eureka/ 测试库 +``` + +* **mysql** 依赖项 + +参考 `application.yml` 的如下代码片段,auth-server 中默认配置的 mysql 的连接参数如下: + +``` yaml {10,11,12,15,16,17} +spring: + session: + store-type: redis + datasource: + dynamic: + enable: true + druid: + # JDBC 配置(驱动类自动从url的mysql识别,数据源类型自动识别) + core: + url: jdbc:mysql://59.110.164.254:3306/oauth-center?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false + username: root + password: root + driver-class-name: com.mysql.jdbc.Driver + log: + url: jdbc:mysql://59.110.164.254:3306/log-center?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false + username: root + password: root + driver-class-name: com.mysql.jdbc.Driver +``` + +* **redis** 依赖项 + +参考 `application.yml` 的如下代码片段,auth-server 中默认配置的 redis 的连接参数如下: + +``` yaml {5,6} +spring: + # ... ... ... + redis: + ################### redis 单机版 start ########################## + host: 59.110.164.254 + port: 6379 + timeout: 6000 + database: 3 +``` + +## 确定部署方案 + +auth-server 为无状态服务,使用 Deployment 部署,并通过环境变量覆盖如下参数: + +* eureka.client.serviceUrl.defaultZone + http://cloud-eureka-0.cloud-eureka.ocp.svc.cluster.local:1111/eureka,http://cloud-eureka-1.cloud-eureka.ocp.svc.cluster.local:1111/eureka,http://cloud-eureka-2.cloud-eureka.ocp.svc.cluster.local:1111/eureka +* spring.datasource.druid.core.url + +* spring.datasource.druid.core.username +* spring.datasource.druid.core.password +* spring.datasource.druid.log.url +* spring.datasource.druid.log.username +* spring.datasource.druid.log.password +* spring.redis.host +* spring.redis.port + +## 部署auth-server + +## 检查部署结果 diff --git a/learning/k8s-practice/ocp/index.md b/learning/k8s-practice/ocp/index.md index 9443296..cba2bd6 100644 --- a/learning/k8s-practice/ocp/index.md +++ b/learning/k8s-practice/ocp/index.md @@ -23,7 +23,7 @@ Kuboard 网站将陆续 **连载** 如何使用 Kuboard 在 Kubernetes 上部署 * [在K8S上部署eureka-server](/learning/k8s-practice/ocp/eureka-server.html) * [在K8S上部署mysql](/learning/k8s-practice/ocp/mysql.html) * [在K8S上部署redis](/learning/k8s-practice/ocp/redis.html) -* [在K8S上部署auth-server] +* [在K8S上部署auth-server](/learning/k8s-practice/ocp/auth-server.html) * [在K8S上部署user-center] * [在K8S上部署api-gateway] * [在K8S上部署back-center]