ac6237ff by Adam Heath

Revert "There are now 2 gateway-api-gateways(http/https); add explicit gateway"

This reverts commit ac883b33.
1 parent ac883b33
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: gateway-http
name: gateway
spec:
gatewayClassName: istio
listeners:
- name: http-all
port: 80
protocol: HTTP
---
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: gateway-https
spec:
gatewayClassName: istio
listeners:
- name: https-base
protocol: HTTPS
port: 443
......
......@@ -38,32 +38,22 @@ releases:
group: gateway.networking.k8s.io
kind: Gateway
namespace: {{ .Values.namespace }}
name: {{ .Values.name }}-gateway-http
name: {{ .Values.name }}-gateway
patch:
- op: replace
path: /spec/gatewayClassName
value: {{ .Values.gatewayClassName }}
- target:
version: v1beta1
group: gateway.networking.k8s.io
kind: Gateway
namespace: {{ .Values.namespace }}
name: {{ .Values.name }}-gateway-https
patch:
- op: replace
path: /spec/gatewayClassName
value: {{ .Values.gatewayClassName }}
- op: replace
path: /spec/listeners/0/hostname
path: /spec/listeners/1/hostname
value: {{ .Values.base.domain }}
- op: replace
path: /spec/listeners/0/tls/certificateRefs/0/name
path: /spec/listeners/1/tls/certificateRefs/0/name
value: {{ .Values.name }}-exact-cert
- op: replace
path: /spec/listeners/1/hostname
path: /spec/listeners/2/hostname
value: "*.{{ .Values.base.domain }}"
- op: replace
path: /spec/listeners/1/tls/certificateRefs/0/name
path: /spec/listeners/2/tls/certificateRefs/0/name
value: {{ .Values.name }}-subs-cert
- target:
version: v1
......
namespace: default
istio:
enabled: true
gateway: istio-system/cluster-local-gateway
gatewayAPI:
enabled: false
gateway: gateway
redirect:
- hosts:
- example.com
target: www.example.com
scheme: https
istio:
gateway: istio-system/cluster-local-gateway
gatewayAPI:
gateway: gateway-http
- hosts:
- "*"
scheme: https
istio:
gateway: istio-system/cluster-local-gateway
gatewayAPI:
gateway: gateway-http
proxy:
- frontend:
host: www.example.com
......@@ -29,10 +19,6 @@ proxy:
stub: real.example.com
address: 8.8.8.8
authority: www.example.com
istio:
gateway: istio-system/cluster-local-gateway
gatewayAPI:
gateway: gateway-https
config: |
server {
server_name www.example.com;
......
......@@ -19,8 +19,6 @@ releases:
- raw:
resources:
{{- range $redirect_index, $redirect := .Values.redirect }}
{{- $scheme := $redirect | get "scheme" "http" }}
{{- $target := $redirect | get "target" "" }}
{{- if $.Values.istio.enabled }}
- apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
......@@ -30,16 +28,14 @@ releases:
hosts:
{{- $redirect.hosts | toYaml | nindent 20 }}
gateways:
- {{ $redirect.istio.gateway }}
- {{ $.Values.istio.gateway }}
http:
- match:
- uri:
prefix: /
redirect:
redirectCode: 302
authority: {{ $target }}
scheme: {{ $scheme }}
derivePort: FROM_PROTOCOL_DEFAULT
authority: {{ $redirect.target }}
{{- end }}
{{- if $.Values.gatewayAPI.enabled }}
- apiVersion: gateway.networking.k8s.io/v1beta1
......@@ -48,7 +44,7 @@ releases:
name: http-support-redirect-{{ $redirect_index }}-{{ index $redirect.hosts 0 }}
spec:
parentRefs:
- name: {{ $redirect.gatewayAPI.gateway }}
- name: {{ $.Values.gatewayAPI.gateway }}
hostnames:
{{- $redirect.hosts | toYaml | nindent 20 }}
rules:
......@@ -59,10 +55,9 @@ releases:
filters:
- type: RequestRedirect
requestRedirect:
scheme: {{ $scheme }}
scheme: https
statusCode: 302
hostname: {{ $target }}
port: {{ if eq $scheme "https" }}443{{ else }}80{{ end }}
hostname: {{ $redirect.target }}
{{- end }}
{{- end }}
- apiVersion: v1
......@@ -95,7 +90,7 @@ releases:
hosts:
- {{ $proxy.frontend.host }}
gateways:
- {{ $proxy.istio.gateway }}
- {{ $.Values.istio.gateway }}
http:
- match:
- uri:
......@@ -124,7 +119,7 @@ releases:
name: http-support-proxy-{{ $proxy_index }}-{{ index $proxy.frontend.host 0 }}
spec:
parentRefs:
- name: {{ $proxy.gatewayAPI.gateway }}
- name: {{ $.Values.gatewayAPI.gateway }}
hostnames:
- {{ $proxy.frontend.host }}
rules:
......