Change istio routing to remove path prefixes
The istio VirtualService was configured to use path prefixes to
distinguish the apache-git-http-backend and the gerrit-replica. This
was not required, since the `/git`and `/new` paths used by the
apache-git-http-backend are not used by Gerrit.
Now all traffic to the `/new`and `/git` paths are routed to the
apache-git-http-backend, while all other traffic is routed to the
Gerrit slave.
Change-Id: I6999c28e2791985b2b7f2bc71cadeb00da9c69a4
diff --git a/helm-charts/gerrit-replica/templates/NOTES.txt b/helm-charts/gerrit-replica/templates/NOTES.txt
index 288a971..2ba72bc 100644
--- a/helm-charts/gerrit-replica/templates/NOTES.txt
+++ b/helm-charts/gerrit-replica/templates/NOTES.txt
@@ -6,7 +6,7 @@
push the repositories to:
{{ if .Values.istio.enabled -}}
- http {{- if .Values.istio.tls.enabled -}} s {{- end -}} :// {{- .Values.istio.host -}} /receiver/git/${name}.git
+ http {{- if .Values.istio.tls.enabled -}} s {{- end -}} :// {{- .Values.istio.host -}} /git/${name}.git
{{ else if .Values.gitBackend.ingress.enabled -}}
http {{- if .Values.gitBackend.ingress.tls.enabled -}} s {{- end -}} :// {{- .Values.gitBackend.ingress.host -}} /git/${name}.git
{{- else }}
@@ -19,8 +19,7 @@
kubectl get svc git-backend-service
{{- end }}
-Requests to create new repositories have to be directed to the route
-{{ if .Values.istio.enabled -}} /receiver {{- end -}} /new/${name}.git
+Requests to create new repositories have to be directed to the route /new/${name}.git
over HTTP(S). A detailed guide of how to configure Gerrit's replication plugin
can be found here:
@@ -32,7 +31,7 @@
will be available under:
{{ if .Values.istio.enabled -}}
- http {{- if .Values.istio.tls.enabled -}} s {{- end -}} :// {{- .Values.istio.host -}} /gerrit/<repository-name>.git
+ http {{- if .Values.istio.tls.enabled -}} s {{- end -}} :// {{- .Values.istio.host -}} /<repository-name>.git
{{- else }}
http {{- if .Values.gerritReplica.ingress.tls.enabled -}} s {{- end -}} :// {{- .Values.gerritReplica.ingress.host -}} /<repository-name>.git
{{- end }}
diff --git a/helm-charts/gerrit-replica/templates/istio.ingressgateway.yaml b/helm-charts/gerrit-replica/templates/istio.ingressgateway.yaml
index 1b8a631..02a2ebd 100644
--- a/helm-charts/gerrit-replica/templates/istio.ingressgateway.yaml
+++ b/helm-charts/gerrit-replica/templates/istio.ingressgateway.yaml
@@ -78,23 +78,18 @@
gateways:
- {{ .Release.Name }}-istio-gateway
http:
- - match:
+ - name: apache-git-http-backend
+ match:
- uri:
- prefix: /receiver/
- rewrite:
- uri: /
+ prefix: /git/
+ - uri:
+ prefix: /new/
route:
- destination:
host: {{ .Release.Name }}-git-backend-service.{{ .Release.Namespace }}.svc.cluster.local
port:
number: 80
- - match:
- - uri:
- prefix: /gerrit/
- - uri:
- prefix: /gerrit
- rewrite:
- uri: /
+ - name: gerrit-replica
route:
- destination:
host: {{ .Release.Name }}-gerrit-replica-service.{{ .Release.Namespace }}.svc.cluster.local