From decf728d91b1bf4b186db0c02aaa39998439b800 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Thu, 26 May 2022 22:11:03 +0800 Subject: [PATCH 1/4] ingress --- deploy_k8s/ingress.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy_k8s/ingress.yaml b/deploy_k8s/ingress.yaml index d8402ee05..d68aeedb6 100644 --- a/deploy_k8s/ingress.yaml +++ b/deploy_k8s/ingress.yaml @@ -18,7 +18,7 @@ spec: name: sdk-server port: number: 10003 - path: / + path: /sdk-server pathType: Prefix --- apiVersion: networking.k8s.io/v1 @@ -97,5 +97,5 @@ spec: name: cms-api port: number: 10006 - path: / + path: /cms-api pathType: Prefix From dcb777d6ea02e271d97a59503a6c703e589a3a96 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 27 May 2022 00:01:51 +0800 Subject: [PATCH 2/4] ingress --- deploy_k8s/ingress.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/deploy_k8s/ingress.yaml b/deploy_k8s/ingress.yaml index d68aeedb6..cef557054 100644 --- a/deploy_k8s/ingress.yaml +++ b/deploy_k8s/ingress.yaml @@ -10,7 +10,7 @@ metadata: name: sdk-server-ingress spec: rules: - - host: sdk-server.openim.xxx.com + - host: k8s.open-im-test.rentsoft.cn http: paths: - backend: @@ -32,7 +32,7 @@ metadata: name: msg-gateway-ingress spec: rules: - - host: msg-gateway.openim.xxx.com + - host: k8s.open-im-test.rentsoft.cn http: paths: - backend: @@ -40,7 +40,7 @@ spec: name: msg-gateway port: number: 10001 - path: / + path: /msg-gateway pathType: Prefix --- apiVersion: networking.k8s.io/v1 @@ -51,7 +51,7 @@ metadata: name: api-ingress spec: rules: - - host: api.openim.xxx.com + - host: k8s.open-im-test.rentsoft.cn http: paths: - backend: @@ -59,7 +59,7 @@ spec: name: api port: number: 10002 - path: / + path: /api pathType: Prefix --- apiVersion: networking.k8s.io/v1 @@ -70,7 +70,7 @@ metadata: name: demo-ingress spec: rules: - - host: demo.openim.xxx.com + - host: k8s.open-im-test.rentsoft.cn http: paths: - backend: @@ -78,7 +78,7 @@ spec: name: demo port: number: 10004 - path: / + path: /demo pathType: Prefix --- apiVersion: networking.k8s.io/v1 @@ -89,7 +89,7 @@ metadata: name: cms-api-ingress spec: rules: - - host: cms-api.openim.xxx.com + - host: k8s.open-im-test.rentsoft.cn http: paths: - backend: From ce5f927a8d219a98cab580c1c696af22bd731626 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 27 May 2022 00:27:17 +0800 Subject: [PATCH 3/4] ingress --- deploy_k8s/ingress.yaml | 10 +++++----- deploy_k8s/kubectl_start_all.sh | 0 deploy_k8s/kubectl_stop_all.sh | 0 3 files changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 deploy_k8s/kubectl_start_all.sh mode change 100644 => 100755 deploy_k8s/kubectl_stop_all.sh diff --git a/deploy_k8s/ingress.yaml b/deploy_k8s/ingress.yaml index cef557054..696b4a61d 100644 --- a/deploy_k8s/ingress.yaml +++ b/deploy_k8s/ingress.yaml @@ -18,7 +18,7 @@ spec: name: sdk-server port: number: 10003 - path: /sdk-server + path: /sdk-server/(.*) pathType: Prefix --- apiVersion: networking.k8s.io/v1 @@ -40,7 +40,7 @@ spec: name: msg-gateway port: number: 10001 - path: /msg-gateway + path: /msg-gateway/(.*) pathType: Prefix --- apiVersion: networking.k8s.io/v1 @@ -59,7 +59,7 @@ spec: name: api port: number: 10002 - path: /api + path: /api/(.*) pathType: Prefix --- apiVersion: networking.k8s.io/v1 @@ -78,7 +78,7 @@ spec: name: demo port: number: 10004 - path: /demo + path: /demo/(.*) pathType: Prefix --- apiVersion: networking.k8s.io/v1 @@ -97,5 +97,5 @@ spec: name: cms-api port: number: 10006 - path: /cms-api + path: /cms-api/(.*) pathType: Prefix diff --git a/deploy_k8s/kubectl_start_all.sh b/deploy_k8s/kubectl_start_all.sh old mode 100644 new mode 100755 diff --git a/deploy_k8s/kubectl_stop_all.sh b/deploy_k8s/kubectl_stop_all.sh old mode 100644 new mode 100755 From ab047944b61d135829f43bd61d23b9d0d80e6e72 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 27 May 2022 00:33:52 +0800 Subject: [PATCH 4/4] ingress --- deploy_k8s/ingress.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/deploy_k8s/ingress.yaml b/deploy_k8s/ingress.yaml index 696b4a61d..4b3a81aa9 100644 --- a/deploy_k8s/ingress.yaml +++ b/deploy_k8s/ingress.yaml @@ -7,6 +7,9 @@ metadata: nginx.ingress.kubernetes.io/proxy-http-version: "1.1" nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + # 使用重写后的路径进行路由 + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: "/$1" name: sdk-server-ingress spec: rules: @@ -29,6 +32,9 @@ metadata: nginx.ingress.kubernetes.io/proxy-http-version: "1.1" nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + # 使用重写后的路径进行路由 + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: "/$1" name: msg-gateway-ingress spec: rules: @@ -48,6 +54,9 @@ kind: Ingress metadata: annotations: kubernetes.io/ingress.class: "nginx" + # 使用重写后的路径进行路由 + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: "/$1" name: api-ingress spec: rules: @@ -67,6 +76,9 @@ kind: Ingress metadata: annotations: kubernetes.io/ingress.class: "nginx" + # 使用重写后的路径进行路由 + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: "/$1" name: demo-ingress spec: rules: @@ -86,6 +98,9 @@ kind: Ingress metadata: annotations: kubernetes.io/ingress.class: "nginx" + # 使用重写后的路径进行路由 + nginx.ingress.kubernetes.io/use-regex: "true" + nginx.ingress.kubernetes.io/rewrite-target: "/$1" name: cms-api-ingress spec: rules: