diff --git a/charts/openg2p-selfservice-api/templates/virtualservice.yaml b/charts/openg2p-selfservice-api/templates/virtualservice.yaml index 999206a..5622363 100644 --- a/charts/openg2p-selfservice-api/templates/virtualservice.yaml +++ b/charts/openg2p-selfservice-api/templates/virtualservice.yaml @@ -22,7 +22,7 @@ spec: http: - match: - uri: - {{- toYaml .Values.istio.virtualservice.uri | nindent 8 }} + prefix: {{ .Values.istio.virtualservice.prefix }} {{- if .Values.istio.virtualservice.rewriteUri }} rewrite: uri: {{ .Values.istio.virtualservice.rewriteUri }} diff --git a/charts/openg2p-selfservice-api/values.yaml b/charts/openg2p-selfservice-api/values.yaml index eef2761..6ea5425 100644 --- a/charts/openg2p-selfservice-api/values.yaml +++ b/charts/openg2p-selfservice-api/values.yaml @@ -88,14 +88,13 @@ envVarsFrom: key: password istio: - enabled: true + enabled: false virtualservice: enabled: true host: "" gateway: "istio-system/all-hosts" - uri: - prefix: "/selfservice/v1/" - rewriteUri: "/" + prefix: /selfservice/v1/ + rewriteUri: / gateway: enabled: false host: "" diff --git a/charts/openg2p-selfservice-ui/templates/virtualservice.yaml b/charts/openg2p-selfservice-ui/templates/virtualservice.yaml index 88c2f29..c5b93e9 100644 --- a/charts/openg2p-selfservice-ui/templates/virtualservice.yaml +++ b/charts/openg2p-selfservice-ui/templates/virtualservice.yaml @@ -20,6 +20,24 @@ spec: - {{ .Values.istio.virtualservice.gateway }} {{- end }} http: + {{- if .Values.istio.virtualservice.apiPrefix }} + - match: + - uri: + prefix: {{ .Values.istio.virtualservice.apiPrefix }} + {{- if .Values.istio.virtualservice.apiRewriteUri }} + rewrite: + uri: {{ .Values.istio.virtualservice.apiRewriteUri }} + {{- end }} + route: + - destination: + {{- if .Values.istio.virtualservice.apiServicePath }} + host: {{ .Values.istio.virtualservice.apiServicePath }} + {{- else }} + host: {{ include "portal.fullname" . | replace "ui" "api" }} + {{- end }} + port: + number: {{ .Values.service.port }} + {{- end }} - match: - uri: {{- toYaml .Values.istio.virtualservice.uri | nindent 8 }} diff --git a/charts/openg2p-selfservice-ui/values.yaml b/charts/openg2p-selfservice-ui/values.yaml index 536308a..a26b5af 100644 --- a/charts/openg2p-selfservice-ui/values.yaml +++ b/charts/openg2p-selfservice-ui/values.yaml @@ -87,8 +87,9 @@ istio: enabled: true host: "" gateway: "istio-system/all-hosts" - uri: - regex: '^\/selfservice(?:\/v1)' + prefix: /selfservice + apiPrefix: /selfservice/v1/ + apiRewriteUri: / redirectToSelfServiceEnabled: true gateway: enabled: false