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 }} {{- end }}
{{/* {{/*
Create the host of service Create the url path of service
*/}} */}}
{{- define "demo-chart.host" -}} {{- define "demo-chart.path" -}}
{{ .Release.Name }}.xf-yun.com {{ .Values.pathPrefix }}/{{ .Release.Name }}
{{- end }} {{- end }}

View File

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

View File

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

View File

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