Revert "There are now 2 gateway-api-gateways(http/https); add explicit gateway"
This reverts commit ac883b33.
Showing
4 changed files
with
15 additions
and
52 deletions
1 | apiVersion: gateway.networking.k8s.io/v1beta1 | 1 | apiVersion: gateway.networking.k8s.io/v1beta1 |
2 | kind: Gateway | 2 | kind: Gateway |
3 | metadata: | 3 | metadata: |
4 | name: gateway-http | 4 | name: gateway |
5 | spec: | 5 | spec: |
6 | gatewayClassName: istio | 6 | gatewayClassName: istio |
7 | listeners: | 7 | listeners: |
8 | - name: http-all | 8 | - name: http-all |
9 | port: 80 | 9 | port: 80 |
10 | protocol: HTTP | 10 | protocol: HTTP |
11 | --- | ||
12 | apiVersion: gateway.networking.k8s.io/v1beta1 | ||
13 | kind: Gateway | ||
14 | metadata: | ||
15 | name: gateway-https | ||
16 | spec: | ||
17 | gatewayClassName: istio | ||
18 | listeners: | ||
19 | - name: https-base | 11 | - name: https-base |
20 | protocol: HTTPS | 12 | protocol: HTTPS |
21 | port: 443 | 13 | port: 443 | ... | ... |
... | @@ -38,32 +38,22 @@ releases: | ... | @@ -38,32 +38,22 @@ releases: |
38 | group: gateway.networking.k8s.io | 38 | group: gateway.networking.k8s.io |
39 | kind: Gateway | 39 | kind: Gateway |
40 | namespace: {{ .Values.namespace }} | 40 | namespace: {{ .Values.namespace }} |
41 | name: {{ .Values.name }}-gateway-http | 41 | name: {{ .Values.name }}-gateway |
42 | patch: | 42 | patch: |
43 | - op: replace | 43 | - op: replace |
44 | path: /spec/gatewayClassName | 44 | path: /spec/gatewayClassName |
45 | value: {{ .Values.gatewayClassName }} | 45 | value: {{ .Values.gatewayClassName }} |
46 | - target: | ||
47 | version: v1beta1 | ||
48 | group: gateway.networking.k8s.io | ||
49 | kind: Gateway | ||
50 | namespace: {{ .Values.namespace }} | ||
51 | name: {{ .Values.name }}-gateway-https | ||
52 | patch: | ||
53 | - op: replace | 46 | - op: replace |
54 | path: /spec/gatewayClassName | 47 | path: /spec/listeners/1/hostname |
55 | value: {{ .Values.gatewayClassName }} | ||
56 | - op: replace | ||
57 | path: /spec/listeners/0/hostname | ||
58 | value: {{ .Values.base.domain }} | 48 | value: {{ .Values.base.domain }} |
59 | - op: replace | 49 | - op: replace |
60 | path: /spec/listeners/0/tls/certificateRefs/0/name | 50 | path: /spec/listeners/1/tls/certificateRefs/0/name |
61 | value: {{ .Values.name }}-exact-cert | 51 | value: {{ .Values.name }}-exact-cert |
62 | - op: replace | 52 | - op: replace |
63 | path: /spec/listeners/1/hostname | 53 | path: /spec/listeners/2/hostname |
64 | value: "*.{{ .Values.base.domain }}" | 54 | value: "*.{{ .Values.base.domain }}" |
65 | - op: replace | 55 | - op: replace |
66 | path: /spec/listeners/1/tls/certificateRefs/0/name | 56 | path: /spec/listeners/2/tls/certificateRefs/0/name |
67 | value: {{ .Values.name }}-subs-cert | 57 | value: {{ .Values.name }}-subs-cert |
68 | - target: | 58 | - target: |
69 | version: v1 | 59 | version: v1 | ... | ... |
1 | namespace: default | 1 | namespace: default |
2 | istio: | 2 | istio: |
3 | enabled: true | 3 | enabled: true |
4 | gateway: istio-system/cluster-local-gateway | ||
4 | gatewayAPI: | 5 | gatewayAPI: |
5 | enabled: false | 6 | enabled: false |
7 | gateway: gateway | ||
6 | redirect: | 8 | redirect: |
7 | - hosts: | 9 | - hosts: |
8 | - example.com | 10 | - example.com |
9 | target: www.example.com | 11 | target: www.example.com |
10 | scheme: https | ||
11 | istio: | ||
12 | gateway: istio-system/cluster-local-gateway | ||
13 | gatewayAPI: | ||
14 | gateway: gateway-http | ||
15 | - hosts: | ||
16 | - "*" | ||
17 | scheme: https | ||
18 | istio: | ||
19 | gateway: istio-system/cluster-local-gateway | ||
20 | gatewayAPI: | ||
21 | gateway: gateway-http | ||
22 | proxy: | 12 | proxy: |
23 | - frontend: | 13 | - frontend: |
24 | host: www.example.com | 14 | host: www.example.com |
... | @@ -29,10 +19,6 @@ proxy: | ... | @@ -29,10 +19,6 @@ proxy: |
29 | stub: real.example.com | 19 | stub: real.example.com |
30 | address: 8.8.8.8 | 20 | address: 8.8.8.8 |
31 | authority: www.example.com | 21 | authority: www.example.com |
32 | istio: | ||
33 | gateway: istio-system/cluster-local-gateway | ||
34 | gatewayAPI: | ||
35 | gateway: gateway-https | ||
36 | config: | | 22 | config: | |
37 | server { | 23 | server { |
38 | server_name www.example.com; | 24 | server_name www.example.com; | ... | ... |
... | @@ -19,8 +19,6 @@ releases: | ... | @@ -19,8 +19,6 @@ releases: |
19 | - raw: | 19 | - raw: |
20 | resources: | 20 | resources: |
21 | {{- range $redirect_index, $redirect := .Values.redirect }} | 21 | {{- range $redirect_index, $redirect := .Values.redirect }} |
22 | {{- $scheme := $redirect | get "scheme" "http" }} | ||
23 | {{- $target := $redirect | get "target" "" }} | ||
24 | {{- if $.Values.istio.enabled }} | 22 | {{- if $.Values.istio.enabled }} |
25 | - apiVersion: networking.istio.io/v1alpha3 | 23 | - apiVersion: networking.istio.io/v1alpha3 |
26 | kind: VirtualService | 24 | kind: VirtualService |
... | @@ -30,16 +28,14 @@ releases: | ... | @@ -30,16 +28,14 @@ releases: |
30 | hosts: | 28 | hosts: |
31 | {{- $redirect.hosts | toYaml | nindent 20 }} | 29 | {{- $redirect.hosts | toYaml | nindent 20 }} |
32 | gateways: | 30 | gateways: |
33 | - {{ $redirect.istio.gateway }} | 31 | - {{ $.Values.istio.gateway }} |
34 | http: | 32 | http: |
35 | - match: | 33 | - match: |
36 | - uri: | 34 | - uri: |
37 | prefix: / | 35 | prefix: / |
38 | redirect: | 36 | redirect: |
39 | redirectCode: 302 | 37 | redirectCode: 302 |
40 | authority: {{ $target }} | 38 | authority: {{ $redirect.target }} |
41 | scheme: {{ $scheme }} | ||
42 | derivePort: FROM_PROTOCOL_DEFAULT | ||
43 | {{- end }} | 39 | {{- end }} |
44 | {{- if $.Values.gatewayAPI.enabled }} | 40 | {{- if $.Values.gatewayAPI.enabled }} |
45 | - apiVersion: gateway.networking.k8s.io/v1beta1 | 41 | - apiVersion: gateway.networking.k8s.io/v1beta1 |
... | @@ -48,7 +44,7 @@ releases: | ... | @@ -48,7 +44,7 @@ releases: |
48 | name: http-support-redirect-{{ $redirect_index }}-{{ index $redirect.hosts 0 }} | 44 | name: http-support-redirect-{{ $redirect_index }}-{{ index $redirect.hosts 0 }} |
49 | spec: | 45 | spec: |
50 | parentRefs: | 46 | parentRefs: |
51 | - name: {{ $redirect.gatewayAPI.gateway }} | 47 | - name: {{ $.Values.gatewayAPI.gateway }} |
52 | hostnames: | 48 | hostnames: |
53 | {{- $redirect.hosts | toYaml | nindent 20 }} | 49 | {{- $redirect.hosts | toYaml | nindent 20 }} |
54 | rules: | 50 | rules: |
... | @@ -59,10 +55,9 @@ releases: | ... | @@ -59,10 +55,9 @@ releases: |
59 | filters: | 55 | filters: |
60 | - type: RequestRedirect | 56 | - type: RequestRedirect |
61 | requestRedirect: | 57 | requestRedirect: |
62 | scheme: {{ $scheme }} | 58 | scheme: https |
63 | statusCode: 302 | 59 | statusCode: 302 |
64 | hostname: {{ $target }} | 60 | hostname: {{ $redirect.target }} |
65 | port: {{ if eq $scheme "https" }}443{{ else }}80{{ end }} | ||
66 | {{- end }} | 61 | {{- end }} |
67 | {{- end }} | 62 | {{- end }} |
68 | - apiVersion: v1 | 63 | - apiVersion: v1 |
... | @@ -95,7 +90,7 @@ releases: | ... | @@ -95,7 +90,7 @@ releases: |
95 | hosts: | 90 | hosts: |
96 | - {{ $proxy.frontend.host }} | 91 | - {{ $proxy.frontend.host }} |
97 | gateways: | 92 | gateways: |
98 | - {{ $proxy.istio.gateway }} | 93 | - {{ $.Values.istio.gateway }} |
99 | http: | 94 | http: |
100 | - match: | 95 | - match: |
101 | - uri: | 96 | - uri: |
... | @@ -124,7 +119,7 @@ releases: | ... | @@ -124,7 +119,7 @@ releases: |
124 | name: http-support-proxy-{{ $proxy_index }}-{{ index $proxy.frontend.host 0 }} | 119 | name: http-support-proxy-{{ $proxy_index }}-{{ index $proxy.frontend.host 0 }} |
125 | spec: | 120 | spec: |
126 | parentRefs: | 121 | parentRefs: |
127 | - name: {{ $proxy.gatewayAPI.gateway }} | 122 | - name: {{ $.Values.gatewayAPI.gateway }} |
128 | hostnames: | 123 | hostnames: |
129 | - {{ $proxy.frontend.host }} | 124 | - {{ $proxy.frontend.host }} |
130 | rules: | 125 | rules: | ... | ... |
-
Please register or sign in to post a comment