Skip to content

Commit

Permalink
Merge pull request #541 from 70data/master
Browse files Browse the repository at this point in the history
Fix old doc & docker-compose.yaml
  • Loading branch information
70data authored Jan 16, 2020
2 parents 9085136 + 80672c2 commit 629ff2f
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 36 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ push-image:
docker push $(REGISTRY_URI)/wayne-frontend:latest

release: build-backend-image build-frontend-image push-image

16 changes: 7 additions & 9 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Wayne已大规模服务于360搜索,承载了内部绝大部分业务,稳定
## Features

- 基于 RBAC(Role based access control)的权限管理:用户通过角色与部门和项目关联,拥有部门角色允许操作部门资源,拥有项目角色允许操作项目资源,更加适合多租户场景。
- 简化 Kubernetes 对象创建:提供基础 Kubernetes 对象配置文件添加方式,同时支持高级模式直接编辑 Json/Yaml文件创建 Kubernetes 对象。
- 简化 Kubernetes 对象创建:提供基础 Kubernetes 对象配置文件添加方式,同时支持高级模式直接编辑 Json/Yaml 文件创建 Kubernetes 对象。
- LDAP/OAuth 2.0/DB 多种登录模式支持:集成企业级 LDAP 登录及 DB 登录模式,同时还可以实现 OAuth2 登录。
- 支持多集群、多租户:可以同时管理多个 Kubernetes 集群,并针对性添加特定配置,更方便的多集群、多租户管理。
- 提供完整审计模块:每次操作都会有完整的审计功能,追踪用于操作历史,同时支持用户自定义 webhook。
Expand All @@ -35,7 +35,7 @@ Wayne已大规模服务于360搜索,承载了内部绝大部分业务,稳定

## 架构设计

整体采用前后端分离的方案,其中前端采用 Angular 框架进行数据交互和展示,使用Ace编辑器进行 Kubernetes 资源模版编辑。后端采用 Beego 框架做数据接口处理,使用 Client-go 与 Kubernetes 进行交互,数据使用 MySQL 存储。
整体采用前后端分离的方案,其中前端采用 Angular 框架进行数据交互和展示,使用 Ace 编辑器进行 Kubernetes 资源模版编辑。后端采用 Beego 框架做数据接口处理,使用 Client-go 与 Kubernetes 进行交互,数据使用 MySQL 存储。

![架构图](https://360yun.org/wayne/images/architecture.png)

Expand All @@ -46,12 +46,11 @@ Wayne已大规模服务于360搜索,承载了内部绝大部分业务,稳定

## 项目依赖

- Golang 1.12+([installation manual](https://golang.org/dl/))
- Golang 1.12+ ([installation manual](https://golang.org/dl/))
- Docker 17.05+ ([installation manual](https://docs.docker.com/install))
- Bee ([installation manual](https://github.com/wilhelmguo/bee)) (请务必使用链接版本,不要使用 beego 官方版本,存在一些定制)
- Node.js 8+ and npm 5+ ([installation with nvm](https://github.com/creationix/nvm#usage))
- MySQL 5.6+ (Wayne 主要数据都存在 MySQL 中)
- RabbitMQ (可选,如需扩展审计功能,例如操作审计和 Webhooks 等,则需部署)
- Bee ([installation manual](https://github.com/beego/bee))
- Node.js v11+ 和 npm 6.5+ ([installation with nvm](https://github.com/creationix/nvm#usage))
- MySQL 5.6+ (Wayne 主要数据都存在 MySQL 中)

## 快速启动

Expand All @@ -71,8 +70,7 @@ $ docker-compose -f ./hack/docker-compose/docker-compose.yaml up

通过上述命令,您可以从通过 http://127.0.0.1:4200 访问本地 Wayne, 默认管理员账号 admin:admin

> 注意:项目启动后还需要配置集群和Namespace等信息才可正常使用。详见 [集群配置](https://360yun.org/wayne/admin/cluster.html)
> 注意:项目启动后还需要配置集群和 Namespace 等信息才可正常使用。详见 [集群配置](https://360yun.org/wayne/admin/cluster.html)
## 文档

Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ The whole system adopts the separation of front and back ends, in which the fron

- Golang 1.12+ ([installation manual](https://golang.org/dl/))
- Docker 17.05+ ([installation manual](https://docs.docker.com/install))
- Bee ([installation manual](https://github.com/wilhelmguo/bee)) (Be sure to use the link version, don't use the official version of beego, there are some customizations.)
- Node.js 8+ and npm 5+ ([installation with nvm](https://github.com/creationix/nvm#usage))
- Bee ([installation manual](https://github.com/beego/bee))
- Node.js v11+ and npm 6.5+ ([installation with nvm](https://github.com/creationix/nvm#usage))
- MySQL 5.6+ (Most of the data is in MySQL.)
- RabbitMQ (Optionally, you need to deploy if you need to extend auditing features such as operational auditing and Webhooks.)

## Quickly Start

Expand All @@ -72,7 +71,6 @@ With the above command, you can access the local Wayne from http://127.0.0.1:420

> Note: After Wayne is started, you need to configure information such as cluster and Namespace for normal use. See details [Cluster Configuration](https://360yun.org/wayne/admin/cluster.html)

## Document

- Refer [Wiki](https://360yun.org/wayne/)
1 change: 1 addition & 0 deletions hack/build/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ COPY go.sum /go/src/github.com/Qihoo360/wayne
COPY src/backend /go/src/github.com/Qihoo360/wayne/src/backend

RUN export GO111MODULE=on && \
export GOPROXY=https://mirrors.aliyun.com/goproxy/ && \
cd /go/src/github.com/Qihoo360/wayne/src/backend && \
bee generate docs && \
bee pack -o /_build
Expand Down
2 changes: 1 addition & 1 deletion hack/build/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM centos:7

ADD https://amazon-eks.s3-us-west-2.amazonaws.com/1.11.5/2018-12-06/bin/linux/amd64/aws-iam-authenticator /usr/bin/aws-iam-authenticator

RUN chmod +x /usr/bin/aws-iam-authenticator
RUN chmod +x /usr/bin/aws-iam-authenticator
1 change: 0 additions & 1 deletion hack/build/ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ COPY src/frontend/package.json /workspace
COPY src/frontend/package-lock.json /workspace

RUN npm install --registry=https://registry.npm.taobao.org

2 changes: 1 addition & 1 deletion hack/dev/webhook/echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def do_POST(self):

Handler = GetHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
httpd.serve_forever()
httpd.serve_forever()
5 changes: 2 additions & 3 deletions hack/docker-compose/conf/app.conf
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ EnableRobin = false
EnableApiKeys = true

# Bus
EnableWebhook = true
BusEnable = true
BusRabbitMQURL = "amqp://guest:guest@rabbitmq:5672"

# Webhook
EnableWebhook = true
Expand All @@ -70,8 +70,8 @@ AppUrl = ""

# oauth2
[auth.oauth2]
redirect_url = "https://www.wayne.cloud"
enabled = false
redirect_url = "https://www.wayne.cloud"
client_id = client
client_secret = secret
auth_url = https://example.com/oauth2/v1/authorize
Expand All @@ -92,4 +92,3 @@ ldap_filter =
ldap_uid = cn
ldap_scope = 2
ldap_connection_timeout = 30

2 changes: 1 addition & 1 deletion hack/docker-compose/conf/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
window.CONFIG = {
URL: 'http://localhostip:8080',
URL: 'http://yourip:8080',
RAVEN: false,
RAVEN_DSN: 'RAVEN_DSN'
};
6 changes: 2 additions & 4 deletions hack/docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- "3306:3306"

wayne-backend:
image: 360cloud/wayne-backend:v1.8.4-16-gf3a7366
image: 360cloud/wayne-backend:latest
command: /opt/wayne/backend
environment:
GOPATH: "/go"
Expand All @@ -29,7 +29,7 @@ services:
- "8080:8080"

wayne-frontend:
image: 360cloud/wayne-frontend:latest
image: 360cloud/wayne-backend:latest
volumes:
- ./conf/config.js:/usr/local/openresty/nginx/html/config.js
depends_on:
Expand All @@ -39,5 +39,3 @@ services:
- default
ports:
- "4200:80"


1 change: 1 addition & 0 deletions src/backend/cmd/apiserver/apiserver.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package apiserver

//noinspection ALL
import (
"github.com/astaxie/beego"
"github.com/spf13/cobra"
Expand Down
5 changes: 2 additions & 3 deletions src/backend/cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package cmd

import (
"github.com/astaxie/beego"

"github.com/Qihoo360/wayne/src/backend/initial"
_ "github.com/Qihoo360/wayne/src/backend/routers"
"github.com/Qihoo360/wayne/src/backend/workers/webhook"
"github.com/astaxie/beego"
)


func Run() {

// MySQL
Expand All @@ -32,7 +32,6 @@ func Run() {

webhook.RegisterHookHandler()


// init kube labels
initial.InitKubeLabel()

Expand Down
2 changes: 1 addition & 1 deletion src/backend/cmd/worker/worker.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package worker

//noinspection ALL
import (
"errors"
"fmt"
Expand Down Expand Up @@ -137,5 +138,4 @@ func recoverableWorker(workerSet map[*workers.Worker]workers.Worker, workerType

}()
workerSet[&worker] = worker

}
1 change: 0 additions & 1 deletion src/backend/database/generatedata/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ func main() {
for _, data := range initial.InitialData {
fmt.Println(data)
}

}
3 changes: 1 addition & 2 deletions src/backend/database/migrations/v1.1/ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ CREATE TABLE `ingress_template`
`deleted` bool NOT NULL DEFAULT false
) ENGINE=InnoDB;


-- Indexes

ALTER TABLE `ingress`
ADD INDEX `ingress_app_id`(`app_id`);
ALTER TABLE `ingress`
ADD INDEX `ingress_order_id`(`order_id`);
ALTER TABLE `ingress_template`
ADD INDEX `ingress_template_ingress_id`(`ingress_id`);
ADD INDEX `ingress_template_ingress_id`(`ingress_id`);
2 changes: 1 addition & 1 deletion src/backend/database/migrations/v1.3/ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ CREATE TABLE IF NOT EXISTS `hpa_template` (
`user` varchar(128) NOT NULL DEFAULT '' ,
`deleted` bool NOT NULL DEFAULT false
) ENGINE=InnoDB;
CREATE INDEX `hpa_template_hpa_id` ON `hpa_template` (`hpa_id`);
CREATE INDEX `hpa_template_hpa_id` ON `hpa_template` (`hpa_id`);
1 change: 0 additions & 1 deletion src/backend/initial/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ func InitBus() {
panic(err)
}
}

}
1 change: 0 additions & 1 deletion src/backend/initial/rsa_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func InitRsaKey() {
panic(err)
}
apikey.RsaPublicKey = publicKey

}

func readKey(key string) []byte {
Expand Down
1 change: 0 additions & 1 deletion src/backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/Qihoo360/wayne/src/backend/cmd"
)


func main() {
cmd.Run()
}

0 comments on commit 629ff2f

Please sign in to comment.