diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 391112a..f31d94b 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -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 }} diff --git a/templates/httpscaledobject.yaml b/templates/httpscaledobject.yaml index bf1f0c3..b091b36 100644 --- a/templates/httpscaledobject.yaml +++ b/templates/httpscaledobject.yaml @@ -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" . }} diff --git a/templates/ingress.yaml b/templates/ingress.yaml index 9f91356..3ab87da 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -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: diff --git a/values.yaml b/values.yaml index 0fa172b..905afb2 100644 --- a/values.yaml +++ b/values.yaml @@ -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: {}