Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gzchen008 committed Jan 7, 2021
1 parent 741dfb6 commit 3fbb288
Showing 1 changed file with 53 additions and 51 deletions.
104 changes: 53 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,76 @@
# Dockin Ops - Dockin Operation service
# Dockin Ops-Dockin Operation service

English | [中文](README.zh-CN.md)

Dockin container platform Operation service
Dockin container platform Operation service


![Architecture](docs/images/dockin.png)

## 快速指南
## Quick Guide

### 1. Preparation
- k8s集群
- 提前部署dockin rm,opserver需要调用rm接口获取信息
- 准备redis,可通过以下命令快速运行redis:
- k8s cluster
- Deploy Docking rm in advance, opserver needs to call rm interface to get information
- Prepare redis, you can quickly run redis with the following command:
```
docker run -p 6379:6379 -d redis:latest redis-server
```
- 规划部署opserver的服务器,记录ip
- Plan to deploy opserver server, record the ip

### 2. Compile

#### 2.1 Dockin-opserver
- 修改配置文件application.yaml,需要注意的主要为rm的地址
- Modify the configuration file application.yaml, the main thing to note is the address of rm

```
rm-address: http://127.0.0.1:10002/rmController # RM访问地址
rm-address: http://127.0.0.1:10002/rmController # RM access address
batch-timeout: 5000
http-port: 8084 # opserver的监听端口
http-port: 8084 # listening port of opserver
cmd-filter-type: blacklist
while-list-update-time: 60000
limits:
exec-forbidden:
- vi
-vi
file-max-size: 1000
upload-file-max-size: 500
download-file-max-size: 4000
vi-file-max-size: 10
k8s-qos: 40
k8s-burst: 60
opagent-port: 8085 # opagent的监听端口
opagent-port: 8085 # listening port of opagent
redis:
expiration: 120000
accounts: # opserver的用户信息,当前在配置文件中配置
- account:
accounts: # User information of opserver, currently configured in the configuration file
-account:
user-name: app
passwd: passwd
```
- 编译:执行以下命令即可

- Compile: execute the following command

```
make
make
```

#### 2.2 Dockin-opsctl
- 修改opserver访问地址
- Modify opserver access address
```
# 需要修改的文件:internal/common/url.go,将常量RemoteHost改为opserver对应的ip和端口
# File to be modified: internal/common/url.go, change the constant RemoteHost to the ip and port corresponding to opserver
const RemoteHost = "127.0.0.1:8084"
```
- 编译:执行make命令
- Compile: execute the make command
```
make
```


#### 2.3 Dockin-opagent
- 修改配置文件application.yaml,需要注意的为rm的访问地址
- Modify the configuration file application.yaml, the access address of rm should be noted
```
app:
rm:
api: http://127.0.0.1:10002/rmController # RM访问地址
api: http://127.0.0.1:10002/rmController # RM access address
container:
ticker: 30
http:
Expand All @@ -82,22 +85,22 @@ app:
path: /data/cgroup
logs:
cmd-white-list:
- grep
- zgrep
- cat
- head
- tail
- awk
- uniq
- sort
- ls
-grep
-zgrep
-cat
-head
-tail
-awk
-uniq
-sort
-ls
cmd-timeout: 5000
max-file-size: 3000
max-line: 1000
root: /data/logs/
```
- 编译并打包opagent到docker镜像
- Compile and package opagent to docker image
```
make docker-build
```
Expand All @@ -106,47 +109,46 @@ make docker-build
### 3. Installation And Running

#### 3.1 dockin-opagent
- opagent以daemonSet的方式运行在k8s集群中,可直接参照项目internal/docs目录中的daemonSet样例,修改对应的镜像信息后直接应用到k8s集群即可。
1. Opagent runs in the k8s cluster as a daemonSet. You can directly refer to the daemonSet sample in the internal/docs directory of the project, modify the corresponding mirror information and apply it directly to the k8s cluster.

#### 3.2 dockin-opagent
1. 导出需要管理的k8s集群的配置文件,放置在configs/cluster目录下,并在原始配置文件的基础上增加dockin段,示例如下所示,需要关注的请看对应备注:
1. Export the configuration file of the k8s cluster that needs to be managed, place it in the configs/cluster directory, and add a dockin section on the basis of the original configuration file. The example is shown below. Please see the corresponding notes for those who need attention:

```
apiVersion: v1
clusters:
- cluster: # 集群的访问地址及名字,可声明多个
-cluster: # The access address and name of the cluster can be declared multiple
insecure-skip-tls-verify: true
server: https://127.0.0.1:6443
name: kubernetes
contexts: # 上下文信息,主要用于与上述集群信息对应,设置部分配置
- context:
cluster: kubernetes # 集群名,与cluster段中的集群名对应
namespace: test # 使用该配置操作的命名空间
user: kubernetes-readonly-user # 访问该集群所使用的用户
contexts: # Context information, mainly used to correspond to the above cluster information, set up some configurations
-context:
cluster: kubernetes # cluster name, corresponding to the cluster name in the cluster section
namespace: test # Use the namespace of the configuration operation
user: kubernetes-readonly-user # The user used to access the cluster
name: readonly-user
current-context: readonly-user # 默认使用的上下文
current-context: readonly-user # Context used by default
kind: Config
preferences: {}
users:
- name: kubernetes-readonly-user # 用户信息,与context段中的用户对应
-name: kubernetes-readonly-user # User information, corresponding to the user in the context section
user:
password: your_password # 用户密码
username: readonly-user # 用户名
dockin: # 额外自定义配置,用户声明该集群适用于的规则及对应的集群id,并声明默认的白名单
password: your_password # User password
username: readonly-user # username
dockin: # Additional custom configuration, the user declares the rules applicable to the cluster and the corresponding cluster id, and declares the default whitelist
cluster-id: test
rule: test
rule: test
whitelist:
- 127.0.0.1
-127.0.0.1
```
2. 将项目中的*start.sh**configs*目录以及编译出来的可执行文件上传至服务器,执行以下命令:
2. Upload the *start.sh*, *configs* directories and compiled executable files in the project to the server, and execute the following commands:
```
sh start.sh
```


#### 3.3 dockin-opsctl
- 将可执行文件拷贝至服务器即可使用,使用如下命令查看帮助:
- Copy the executable file to the server to use it, use the following command to view the help:
```
dockin-opsctl -h
```


```

0 comments on commit 3fbb288

Please sign in to comment.