Merge pull request #125 from wojiushixiaobai/main

fix: 修正 api 接口
This commit is contained in:
吴小白 2023-02-28 14:49:18 +08:00 committed by GitHub
commit b0f99255c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 28 deletions

View File

@ -1,7 +1,6 @@
{{ $koko := printf "http://%s-%s:%s" (include "jumpserver.fullname" $) "jms-koko" ($.Values.koko.service.web.port | toString) }} {{ $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) }} {{ $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) }} {{ $core := 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) }}
{{ $omnidb := printf "http://%s-%s:%s" (include "jumpserver.fullname" $) "jms-omnidb" ($.Values.omnidb.service.web.port | toString) }} {{ $omnidb := printf "http://%s-%s:%s" (include "jumpserver.fullname" $) "jms-omnidb" ($.Values.omnidb.service.web.port | toString) }}
server { server {
listen {{ $.Values.web.service.web.port }}; listen {{ $.Values.web.service.web.port }};
@ -25,9 +24,6 @@ server {
add_header Content-Encoding gzip; add_header Content-Encoding gzip;
root /opt/jumpserver/data/; root /opt/jumpserver/data/;
} }
location /media/ {
root /opt/jumpserver/data/;
}
location /static/ { location /static/ {
root /opt/jumpserver/data/; root /opt/jumpserver/data/;
} }
@ -76,7 +72,7 @@ server {
} }
{{- end }} {{- end }}
location /ws/ { location /ws/ {
proxy_pass {{ $corews }}; proxy_pass {{ $core }};
proxy_buffering off; proxy_buffering off;
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;
@ -85,15 +81,8 @@ server {
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} }
location /api/ { location ~ ^/(core|api|media)/ {
proxy_pass {{ $coreweb }}; proxy_pass {{ $core }};
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 }};
proxy_buffering off; proxy_buffering off;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host; proxy_set_header Host $host;

View File

@ -57,8 +57,6 @@ spec:
value: {{ .config.log.level | quote }} value: {{ .config.log.level | quote }}
- name: HTTP_LISTEN_PORT - name: HTTP_LISTEN_PORT
value: {{ .service.web.port | quote }} value: {{ .service.web.port | quote }}
- name: WS_LISTEN_PORT
value: {{ .service.ws.port | quote }}
- name: DB_ENGINE - name: DB_ENGINE
value: {{ include "jumpserver.database.engine" $ | quote }} value: {{ include "jumpserver.database.engine" $ | quote }}
- name: DB_HOST - name: DB_HOST

View File

@ -58,8 +58,6 @@ spec:
value: {{ .config.log.level | quote }} value: {{ .config.log.level | quote }}
- name: HTTP_LISTEN_PORT - name: HTTP_LISTEN_PORT
value: {{ .service.web.port | quote }} value: {{ .service.web.port | quote }}
- name: WS_LISTEN_PORT
value: {{ .service.ws.port | quote }}
- name: DB_ENGINE - name: DB_ENGINE
value: {{ include "jumpserver.database.engine" $ | quote }} value: {{ include "jumpserver.database.engine" $ | quote }}
- name: DB_HOST - name: DB_HOST
@ -96,9 +94,6 @@ spec:
- name: web - name: web
containerPort: {{ .service.web.port }} containerPort: {{ .service.web.port }}
protocol: TCP protocol: TCP
- name: ws
containerPort: {{ .service.ws.port }}
protocol: TCP
livenessProbe: livenessProbe:
{{- toYaml .livenessProbe | nindent 12 }} {{- toYaml .livenessProbe | nindent 12 }}
readinessProbe: readinessProbe:

View File

@ -17,10 +17,6 @@ spec:
targetPort: web targetPort: web
protocol: TCP protocol: TCP
name: web name: web
- port: {{ .service.ws.port }}
targetPort: ws
protocol: TCP
name: ws
sessionAffinity: ClientIP sessionAffinity: ClientIP
sessionAffinityConfig: sessionAffinityConfig:
clientIP: clientIP:

View File

@ -123,8 +123,6 @@ core:
type: ClusterIP type: ClusterIP
web: web:
port: 8080 port: 8080
ws:
port: 8070
resources: {} resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious # We usually recommend not to specify default resources and to leave this as a conscious