-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from ding-insper/master
feat: v1.0.0
- Loading branch information
Showing
274 changed files
with
10,726 additions
and
2,820 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package restful | ||
|
||
import ( | ||
"fmt" | ||
"github.com/gin-gonic/gin" | ||
"net/http" | ||
"quanxiang/pkg" | ||
) | ||
|
||
type Install struct { | ||
Kubeconfig string `form:"kubeconfig" json:"kubeconfig" xml:"kubeconfig" binding:"-"` | ||
Configfile string `form:"configfile" json:"configfile" xml:"configfile" binding:"-"` | ||
DeploymentFile string `form:"deploymentFile" json:"deploymentFile" xml:"deploymentFile" binding:"-"` | ||
MysqlInit bool `form:"mysqlInit" json:"mysqlInit" xml:"mysqlInit" binding:"-"` | ||
NgGateWay bool `form:"ngGateWay" json:"ngGateWay" xml:"ngGateWay" binding:"-"` | ||
Namespace string `form:"namespace" json:"namespace" xml:"namespace" binding:"-"` | ||
} | ||
|
||
func (I *Install)StartInstall(c *gin.Context) { | ||
if err := c.ShouldBind(I);err != nil{ | ||
c.AbortWithError(http.StatusInternalServerError, err) | ||
return | ||
} | ||
fmt.Println(" ********************************************************************************") | ||
fmt.Println(" * *") | ||
fmt.Println(" * 部署程序开始运行 *") | ||
fmt.Println(" * *") | ||
fmt.Println(" ********************************************************************************") | ||
fmt.Println() | ||
pkg.Start(I.Kubeconfig,I.Namespace,I.Configfile,I.DeploymentFile,I.MysqlInit,I.NgGateWay) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package restful | ||
|
||
import ( | ||
"github.com/gin-gonic/gin" | ||
"git.internal.yunify.com/qxp/misc/logger" | ||
) | ||
type Router struct { | ||
engine *gin.Engine | ||
} | ||
|
||
|
||
func newRouter() (*gin.Engine, error) { | ||
gin.SetMode(gin.ReleaseMode) | ||
engine := gin.New() | ||
|
||
engine.Use(logger.GinLogger(), | ||
logger.GinRecovery()) | ||
|
||
return engine, nil | ||
} | ||
|
||
func NewRouter() (*Router, error) { | ||
engine, err := newRouter() | ||
if err != nil { | ||
return nil, err | ||
} | ||
installqxp := Install{} | ||
uninstallqxp := UnInstall{} | ||
engine.POST("/install",installqxp.StartInstall) | ||
engine.POST("/uninstall",uninstallqxp.StartUnInstall) | ||
return &Router{ | ||
engine: engine, | ||
}, nil | ||
} | ||
|
||
// Run 启动服务 | ||
func (r *Router) Run() { | ||
r.engine.Run(":8089") | ||
} | ||
// Close 关闭服务 | ||
func (r *Router) Close() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package restful | ||
|
||
import ( | ||
"fmt" | ||
"github.com/gin-gonic/gin" | ||
"net/http" | ||
"quanxiang/pkg" | ||
) | ||
|
||
type UnInstall struct { | ||
Kubeconfig string `form:"kubeconfig" json:"kubeconfig" xml:"kubeconfig" binding:"-"` | ||
DeploymentFile string `form:"deploymentFile" json:"deploymentFile" xml:"deploymentFile" binding:"-"` | ||
UninstallMiddlerware bool `form:"uninstallMiddlerware" json:"uninstallMiddlerware" xml:"uninstallMiddlerware" binding:"-"` | ||
Namespace string `form:"namespace" json:"namespace" xml:"namespace" binding:"-"` | ||
} | ||
|
||
func (U UnInstall)StartUnInstall(c *gin.Context) { | ||
if err := c.ShouldBind(U);err != nil{ | ||
c.AbortWithError(http.StatusInternalServerError, err) | ||
return | ||
} | ||
fmt.Println(" ********************************************************************************") | ||
fmt.Println(" * *") | ||
fmt.Println(" * 卸载程序开始运行 *") | ||
fmt.Println(" * *") | ||
fmt.Println(" ********************************************************************************") | ||
fmt.Println() | ||
err := pkg.UninstallServece(U.Namespace,U.DeploymentFile,U.Kubeconfig,U.UninstallMiddlerware) | ||
if err != nil { | ||
fmt.Println(err) | ||
fmt.Println(" -------------卸载失败,请根据提示先检查-------------------") | ||
}else{ | ||
fmt.Println(" -------------卸载成功,如部署请使用start命令-------------------") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ kafka: | |
enabled: true | ||
elastic: | ||
enabled: true | ||
etcd: | ||
enabled: true | ||
mongo: | ||
enabled: true | ||
rootPassword: qxp1234 #Set Mongo password. Required when enabled is true 设置mongo密码,enabled为true时必填 | ||
|
@@ -18,9 +20,14 @@ minio: | |
secretKey: Minio123456 #Set Mongo secretKey. Required when enabled is true 设置minio secretKey,enabled为true时必填 | ||
#Service profile 服务的配置文件 | ||
image: | ||
repo: quanxiang | ||
tag: v0.7.0 | ||
imagePullSecrets: "lowcode" | ||
repo: qxcr.io/qxp | ||
tag: v1.0.0 | ||
imagePullSecrets: "" | ||
domain: example.com #设置访问平台的域名 | ||
args: | ||
enabled: true #如果使用的是未被公网解析的域名,需要设置enabled为true | ||
endpoint: "example.com:31198" #fileserver 域名 域名要与domain设置的域名一致 | ||
ip: "xx.xx.xx.xx" #k8s master节点的ip | ||
config: | ||
mysql: | ||
host: mysql.{{.}}.svc.cluster.local:3306 #如果上面中间件配置中mysql.enabled为true此处为mysql,否则请根据您的设置填写mysql host地址和端口 | ||
|
@@ -36,7 +43,7 @@ config: | |
password: qxp1234 #如果上面中间件配置中redis.enabled为true此处为上述中间件配置中的redis.password,否则请根据您的设置填写您的redis密码 | ||
elastic: | ||
host: | ||
- http://elasticsearch-client.{{.}}.svc.cluster.local:9200 #如果上面中间件配置中elastic.enabled为true此处配置不需要改动,否则请根据您的设置填写您的elasticsearch服务的ip和端口 | ||
- http://elasticsearch-master.{{.}}.svc.cluster.local:9200 #如果上面中间件配置中elastic.enabled为true此处配置不需要改动,否则请根据您的设置填写您的elasticsearch服务的ip和端口 | ||
log: true | ||
kafka: | ||
broker: | ||
|
@@ -52,8 +59,22 @@ config: | |
password: qxp1234 #如果上面中间件配置中mongo.enabled为true此处为mongo.rootPassword,否则请根据您的设置设置您的密码 | ||
passwordSet: false | ||
email: | ||
emails: | ||
- { emailfrom: "[email protected]",username: "XXX",aliasname: "别名",password: "XXX",host: "邮件服务器地址",port: 111 } #设置email信息以接收验证码 | ||
enabled: true | ||
host: xx.xx.xx | ||
port: xx | ||
username: xx | ||
password: xx | ||
alias: xx | ||
sender: [email protected] | ||
# email: | ||
# emails: | ||
# - { emailfrom: "[email protected]",username: "XXX",aliasname: "别名",password: "XXX",host: "邮件服务器地址",port: 111 } #设置email信息以接收验证码 | ||
|
||
etcd: | ||
addrs: | ||
- etcd-cluster.{{.}}.svc.cluster.local:2379 #如果上面中间件配置中etcd.enabled为true此处不需要更改,否则请根据您的设置填写etcd ip地址和端口 | ||
username: | ||
password: | ||
storage: | ||
option: minio | ||
urlExpire: 600 | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
|
||
packages/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apiVersion: v1 | ||
appVersion: 1.5.1 | ||
description: A Helm chart for Dapr on Kubernetes | ||
name: dapr | ||
version: 1.5.1 |
Oops, something went wrong.