From 840acd2cf10b9891916bbff4f9bdd136a619383d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Tue, 28 Feb 2023 14:48:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=20api=20=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jumpserver/configs/jms-web/default.conf | 19 ++++--------------- .../templates/celery/deployment-celery.yaml | 2 -- .../templates/core/deployment-core.yaml | 5 ----- .../templates/core/service-core.yaml | 4 ---- charts/jumpserver/values.yaml | 2 -- 5 files changed, 4 insertions(+), 28 deletions(-) diff --git a/charts/jumpserver/configs/jms-web/default.conf b/charts/jumpserver/configs/jms-web/default.conf index 485cd7e..1228ba3 100644 --- a/charts/jumpserver/configs/jms-web/default.conf +++ b/charts/jumpserver/configs/jms-web/default.conf @@ -1,7 +1,6 @@ {{ $koko := printf "http://%s-%s:%s" (include "jumpserver.fullname" $) "jms-koko" ($.Values.koko.service.web.port | toString) }} {{ $lion := printf "http://%s-%s:%s" (include "jumpserver.fullname" $) "jms-lion" ($.Values.lion.service.web.port | toString) }} -{{ $coreweb := printf "http://%s-%s:%s" (include "jumpserver.fullname" $) "jms-core" ($.Values.core.service.web.port | toString) }} -{{ $corews := printf "http://%s-%s:%s" (include "jumpserver.fullname" $) "jms-core" ($.Values.core.service.ws.port | toString) }} +{{ $core := printf "http://%s-%s:%s" (include "jumpserver.fullname" $) "jms-core" ($.Values.core.service.web.port | toString) }} {{ $omnidb := printf "http://%s-%s:%s" (include "jumpserver.fullname" $) "jms-omnidb" ($.Values.omnidb.service.web.port | toString) }} server { listen {{ $.Values.web.service.web.port }}; @@ -25,9 +24,6 @@ server { add_header Content-Encoding gzip; root /opt/jumpserver/data/; } - location /media/ { - root /opt/jumpserver/data/; - } location /static/ { root /opt/jumpserver/data/; } @@ -76,7 +72,7 @@ server { } {{- end }} location /ws/ { - proxy_pass {{ $corews }}; + proxy_pass {{ $core }}; proxy_buffering off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -85,15 +81,8 @@ server { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } - location /api/ { - proxy_pass {{ $coreweb }}; - proxy_buffering off; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - location /core/ { - proxy_pass {{ $coreweb }}; + location ~ ^/(core|api|media)/ { + proxy_pass {{ $core }}; proxy_buffering off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; diff --git a/charts/jumpserver/templates/celery/deployment-celery.yaml b/charts/jumpserver/templates/celery/deployment-celery.yaml index cbe612a..1500038 100644 --- a/charts/jumpserver/templates/celery/deployment-celery.yaml +++ b/charts/jumpserver/templates/celery/deployment-celery.yaml @@ -57,8 +57,6 @@ spec: value: {{ .config.log.level | quote }} - name: HTTP_LISTEN_PORT value: {{ .service.web.port | quote }} - - name: WS_LISTEN_PORT - value: {{ .service.ws.port | quote }} - name: DB_ENGINE value: {{ include "jumpserver.database.engine" $ | quote }} - name: DB_HOST diff --git a/charts/jumpserver/templates/core/deployment-core.yaml b/charts/jumpserver/templates/core/deployment-core.yaml index ce4fb01..6b2a17d 100644 --- a/charts/jumpserver/templates/core/deployment-core.yaml +++ b/charts/jumpserver/templates/core/deployment-core.yaml @@ -58,8 +58,6 @@ spec: value: {{ .config.log.level | quote }} - name: HTTP_LISTEN_PORT value: {{ .service.web.port | quote }} - - name: WS_LISTEN_PORT - value: {{ .service.ws.port | quote }} - name: DB_ENGINE value: {{ include "jumpserver.database.engine" $ | quote }} - name: DB_HOST @@ -96,9 +94,6 @@ spec: - name: web containerPort: {{ .service.web.port }} protocol: TCP - - name: ws - containerPort: {{ .service.ws.port }} - protocol: TCP livenessProbe: {{- toYaml .livenessProbe | nindent 12 }} readinessProbe: diff --git a/charts/jumpserver/templates/core/service-core.yaml b/charts/jumpserver/templates/core/service-core.yaml index 658be39..69b75b8 100644 --- a/charts/jumpserver/templates/core/service-core.yaml +++ b/charts/jumpserver/templates/core/service-core.yaml @@ -17,10 +17,6 @@ spec: targetPort: web protocol: TCP name: web - - port: {{ .service.ws.port }} - targetPort: ws - protocol: TCP - name: ws sessionAffinity: ClientIP sessionAffinityConfig: clientIP: diff --git a/charts/jumpserver/values.yaml b/charts/jumpserver/values.yaml index 9cd62bd..65e8fc1 100644 --- a/charts/jumpserver/values.yaml +++ b/charts/jumpserver/values.yaml @@ -123,8 +123,6 @@ core: type: ClusterIP web: port: 8080 - ws: - port: 8070 resources: {} # We usually recommend not to specify default resources and to leave this as a conscious