From ae47c5f435df2eecfe16e9bc6d3e232ef55a42f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Sun, 6 Jun 2021 01:00:04 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/ingress.yaml | 15 +++++++-------- templates/service-core.yaml | 6 +++++- templates/service-koko.yaml | 6 +++++- templates/service-lion.yaml | 6 +++++- templates/service-nginx.yaml | 6 +++++- values.yaml | 1 + 6 files changed, 28 insertions(+), 12 deletions(-) diff --git a/templates/ingress.yaml b/templates/ingress.yaml index ed0762b..de03a49 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -1,9 +1,5 @@ {{- if .Values.ingress.enabled }} -{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ include "jumpserver.fullname" . }} @@ -29,9 +25,12 @@ spec: - host: {{ . }} http: paths: - - path: / + - pathType: Prefix + path: / backend: - serviceName: '{{printf "%s-%s" (include "jumpserver.fullname" $) "jms-nginx"}}' - servicePort: web + service: + name: '{{printf "%s-%s" (include "jumpserver.fullname" $) "jms-nginx"}}' + port: + number: 80 {{- end }} {{- end }} diff --git a/templates/service-core.yaml b/templates/service-core.yaml index 402ae9b..32c4af0 100644 --- a/templates/service-core.yaml +++ b/templates/service-core.yaml @@ -19,9 +19,13 @@ spec: targetPort: ws protocol: TCP name: ws + sessionAffinity: ClientIP + sessionAffinityConfig: + clientIP: + timeoutSeconds: 10800 selector: app.kubernetes.io/name: {{ include "jumpserver.name" $ }} app.kubernetes.io/instance: {{ $.Release.Name }} {{- toYaml .labels | nindent 4 }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/service-koko.yaml b/templates/service-koko.yaml index 1de8964..268bd1d 100644 --- a/templates/service-koko.yaml +++ b/templates/service-koko.yaml @@ -21,9 +21,13 @@ spec: targetPort: ssh protocol: TCP name: ssh + sessionAffinity: ClientIP + sessionAffinityConfig: + clientIP: + timeoutSeconds: 10800 selector: app.kubernetes.io/name: {{ include "jumpserver.name" $ }} app.kubernetes.io/instance: {{ $.Release.Name }} {{- toYaml .labels | nindent 4 }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/service-lion.yaml b/templates/service-lion.yaml index 685f1c6..d3e51d6 100644 --- a/templates/service-lion.yaml +++ b/templates/service-lion.yaml @@ -15,9 +15,13 @@ spec: targetPort: web protocol: TCP name: web + sessionAffinity: ClientIP + sessionAffinityConfig: + clientIP: + timeoutSeconds: 10800 selector: app.kubernetes.io/name: {{ include "jumpserver.name" $ }} app.kubernetes.io/instance: {{ $.Release.Name }} {{- toYaml .labels | nindent 4 }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/templates/service-nginx.yaml b/templates/service-nginx.yaml index 76ef85b..61d2503 100644 --- a/templates/service-nginx.yaml +++ b/templates/service-nginx.yaml @@ -15,9 +15,13 @@ spec: targetPort: web protocol: TCP name: web + sessionAffinity: ClientIP + sessionAffinityConfig: + clientIP: + timeoutSeconds: 10800 selector: app.kubernetes.io/name: {{ include "jumpserver.name" $ }} app.kubernetes.io/instance: {{ $.Release.Name }} {{- toYaml .labels | nindent 4 }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/values.yaml b/values.yaml index 29e22b7..55727a1 100644 --- a/values.yaml +++ b/values.yaml @@ -21,6 +21,7 @@ ingress: # kubernetes.io/tls-acme: "true" compute-full-forwarded-for: "true" use-forwarded-headers: "true" + hosts: - "test.jumpserver.org" tls: []