Skip to content

Commit

Permalink
perf: 固定镜像名称
Browse files Browse the repository at this point in the history
  • Loading branch information
wojiushixiaobai committed Dec 15, 2023
1 parent beaaefa commit a104bba
Show file tree
Hide file tree
Showing 36 changed files with 205 additions and 322 deletions.
120 changes: 0 additions & 120 deletions charts/jumpserver/templates/_images.tpl

This file was deleted.

22 changes: 11 additions & 11 deletions charts/jumpserver/templates/celery/deployment-celery.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{{- if .Values.core.enabled }}
{{- with .Values.core }}
{{- $fullName := printf "%s-%s" (include "jumpserver.fullname" $) "jms-celery" }}
{{- $fullName := include "jumpserver.fullname" $ }}
{{- $containerName := "jms-celery" }}
{{- $image := printf "%s" (include "jumpserver.coreImage" $) }}
{{- $registryName := $.Values.global.imageRegistry | default .image.registry }}
{{- $tag := $.Values.global.imageTag | default .image.tag }}
{{- $mysqlPort := printf "%s" (include "jumpserver.magnus.mysql.port" $) }}
{{- $mariadbPort := printf "%s" (include "jumpserver.magnus.mariadb.port" $) }}
{{- $redisPort := printf "%s" (include "jumpserver.magnus.redis.port" $) }}
{{- $postgresqlPort := printf "%s" (include "jumpserver.magnus.postgresql.port" $) }}
{{- $oraclePorts := printf "%s" (include "jumpserver.magnus.oracle.ports" $) }}
{{- $imageName := $.Values.xpack.enabled | ternary "jumpserver/core-ee" "jumpserver/core-ce" }}
{{- $imageWithTag := printf "%s/%s:%s" $registryName $imageName $tag | quote }}

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $fullName }}
name: "{{ $fullName }}-{{ $containerName }}"
labels:
app.jumpserver.org/name: {{ $containerName }}
spec:
Expand Down Expand Up @@ -39,12 +43,8 @@ spec:
- name: {{ $containerName }}
securityContext:
{{- toYaml .securityContext | nindent 12 }}
image: {{ $image }}
imagePullPolicy: {{ .image.pullPolicy }}
{{- with .command }}
command:
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
image: {{ $imageWithTag }}
imagePullPolicy: {{ .image.pullPolicy | quote }}
args: ["start", "task"]
env:
- name: SECRET_KEY
Expand Down Expand Up @@ -121,7 +121,7 @@ spec:
{{- if .persistence.existingClaim }}
claimName: {{ .persistence.existingClaim | quote }}
{{- else }}
claimName: '{{ include "jumpserver.fullname" $ }}-jms-core-data'
claimName: '{{ $fullName }}-jms-core-data'
{{- end }}
name: "jms-core-data"
{{- with .volumes }}
Expand All @@ -140,4 +140,4 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
22 changes: 11 additions & 11 deletions charts/jumpserver/templates/chen/deployment-chen.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{{- if .Values.chen.enabled }}
{{- with .Values.chen }}
{{- $fullName := printf "%s-%s" (include "jumpserver.fullname" $) "jms-chen" }}
{{- $fullName := include "jumpserver.fullname" $ }}
{{- $containerName := "jms-chen" }}
{{- $image := printf "%s" (include "jumpserver.chenImage" $) }}
{{- $registryName := $.Values.global.imageRegistry | default .image.registry }}
{{- $tag := $.Values.global.imageTag | default .image.tag }}
{{- $imageName := "jumpserver/chen" }}
{{- $imageWithTag := printf "%s/%s:%s" $registryName $imageName $tag | quote }}

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $fullName }}
name: "{{ $fullName }}-{{ $containerName }}"
labels:
{{- include "jumpserver.labels" $ | nindent 4 }}
{{- toYaml .labels | nindent 4 }}
Expand Down Expand Up @@ -35,15 +39,11 @@ spec:
- name: {{ $containerName }}
securityContext:
{{- toYaml .securityContext | nindent 12 }}
image: {{ $image }}
imagePullPolicy: {{ .image.pullPolicy }}
{{- with .command }}
command:
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
image: {{ $imageWithTag }}
imagePullPolicy: {{ .image.pullPolicy | quote }}
env:
- name: CORE_HOST
value: "http://{{ include "jumpserver.fullname" $ }}-jms-core:{{ $.Values.core.service.web.port }}"
value: "http://{{ $fullName }}-jms-core:{{ $.Values.core.service.web.port }}"
- name: BOOTSTRAP_TOKEN
value: {{ $.Values.core.config.bootstrapToken | quote }}
- name: LOG_LEVEL
Expand Down Expand Up @@ -79,7 +79,7 @@ spec:
{{- if .persistence.existingClaim }}
claimName: {{ .persistence.existingClaim | quote }}
{{- else }}
claimName: '{{ include "jumpserver.fullname" $ }}-jms-chen-data'
claimName: '{{ $fullName }}-jms-chen-data'
{{- end }}
name: "jms-chen-data"
{{- with .volumes }}
Expand Down
5 changes: 3 additions & 2 deletions charts/jumpserver/templates/chen/pvc-chen-data.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if and .Values.chen.enabled (not .Values.chen.persistence.existingClaim)}}
{{- with .Values.chen }}
{{- $fullName := printf "%s-%s" (include "jumpserver.fullname" $) "jms-chen-data" }}
{{- $fullName := include "jumpserver.fullname" $ }}

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ $fullName }}
name: "{{ $fullName }}-jms-chen-data"
labels:
{{- include "jumpserver.labels" $ | nindent 4 }}
{{- toYaml .labels | nindent 4 }}
Expand Down
5 changes: 3 additions & 2 deletions charts/jumpserver/templates/chen/service-chen.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if .Values.chen.enabled }}
{{- with .Values.chen }}
{{- $fullName := printf "%s-%s" (include "jumpserver.fullname" $) "jms-chen" }}
{{- $fullName := include "jumpserver.fullname" $ }}

apiVersion: v1
kind: Service
metadata:
name: {{ $fullName }}
name: "{{ $fullName }}-jms-chen"
labels:
{{- include "jumpserver.labels" $ | nindent 4 }}
{{- toYaml .labels | nindent 4 }}
Expand Down
22 changes: 11 additions & 11 deletions charts/jumpserver/templates/core/deployment-core.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{{- if .Values.core.enabled }}
{{- with .Values.core }}
{{- $fullName := printf "%s-%s" (include "jumpserver.fullname" $) "jms-core" }}
{{- $fullName := include "jumpserver.fullname" $ }}
{{- $containerName := "jms-core" }}
{{- $image := printf "%s" (include "jumpserver.coreImage" $) }}
{{- $registryName := $.Values.global.imageRegistry | default .image.registry }}
{{- $tag := $.Values.global.imageTag | default .image.tag }}
{{- $mysqlPort := printf "%s" (include "jumpserver.magnus.mysql.port" $) }}
{{- $mariadbPort := printf "%s" (include "jumpserver.magnus.mariadb.port" $) }}
{{- $redisPort := printf "%s" (include "jumpserver.magnus.redis.port" $) }}
{{- $postgresqlPort := printf "%s" (include "jumpserver.magnus.postgresql.port" $) }}
{{- $oraclePorts := printf "%s" (include "jumpserver.magnus.oracle.ports" $) }}
{{- $imageName := $.Values.xpack.enabled | ternary "jumpserver/core-ee" "jumpserver/core-ce" }}
{{- $imageWithTag := printf "%s/%s:%s" $registryName $imageName $tag | quote }}

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $fullName }}
name: "{{ $fullName }}-{{ $containerName }}"
labels:
{{- include "jumpserver.labels" $ | nindent 4 }}
{{- toYaml .labels | nindent 4 }}
Expand Down Expand Up @@ -40,16 +44,12 @@ spec:
- name: {{ $containerName }}
securityContext:
{{- toYaml .securityContext | nindent 12 }}
image: {{ $image }}
imagePullPolicy: {{ .image.pullPolicy }}
{{- with .command }}
command:
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
image: {{ $imageWithTag }}
imagePullPolicy: {{ .image.pullPolicy | quote }}
args: ["start", "web"]
env:
- name: CORE_HOST
value: "http://{{ include "jumpserver.fullname" $ }}-jms-core:{{ $.Values.core.service.web.port }}"
value: "http://{{ $fullName }}-jms-core:{{ $.Values.core.service.web.port }}"
- name: SECRET_KEY
value: {{ required "A valid secretKey is required!" .config.secretKey | quote }}
- name: BOOTSTRAP_TOKEN
Expand Down Expand Up @@ -117,7 +117,7 @@ spec:
{{- if .persistence.existingClaim }}
claimName: {{ .persistence.existingClaim | quote }}
{{- else }}
claimName: '{{ include "jumpserver.fullname" $ }}-jms-core-data'
claimName: '{{ $fullName }}-jms-core-data'
{{- end }}
name: "jms-core-data"
{{- with .volumes }}
Expand Down
5 changes: 3 additions & 2 deletions charts/jumpserver/templates/core/pvc-core-data.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if and .Values.core.enabled (not .Values.core.persistence.existingClaim)}}
{{- with .Values.core }}
{{- $fullName := printf "%s-%s" (include "jumpserver.fullname" $) "jms-core-data" }}
{{- $fullName := include "jumpserver.fullname" $ }}

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ $fullName }}
name: "{{ $fullName }}-jms-core-data"
labels:
{{- include "jumpserver.labels" $ | nindent 4 }}
{{- toYaml .labels | nindent 4 }}
Expand Down
5 changes: 3 additions & 2 deletions charts/jumpserver/templates/core/service-core.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if .Values.core.enabled }}
{{- with .Values.core }}
{{- $fullName := printf "%s-%s" (include "jumpserver.fullname" $) "jms-core" }}
{{- $fullName := include "jumpserver.fullname" $ }}

apiVersion: v1
kind: Service
metadata:
name: {{ $fullName }}
name: "{{ $fullName }}-jms-core"
labels:
{{- include "jumpserver.labels" $ | nindent 4 }}
{{- toYaml .labels | nindent 4 }}
Expand Down
23 changes: 13 additions & 10 deletions charts/jumpserver/templates/kael/deployment-kael.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{{- if .Values.kael.enabled }}
{{- with .Values.kael }}
{{- $fullName := printf "%s-%s" (include "jumpserver.fullname" $) "jms-kael" }}
{{- $fullName := include "jumpserver.fullname" $ }}
{{- $containerName := "jms-kael" }}
{{- $image := printf "%s" (include "jumpserver.kaelImage" $) }}
{{- $registryName := $.Values.global.imageRegistry | default .image.registry }}
{{- $tag := $.Values.global.imageTag | default .image.tag }}
{{- $imageName := "jumpserver/kael" }}
{{- $imageWithTag := printf "%s/%s:%s" $registryName $imageName $tag | quote }}

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $fullName }}
name: "{{ $fullName }}-{{ $containerName }}"
labels:
{{- include "jumpserver.labels" $ | nindent 4 }}
{{- toYaml .labels | nindent 4 }}
Expand Down Expand Up @@ -35,19 +39,18 @@ spec:
- name: {{ $containerName }}
securityContext:
{{- toYaml .securityContext | nindent 12 }}
image: {{ $image }}
imagePullPolicy: {{ .image.pullPolicy }}
image: {{ $imageWithTag }}
imagePullPolicy: {{ .image.pullPolicy | quote }}
{{- with .command }}
command:
{{- tpl (toYaml .) $ | nindent 12 }}
command: {{ toYaml . | nindent 12 }}
{{- end }}
ports:
- name: web
containerPort: {{ .service.web.port }}
protocol: TCP
env:
- name: CORE_HOST
value: "http://{{ include "jumpserver.fullname" $ }}-jms-core:{{ $.Values.core.service.web.port }}"
value: "http://{{ $fullName }}-jms-core:{{ $.Values.core.service.web.port }}"
- name: BOOTSTRAP_TOKEN
value: {{ $.Values.core.config.bootstrapToken | quote }}
- name: LOG_LEVEL
Expand Down Expand Up @@ -87,7 +90,7 @@ spec:
{{- if .persistence.existingClaim }}
claimName: {{ .persistence.existingClaim | quote }}
{{- else }}
claimName: '{{ include "jumpserver.fullname" $ }}-jms-kael-data'
claimName: '{{ $fullName }}-jms-kael-data'
{{- end }}
name: "jms-kael-data"
{{- with .volumes }}
Expand All @@ -106,4 +109,4 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Loading

0 comments on commit a104bba

Please sign in to comment.