Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
k8s-develop-local
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
system
k8s-develop-local
Commits
4da20e64
Commit
4da20e64
authored
Nov 01, 2018
by
胡凯旋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
627ad27e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
README.md
README.md
+11
-11
No files found.
README.md
View file @
4da20e64
...
@@ -46,7 +46,7 @@ http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-da
...
@@ -46,7 +46,7 @@ http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-da
### 安装Helm
### 安装Helm
为了之后能够使用
gm-cli
更方便地进行本地环境的搭建与开发,需要安装配置helm
为了之后能够使用
`gm-cli`
更方便地进行本地环境的搭建与开发,需要安装配置helm
```
```
# 用 homebrew 安装 Helm
# 用 homebrew 安装 Helm
$ brew install kubernetes-helm
$ brew install kubernetes-helm
...
@@ -66,14 +66,14 @@ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keyc
...
@@ -66,14 +66,14 @@ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keyc
```
```
**重启docker**
**重启docker**
2.
docker login
2.
`docker login`
```
```
docker login harbor.test.gengmei
docker login harbor.test.gengmei
username: gmuser
username: gmuser
password: Gengmei123!
password: Gengmei123!
```
```
3.
docker-for-mac上添加File Sharing配置 /srv/apps、/data/log,添加后点击Apply & Restart
3.
`docker-for-mac`
上添加
`File Sharing`
配置
`/srv/apps`
、
`/data/log`
,添加后点击
`Apply & Restart`
![](
./image/2018-11-01-11-57-39.png
)
![](
./image/2018-11-01-11-57-39.png
)
若出现如下报错,可先不必添加,但是可能会出现日志挂载不到本地Mac的情况,可能后面需要手动更改日志目录(待验证)。
若出现如下报错,可先不必添加,但是可能会出现日志挂载不到本地Mac的情况,可能后面需要手动更改日志目录(待验证)。
...
@@ -86,7 +86,7 @@ password: Gengmei123!
...
@@ -86,7 +86,7 @@ password: Gengmei123!
----------------
----------------
下面内容是不用
gm-cli的情况下手动搭建本地集群的步骤,直接使用gm-cli
的话可忽略
下面内容是不用
`gm-cli`
的情况下手动搭建本地集群的步骤,直接使用
`gm-cli`
的话可忽略
## 手动部署集群
## 手动部署集群
1.
备份之前的路由表,用当前目录下的路由表替换之前的路由表
1.
备份之前的路由表,用当前目录下的路由表替换之前的路由表
...
@@ -102,7 +102,7 @@ sudo chown 自己的用户名 /data/log /srv/apps
...
@@ -102,7 +102,7 @@ sudo chown 自己的用户名 /data/log /srv/apps
mkdir -p /data/log/backend/app /data/log/gaia/app /data/log/mimas/app /data/log/doris/app # ...
mkdir -p /data/log/backend/app /data/log/gaia/app /data/log/mimas/app /data/log/doris/app # ...
```
```
3.
clone
项目代码
3.
`clone`
项目代码
```
```
cd /srv/apps
cd /srv/apps
git clone git@git.wanmeizhensuo.com:backend/backend.git
git clone git@git.wanmeizhensuo.com:backend/backend.git
...
@@ -111,18 +111,18 @@ git clone git@git.wanmeizhensuo.com:backend/Mimas.git
...
@@ -111,18 +111,18 @@ git clone git@git.wanmeizhensuo.com:backend/Mimas.git
git clone git@git.wanmeizhensuo.com:rank/doris.git
git clone git@git.wanmeizhensuo.com:rank/doris.git
```
```
4.
每个项目
checkout到paas分支,build
镜像
4.
每个项目
`checkout`
到
`paas`
分支,
`build`
镜像
```
```
cd 项目目录
cd 项目目录
git checkout paas
git checkout paas
docker build --no-cache -t 项目名:local.latest .
docker build --no-cache -t 项目名:local.latest .
```
```
另外需要一个
Redis
的镜像:
另外需要一个
`Redis`
的镜像:
```
```
docker pull redis
docker pull redis
```
```
5.
复制
settings_local
到项目目录下
5.
复制
`settings_local`
到项目目录下
```
```
cp ./settings_local/backend/settings_local.py /srv/apps/backend/gengmei
cp ./settings_local/backend/settings_local.py /srv/apps/backend/gengmei
cp ./settings_local/gaia/settings_local.py /srv/apps/gaia/gaia
cp ./settings_local/gaia/settings_local.py /srv/apps/gaia/gaia
...
@@ -130,7 +130,7 @@ cp ./settings_local/mimas/settings_local.py /srv/apps/mimas/settings/settings_lo
...
@@ -130,7 +130,7 @@ cp ./settings_local/mimas/settings_local.py /srv/apps/mimas/settings/settings_lo
cp ./settings_local/doris/devel.py /srv/apps/doris/doris/devel.py
cp ./settings_local/doris/devel.py /srv/apps/doris/doris/devel.py
```
```
6.
设置
configmap
6.
设置
`configmap`
```
```
kubectl create configmap static-route-table --from-file=/etc/gm-config/storage/static.dir/helios.dir/static_route_table.json
kubectl create configmap static-route-table --from-file=/etc/gm-config/storage/static.dir/helios.dir/static_route_table.json
kubectl create configmap backend-settings --from-file=/srv/apps/backend/gengmei/settings_local.py
kubectl create configmap backend-settings --from-file=/srv/apps/backend/gengmei/settings_local.py
...
@@ -139,7 +139,7 @@ kubectl create configmap mimas-settings --from-file=/srv/apps/mimas/settings/set
...
@@ -139,7 +139,7 @@ kubectl create configmap mimas-settings --from-file=/srv/apps/mimas/settings/set
kubectl create configmap doris-settings --from-file=/srv/apps/doris/doris/devel.py
kubectl create configmap doris-settings --from-file=/srv/apps/doris/doris/devel.py
```
```
7.
部署
Pod和Service
7.
部署
`Pod`
和
`Service`
```
```
# Pod
# Pod
kubectl create -f deploy/backend-deploy.yml
kubectl create -f deploy/backend-deploy.yml
...
@@ -163,7 +163,7 @@ kubectl get service -o wide
...
@@ -163,7 +163,7 @@ kubectl get service -o wide
### 服务调试(不使用gm-cli)
### 服务调试(不使用gm-cli)
1.
本地开发,对
/srv/apps
的服务进行开发
1.
本地开发,对
`/srv/apps`
的服务进行开发
2.
(如果涉及依赖的更新,先切到项目目录,执行
`docker build --no-cache -t 项目名:local.latest .`
)
2.
(如果涉及依赖的更新,先切到项目目录,执行
`docker build --no-cache -t 项目名:local.latest .`
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment