This commit is contained in:
a601287411 2023-04-11 10:58:43 +08:00
parent 8a76c5e702
commit 0abcf133de
4 changed files with 16 additions and 8 deletions

View File

@ -62,8 +62,8 @@ Create the name of the service account to use
{{- end }}
{{/*
Create the host of service
Create the url path of service
*/}}
{{- define "demo-chart.host" -}}
{{ .Release.Name }}.xf-yun.com
{{- define "demo-chart.path" -}}
{{ .Values.pathPrefix }}/{{ .Release.Name }}
{{- end }}

View File

@ -3,7 +3,10 @@ apiVersion: http.keda.sh/v1alpha1
metadata:
name: {{ include "demo-chart.fullname" . }}
spec:
host: {{ include "demo-chart.host" . }}
host: {{ .Values.host }}
path: {{ include "demo-chart.path" . }}
pathType: {{ .Values.pathType }}
rewrite: {{ .Values.rewritePath }}
targetPendingRequests: {{ .Values.targetPendingRequests }}
scaleTargetRef:
deployment: {{ include "demo-chart.fullname" . }}

View File

@ -4,14 +4,13 @@ metadata:
name: {{ include "demo-chart.fullname" . }}
namespace: {{ .Values.ingressNamespace | default .Release.Namespace }}
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: {{ include "demo-chart.host" . }}
- host: {{ .Values.host }}
http:
paths:
- path: /
- path: {{ include "demo-chart.path" . }}
pathType: Prefix
backend:
service:

View File

@ -4,6 +4,12 @@
replicaCount: 1
targetPendingRequests: 200
host: ailab-demo.xf-yun.com
pathType: prefix
pathPrefix: /demo
rewritePath: true
# This is the namespace that the ingress should be installed
# into. It should be set to the same namespace as the
# KEDA HTTP componentry is installed in. Defaults to the Helm
@ -64,7 +70,7 @@ resources: {}
autoscaling:
http:
minReplicas: 0
maxReplicas: 10
maxReplicas: 2
nodeSelector: {}