Update net-istio configuration format (#5858)

This commit is contained in:
pastequo 2024-02-12 08:06:39 +01:00 committed by GitHub
parent 090349af2a
commit f626d0e6e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 64 additions and 20 deletions

View File

@ -112,11 +112,14 @@ need to update gateway configmap `config-istio` under the `knative-serving` name
kubectl edit configmap config-istio -n knative-serving
```
2. Replace the `local-gateway.knative-serving.knative-local-gateway` field with the custom service. As an example, if you name both
2. Replace the `local-gateways` field with the custom service. As an example, if you name both
the service and deployment `custom-local-gateway` under the namespace `istio-system`, it should be updated to:
```
custom-local-gateway.istio-system.svc.cluster.local
local-gateways: |
- name: knative-local-gateway
namespace: knative-serving
service: custom-local-gateway.istio-system.svc.cluster.local
```
As an example, if both the custom service and deployment are labeled with `custom: custom-local-gateway`, not the default

View File

@ -312,10 +312,19 @@ spec:
istio: ingressgateway
config:
istio:
gateway.knative-serving.knative-ingress-gateway: "custom-ingressgateway.custom-ns.svc.cluster.local"
external-gateways: |
- name: knative-ingress-gateway
namespace: knative-serving
service: custom-ingressgateway.custom-ns.svc.cluster.local
```
The key in `spec.config.istio` is in the format of `gateway.<gateway_namespace>.<gateway_name>`.
The key in `spec.config.istio` is in the format of
```
external-gateways: |
- name: <gateway_name>
namespace: <gateway_namespace>
service: istio-ingressgateway.istio-system.svc.cluster.local
```
## Replace the ingress gateway
@ -332,10 +341,19 @@ spec:
spec:
config:
istio:
gateway.custom-ns.knative-custom-gateway: "istio-ingressgateway.istio-system.svc.cluster.local"
external-gateways: |
- name: knative-custom-gateway
namespace: custom-ns
service: istio-ingressgateway.istio-system.svc.cluster.local
```
The key in `spec.config.istio` is in the format of `gateway.<gateway_namespace>.<gateway_name>`.
The key in `spec.config.istio` is in the format of
```
external-gateways: |
- name: <gateway_name>
namespace: <gateway_namespace>
service: istio-ingressgateway.istio-system.svc.cluster.local
```
## Configuration of cluster local gateway
@ -369,7 +387,10 @@ spec:
custom: custom-local-gateway
config:
istio:
local-gateway.knative-serving.knative-local-gateway: "custom-local-gateway.istio-system.svc.cluster.local"
local-gateways: |
- name: knative-local-gateway
namespace: knative-serving
service: custom-local-gateway.istio-system.svc.cluster.local
```
## Servers configuration for Istio gateways:
@ -400,7 +421,10 @@ spec:
- <test-ip>
config:
istio:
local-gateway.knative-serving.knative-local-gateway: "custom-local-gateway.istio-system.svc.cluster.local"
local-gateways: |
- name: knative-local-gateway
namespace: knative-serving
service: custom-local-gateway.istio-system.svc.cluster.local
```
## Customize kourier-bootstrap for Kourier gateways:

View File

@ -161,7 +161,10 @@ Knative Serving with different ingresses:
# ...
config:
istio:
local-gateway.<local-gateway-namespace>.knative-local-gateway: "knative-local-gateway.<istio-namespace>.svc.cluster.local"
local-gateways: |
- name: knative-local-gateway
namespace: <local-gateway-namespace>
service: knative-local-gateway.<istio-namespace>.svc.cluster.local
```
Where:

View File

@ -72,17 +72,22 @@ namespace:
# #
################################
# ...
gateway.knative-serving.knative-ingress-gateway: "istio-ingressgateway.istio-system.svc.cluster.local"
external-gateways: |
- name: knative-ingress-gateway
namespace: knative-serving
service: istio-ingressgateway.istio-system.svc.cluster.local
```
1. Edit the file to add the `gateway.knative-serving.knative-ingress-gateway: <ingress_name>.<ingress_namespace>.svc.cluster.local` field with
the fully qualified url of your service.
1. Edit the file to add the `external-gateways` field with the fully qualified url of your service.
For the example `custom-ingressgateway` service mentioned earlier, it should be updated to:
```yaml
apiVersion: v1
data:
gateway.knative-serving.knative-ingress-gateway: custom-ingressgateway.custom-ns.svc.cluster.local
external-gateways: |
- name: knative-ingress-gateway
namespace: knative-serving
service: custom-ingressgateway.custom-ns.svc.cluster.local
kind: ConfigMap
[...]
```
@ -147,21 +152,30 @@ namespace:
# #
################################
# ...
gateway.knative-serving.knative-ingress-gateway: "istio-ingressgateway.istio-system.svc.cluster.local"
external-gateways: |
- name: knative-ingress-gateway
namespace: knative-serving
service: istio-ingressgateway.istio-system.svc.cluster.local
```
1. Edit the file to add the `gateway.<gateway-namespace>.<gateway-name>: istio-ingressgateway.istio-system.svc.cluster.local` field with
the customized gateway.
1. Edit the file to add the `external-gateways` field with the customized gateway.
For the example `knative-custom-gateway` mentioned earlier, it should be updated to:
```yaml
apiVersion: v1
data:
gateway.custom-ns.knative-custom-gateway: "istio-ingressgateway.istio-system.svc.cluster.local"
external-gateways: |
- name: knative-custom-gateway
namespace: custom-ns
service: istio-ingressgateway.istio-system.svc.cluster.local
kind: ConfigMap
[...]
```
The configuration format should be `gateway.<gateway-namespace>.<gateway-name>`.
`<gateway-namespace>` is optional. When it is omitted, the system searches for
the gateway in the serving system namespace `knative-serving`.
The configuration format should be
```
external-gateways: |
- name: <gateway-name>
namespace: <gateway-namespace>
service: <fully-qualified-url-of-istio-ingress-service>
```