

service.cloud.tencent.com/specify-protocol annotation to modify the CLB listener protocol. For details, see Service Extension Protocol.values.yaml configuration example:controller:service:annotations:service.cloud.tencent.com/specify-protocol: |{"80": {"protocol": ["HTTP"],"hosts": {"a.example.com": {},"b.example.com": {}}},"443": {"protocol": ["HTTPS"],"hosts": {"a.example.com": {"tls": "cert-secret-a"},"b.example.com": {"tls": "cert-secret-b"}}}}
hosts field of the annotation.qcloud_cert_id, and the Value is the corresponding certificate ID. Then refer to the secret name in the annotation.targetPorts needs to direct the HTTPS port to port 80 (HTTP) of Nginx Ingress to avoid CLB's port 443 traffic being forwarded to Nginx Ingress's port 443 (which would lead to double certificates and forward failure).enableHttp to false.
apiVersion: v1kind: Secretmetadata:name: cert-secret-testnamespace: ingress-nginxstringData: # Using stringData eliminates the need of manual base64 transcoding# highlight-next-lineqcloud_cert_id: E2pcp0Fytype: Opaque
values.yaml:controller: # The following configuration replaces the dependent image with the mirror image on docker hub to ensure it can be pulled in the Chinese mainland environmentimage:registry: docker.ioimage: k8smirror/ingress-nginx-controlleradmissionWebhooks:patch:image:registry: docker.ioimage: k8smirror/ingress-nginx-kube-webhook-certgendefaultBackend:image:registry: docker.ioimage: k8smirror/defaultbackend-amd64opentelemetry:image:registry: docker.ioimage: k8smirror/ingress-nginx-opentelemetryservice:enableHttp: falsetargetPorts:https: httpannotations:service.cloud.tencent.com/specify-protocol: |{"80": {"protocol": ["HTTP"],"hosts": {"test.example.com": {}}},"443": {"protocol": ["HTTPS"],"hosts": {"test.example.com": {"tls": "cert-secret-test"}}}}

apiVersion: v1kind: Servicemetadata:labels:app: nginxname: nginxspec:ports:- port: 80protocol: TCPtargetPort: 80selector:app: nginxtype: NodePort---apiVersion: apps/v1kind: Deploymentmetadata:name: nginxspec:replicas: 1selector:matchLabels:app: nginxtemplate:metadata:labels:app: nginxspec:containers:- image: nginx:latestname: nginx---apiVersion: networking.k8s.io/v1kind: Ingressmetadata:name: nginxspec:ingressClassName: nginxrules:- host: test.example.comhttp:paths:- backend:service:name: nginxport:number: 80path: /pathType: Prefix


Feedback