From ecbe9b1539be544dc039c9bca91614bd88435daf Mon Sep 17 00:00:00 2001 From: dengbiao Date: Sat, 17 Aug 2024 11:47:38 +0800 Subject: [PATCH] update --- app/hdl/hdl_login.go | 2 +- docs/docs.go | 2 +- docs/swagger.json | 2 +- docs/swagger.yaml | 2 +- k8s/container.yaml | 17 ++++++++++++++--- k8s/ingress.yaml | 17 +++++++++++++++++ 6 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 k8s/ingress.yaml diff --git a/app/hdl/hdl_login.go b/app/hdl/hdl_login.go index 9fa9099..37e92cb 100644 --- a/app/hdl/hdl_login.go +++ b/app/hdl/hdl_login.go @@ -18,7 +18,7 @@ import ( // @Description 登入 // @Accept json // @Produce json -// @Param req body md.LoginReq true "用户名密码" +// @Param req body md.LoginReq true "用户名、密码" // @Success 200 {object} md.LoginResponse "token" // @Failure 400 {object} md.Response "具体错误" // @Router /admin/login [post] diff --git a/docs/docs.go b/docs/docs.go index 2520bb0..8887be7 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -40,7 +40,7 @@ const docTemplate = `{ "summary": "登陆", "parameters": [ { - "description": "用户名密码", + "description": "用户名、密码", "name": "req", "in": "body", "required": true, diff --git a/docs/swagger.json b/docs/swagger.json index d7f1415..3dca2e9 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -32,7 +32,7 @@ "summary": "登陆", "parameters": [ { - "description": "用户名密码", + "description": "用户名、密码", "name": "req", "in": "body", "required": true, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 5c5bba2..05a9336 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -153,7 +153,7 @@ paths: - application/json description: 登入 parameters: - - description: 用户名密码 + - description: 用户名、密码 in: body name: req required: true diff --git a/k8s/container.yaml b/k8s/container.yaml index fa9a2f3..c13f138 100644 --- a/k8s/container.yaml +++ b/k8s/container.yaml @@ -35,13 +35,24 @@ spec: # 这里的名字就是前面创建的configMap的名字 name: advertisement-medium-cfg 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: # 主容器 - name: advertisement-medium-container # 镜像地址(提前打包好并推送的镜像仓库) image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/advertisement-medium:0.0.1' ports: - - name: advertisement-tcp-1004 + - name: ad-medium-1004 # 容器端口号(注意与golang web server启动的端口一致) containerPort: 1004 protocol: TCP @@ -56,8 +67,8 @@ spec: mountPath: /var/zyos imagePullPolicy: Always # 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: - name: http-80 containerPort: 80 diff --git a/k8s/ingress.yaml b/k8s/ingress.yaml new file mode 100644 index 0000000..2898b98 --- /dev/null +++ b/k8s/ingress.yaml @@ -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 \ No newline at end of file