@@ -18,7 +18,7 @@ import ( | |||||
// @Description 登入 | // @Description 登入 | ||||
// @Accept json | // @Accept json | ||||
// @Produce json | // @Produce json | ||||
// @Param req body md.LoginReq true "用户名密码" | |||||
// @Param req body md.LoginReq true "用户名、密码" | |||||
// @Success 200 {object} md.LoginResponse "token" | // @Success 200 {object} md.LoginResponse "token" | ||||
// @Failure 400 {object} md.Response "具体错误" | // @Failure 400 {object} md.Response "具体错误" | ||||
// @Router /admin/login [post] | // @Router /admin/login [post] | ||||
@@ -40,7 +40,7 @@ const docTemplate = `{ | |||||
"summary": "登陆", | "summary": "登陆", | ||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"description": "用户名密码", | |||||
"description": "用户名、密码", | |||||
"name": "req", | "name": "req", | ||||
"in": "body", | "in": "body", | ||||
"required": true, | "required": true, | ||||
@@ -32,7 +32,7 @@ | |||||
"summary": "登陆", | "summary": "登陆", | ||||
"parameters": [ | "parameters": [ | ||||
{ | { | ||||
"description": "用户名密码", | |||||
"description": "用户名、密码", | |||||
"name": "req", | "name": "req", | ||||
"in": "body", | "in": "body", | ||||
"required": true, | "required": true, | ||||
@@ -153,7 +153,7 @@ paths: | |||||
- application/json | - application/json | ||||
description: 登入 | description: 登入 | ||||
parameters: | parameters: | ||||
- description: 用户名密码 | |||||
- description: 用户名、密码 | |||||
in: body | in: body | ||||
name: req | name: req | ||||
required: true | required: true | ||||
@@ -35,13 +35,24 @@ spec: | |||||
# 这里的名字就是前面创建的configMap的名字 | # 这里的名字就是前面创建的configMap的名字 | ||||
name: advertisement-medium-cfg | name: advertisement-medium-cfg | ||||
defaultMode: 420 | defaultMode: 420 | ||||
# pvc | |||||
- name: advertisement-medium-pvc # 在该部署中的名称,后面使用改名称挂载 | |||||
persistentVolumeClaim: | |||||
claimName: advertisement-medium-pvc # pvc的名称 | |||||
# Nginx配置 | |||||
- name: advertisement-medium-nginx | |||||
configMap: | |||||
name: advertisement-medium-nginx # 外部configMap的名称 | |||||
items: | |||||
- key: go.conf | |||||
path: default.conf | |||||
containers: | containers: | ||||
# 主容器 | # 主容器 | ||||
- name: advertisement-medium-container | - name: advertisement-medium-container | ||||
# 镜像地址(提前打包好并推送的镜像仓库) | # 镜像地址(提前打包好并推送的镜像仓库) | ||||
image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/advertisement-medium:0.0.1' | image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/advertisement-medium:0.0.1' | ||||
ports: | ports: | ||||
- name: advertisement-tcp-1004 | |||||
- name: ad-medium-1004 | |||||
# 容器端口号(注意与golang web server启动的端口一致) | # 容器端口号(注意与golang web server启动的端口一致) | ||||
containerPort: 1004 | containerPort: 1004 | ||||
protocol: TCP | protocol: TCP | ||||
@@ -56,8 +67,8 @@ spec: | |||||
mountPath: /var/zyos | mountPath: /var/zyos | ||||
imagePullPolicy: Always | imagePullPolicy: Always | ||||
# Nginx 容器 | # Nginx 容器 | ||||
- name: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/nginx:latest' | |||||
image: nginx | |||||
- name: nginx | |||||
image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/nginx:latest' | |||||
ports: | ports: | ||||
- name: http-80 | - name: http-80 | ||||
containerPort: 80 | containerPort: 80 | ||||
@@ -0,0 +1,17 @@ | |||||
kind: Ingress | |||||
apiVersion: extensions/v1beta1 | |||||
metadata: | |||||
name: advertisement-medium # ingress名称 | |||||
namespace: advertisement | |||||
annotations: | |||||
kubesphere.io/creator: dengbiao | |||||
spec: | |||||
rules: | |||||
- host: 123456.medium.dengbiao.top # 使用的域名 | |||||
http: | |||||
paths: | |||||
- path: / | |||||
pathType: ImplementationSpecific | |||||
backend: | |||||
serviceName: advertisement-medium # 流量转发到的服务 | |||||
servicePort: 80 |