apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: gateway-samplenamespace: defaultspec:selector: # Match pods delivered by the gateway configurations based on the entered labels.istio: ingressgatewayapp: istio-ingressgatewayservers:- port:number: 80name: httpprotocol: HTTPhosts:- uk.bookinfo.com- eu.bookinfo.comtls:httpsRedirect: true # Send a 301 https redirect.- port:number: 443name: https-443protocol: HTTPS # Enable HTTPS ports.hosts:- uk.bookinfo.com- eu.bookinfo.comtls:mode: SIMPLE # TLS one-way authenticationserverCertificate: /etc/certs/servercert.pem # Load the certificate in the file mount manner.privateKey: /etc/certs/privatekey.pem- port:number: 9443name: https-9443protocol: HTTPS # Enable HTTPS ports.hosts:- "bookinfo-namespace/*.bookinfo.com"tls:mode: SIMPLE # TLS one-way authenticationcredentialName: bookinfo-secret # Load the certificate from the Kubernetes secret in the SDS manner.- port:number: 5443name: https-sslprotocol: HTTPS # Enable HTTPS ports.hosts:- "*"tls:mode: SIMPLE # TLS one-way authenticationcredentialName: qcloud-abcdABCD # Load the certificate with the certificate ID of abcdABCD from the Tencent Cloud SSL Certificate Service console in the SDS manner.- port:number: 6443name: clb-https-6443-ABCDabcd # Have certificate offloading on port 6443 to take place at CLB, where the certificate is the SSL certificate with ID of ABCDabcd.protocol: HTTPhosts:- "tcm.tencent.com"
Name | Type | Description |
metadata.name | string | Gateway name. |
metadata.namespace | string | Gateway namespace. |
spec.selector | map<string, string> | Label key-value pair used by the gateway to match the gateway instances delivered by the configurations. |
spec.servers.port.number | uint32 | Port number. |
spec.servers.port.protocol | string | Communication protocol. The following protocols are supported: HTTP, HTTPS, GRPC, HTTP2, MONGO, TCP, TLS . Note that the protocol configurations of the same port on the same gateway need to be consistent. |
spec.servers.port.name | string | Port name. Currently, Tencent Cloud Mesh implements the feature of enabling SSL certificate offloading to take place at CLB based on the port name. If you need to configure this feature, you can set the port name in the format of clb-https-{port number}-{SSL certificate ID} . This feature takes effect only when the current port communication protocol is set to HTTP. The gateway controller automatically creates a CLB layer-7 listener to implement certificate offloading. After SSL offloading is completed at CLB, the CLB instance and the ingress gateway pod adopt plaintext communication. Note that the certificate offloading configurations of the same port on the same gateway need to be consistent; otherwise, a configuration conflict occurs. |
spec.severs.hosts | string[] | Domain name, which supports wildcard * . |
spec.servers.tls.httpsRedirect | bool | When the value is true , the gateway returns a 301 redirect to all HTTP requests, requiring the client to initiate an HTTPS request. |
spec.servers.tls.mode | - | TLS security authentication mode of the current port. Specify this field if you need to enable security authentication of the current port. The following values are supported: PASSTHROUGH, SIMPLE, MUTUAL, AUTO_PASSTHROUGH, ISTIO_MUTUAL . |
spec.servers.tls.credentialName | string | Name of the secret from which the TLS certificate key is found. Tencent Cloud Mesh supports loading the certificate and key from the Kubernetes secret in the same namespace of the ingress gateway instance. Ensure that the secret you entered contains the appropriate certificate and key. Tencent Cloud Mesh also implements the feature of loading a Tencent Cloud SSL certificate. If you specify this field in the format of qcloud-{SSL certificate ID} , the gateway controller of Tencent Cloud Mesh will load the SSL certificate for the gateway. Currently, Tencent Cloud Mesh supports loading only server certificates and private keys in SIMPLE mode (one-way authentication) from the SSL Certificate Service console. |
spec.servers.tls.serverCertificate | string | Certificate path that needs to be entered when the TLS certificate key of the port is mounted in the file mount manner (not recommended; it is recommended that you enter the credentialName field to load the certificate private key). By default, Istio uses the istio-ingressgateway-certs secret in the namespace where the gateway locates to load the certificate to the path /etc/istio/ingressgateway-certs . |
spec.servers.tls.privateKey | string | Private key path that needs to be entered when the TLS certificate key of the port is mounted in the file mount manner (not recommended; it is recommended that you enter the credentialName field to load the certificate private key). By default, Istio uses the istio-ingressgateway-certs secret in the namespace where the gateway locates to load the private key to the path /etc/istio/ingressgateway-certs . |
spec.servers.tls.caCertificates | string | Root certificate path that needs to be entered when the TLS certificate key of the port is mounted in the file mount manner (not recommended; it is recommended that you enter the credentialName field to load the certificate private key). By default, Istio uses the istio-ingressgateway-ca-certs secret in the namespace where the gateway locates to load the root certificate to the path /etc/istio/ingressgateway-ca-certs . A root certificate needs to be configured in mutual authentication. |
apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: sample-gwnamespace: defaultspec:servers:- port:number: 443name: HTTPS-443-6cphprotocol: HTTPShosts:- '*'tls:mode: SIMPLEcredentialName: {kubernetes secret name}selector:app: istio-ingressgatewayistio: ingressgateway
apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: test-gwspec:servers:- port:number: 443name: HTTPS-443-9ufrprotocol: HTTPShosts:- '*'tls:mode: SIMPLEcredentialName: qcloud-{Certificate ID}selector:app: istio-ingressgatewayistio: ingressgateway
sample.hosta.org
uses certificate 1, and the domain name sample.hostb.org
uses certificate 2.apiVersion: networking.istio.io/v1alpha3kind: Gatewaymetadata:name: test-gwspec:servers:- port:number: 443name: clb-https-443-{Certificate ID 1}protocol: HTTPhosts:- sample.hosta.org- port:number: 443name: clb-https-443-{Certificate ID 2}protocol: HTTPhosts:- sample.hostb.orgselector:app: istio-ingressgatewayistio: ingressgateway
Was this page helpful?