feat(chart): 优化helm/chart

This commit is contained in:
xiaohu 2021-09-06 16:36:21 +08:00
parent 0c930be273
commit 5f87a4396b
13 changed files with 41 additions and 63 deletions

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

9
.idea/helm.iml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/helm.iml" filepath="$PROJECT_DIR$/.idea/helm.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -1,14 +1,5 @@
apiVersion: v1
appVersion: "v2.13.2"
description: A Helm chart for Deploying Jumpserver on Kubernetes
dependencies:
- condition: mysql.enabled
name: mysql
repository: https://github.com/bitnami/charts/tree/master/bitnami/mysql
version: 8.8.3
- condition: redis.enabled
name: redis
repository: https://github.com/bitnami/charts/tree/master/bitnami/redis
version: 14.8.8
name: jumpserver
version: 0.1.0

View File

@ -70,80 +70,44 @@ Define JumpServer database
{{- end -}}
{{- define "jumpserver.database.host" -}}
{{- if eq .Values.mysql.enabled true -}}
{{- template "jumpserver.mysql.fullname" . }}
{{- else -}}
{{- .Values.externalDatabase.host -}}
{{- end -}}
{{- end -}}
{{- define "jumpserver.database.port" -}}
{{- if eq .Values.mysql.enabled true -}}
{{- printf "%s" "5432" -}}
{{- else -}}
{{- .Values.externalDatabase.port -}}
{{- end -}}
{{- end -}}
{{- define "jumpserver.database.user" -}}
{{- if eq .Values.mysql.enabled true -}}
{{- .Values.mysql.user -}}
{{- else -}}
{{- .Values.externalDatabase.user -}}
{{- end -}}
{{- end -}}
{{- define "jumpserver.database.password" -}}
{{- if eq .Values.mysql.enabled true -}}
{{- .Values.mysql.password -}}
{{- else -}}
{{- .Values.externalDatabase.password -}}
{{- end -}}
{{- end -}}
{{- define "jumpserver.database.engine" -}}
{{- if eq .Values.mysql.enabled true -}}
{{- .Values.mysql.engine -}}
{{- else -}}
{{- .Values.externalDatabase.engine -}}
{{- end -}}
{{- end -}}
{{- define "jumpserver.database.database" -}}
{{- if eq .Values.mysql.enabled true -}}
{{- .Values.mysql.database -}}
{{- else -}}
{{- .Values.externalDatabase.database -}}
{{- end -}}
{{- end -}}
{{/*
Define JumpServer redis
*/}}
{{- define "jumpserver.redis.host" -}}
{{- if eq .Values.redis.enabled true -}}
{{- template "jumpserver.redis.fullname" . }}
{{- else -}}
{{- .Values.externalRedis.host -}}
{{- end -}}
{{- end -}}
{{- define "jumpserver.redis.port" -}}
{{- if eq .Values.redis.enabled true -}}
{{- .Values.redis.port -}}
{{- else -}}
{{- .Values.externalRedis.port -}}
{{- end -}}
{{- end -}}
{{- define "jumpserver.redis.password" -}}
{{- if eq .Values.redis.enabled true -}}
{{- .Values.redis.password -}}
{{- else -}}
{{- .Values.externalRedis.password -}}
{{- end -}}
{{- end -}}
{{/*
Define JumpServer StorageClass

View File

@ -49,7 +49,7 @@ spec:
- name: SESSION_EXPIRE_AT_BROWSER_CLOSE
value: "true"
- name: HTTP_LISTEN_PORT
value: {{ .service.web.port }}
value: "{{ .service.web.port }}"
- name: WS_LISTEN_PORT
value: "{{ .service.ws.port }}"
{{- end }}

View File

@ -54,7 +54,7 @@ spec:
- name: SESSION_EXPIRE_AT_BROWSER_CLOSE
value: "true"
- name: HTTP_LISTEN_PORT
value: {{ .service.web.port }}
value: "{{ .service.web.port }}"
- name: WS_LISTEN_PORT
value: "{{ .service.ws.port }}"
{{- end }}

View File

@ -58,7 +58,7 @@ spec:
- name: SSHD_PORT
value: "{{ .service.ssh.port }}"
- name: HTTPD_PORT
value: {{ .service.web.port }}
value: "{{ .service.web.port }}"
{{- end }}
- name: SHARE_ROOM_TYPE
value: redis

View File

@ -53,7 +53,7 @@ spec:
- name: LOG_LEVEL
value: "{{ .config.log.level }}"
- name: HTTPD_PORT
value: {{ .service.web.port }}
value: "{{ .service.web.port }}"
- name: SHARE_ROOM_TYPE
value: redis
{{- end }}

View File

@ -51,7 +51,7 @@ spec:
- name: websocket_port
value: "{{ .service.ws.port }}"
- name: listening_port
value: {{ .service.web.port }}
value: "{{ .service.web.port }}"
{{- with .env }}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}

View File

@ -19,19 +19,6 @@ global:
imagePullSecrets: []
storageClass: ""
redis:
enabled: true
port: 6379
password: "123"
mysql:
engine: mysql
enabled: true
port: 3306
user: jumpserver
password: "123"
database: jms-db
## If the Redis database included in the chart is disabled, JumpServer will
## use below parameters to connect to an external Redis server.
##