fix: 去除path路由

This commit is contained in:
a601287411 2023-04-19 10:23:15 +08:00
parent db6c521068
commit 54ef2cba47
5 changed files with 38 additions and 13 deletions

View File

@ -61,6 +61,13 @@ Create the name of the service account to use
{{- end }} {{- end }}
{{- end }} {{- end }}
{{/*
Create the full host of demo
*/}}
{{- define "demo-chart.host" -}}
{{ .Release.Name }}.{{ .Values.host }}
{{- end }}
{{/* {{/*
Create the url path of service Create the url path of service
*/}} */}}

View File

@ -36,13 +36,9 @@ spec:
containerPort: {{ .Values.service.port }} containerPort: {{ .Values.service.port }}
protocol: TCP protocol: TCP
livenessProbe: livenessProbe:
httpGet: {{- toYaml .Values.livenessProbe | nindent 12 }}
path: /
port: http
readinessProbe: readinessProbe:
httpGet: {{- toYaml .Values.readinessProbe | nindent 12 }}
path: /
port: http
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}

View File

@ -3,10 +3,7 @@ apiVersion: http.keda.sh/v1alpha1
metadata: metadata:
name: {{ include "demo-chart.fullname" . }} name: {{ include "demo-chart.fullname" . }}
spec: spec:
host: {{ .Values.host }} host: {{ include "demo-chart.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

@ -7,10 +7,10 @@ metadata:
kubernetes.io/ingress.class: nginx kubernetes.io/ingress.class: nginx
spec: spec:
rules: rules:
- host: {{ .Values.host }} - host: {{ include "demo-chart.host" . }}
http: http:
paths: paths:
- path: {{ include "demo-chart.path" . }}/ - path: /
pathType: Prefix pathType: Prefix
backend: backend:
service: service:

View File

@ -5,7 +5,7 @@
replicaCount: 1 replicaCount: 1
targetPendingRequests: 200 targetPendingRequests: 200
host: ailab-demo.xf-yun.com host: ailab.xf-yun.com
pathType: prefix pathType: prefix
pathPrefix: /demo pathPrefix: /demo
rewritePath: true rewritePath: true
@ -87,3 +87,28 @@ tolerations: []
# Temporarily unconfigurable # Temporarily unconfigurable
# affinity: {} # affinity: {}
# Liveness and readiness probes
# These are disabled by default, as they are not required for the demo
# application to function. If you want to enable them, you can uncomment
# the following lines and adjust them as necessary.
livenessProbe:
{}
# failureThreshold: 3
# httpGet:
# path: /
# port: http
# scheme: HTTP
# periodSeconds: 10
# successThreshold: 1
# timeoutSeconds: 1
readinessProbe:
{}
# failureThreshold: 3
# httpGet:
# path: /
# port: http
# scheme: HTTP
# periodSeconds: 10
# successThreshold: 1
# timeoutSeconds: 1