helm repo add traefik https://helm.traefik.io/traefik
values-traefik.yaml. See the sample below:providers:kubernetesIngress:publishedService:enabled: true # Display the external IP address of Ingress as the LB IP address of Traefik.additionalArguments:- "--providers.kubernetesingress.ingressclass=traefik" # Indicates the ingress class name.- "--log.level=DEBUG"service:annotations:service.cloud.tencent.com/direct-access: "true" # For gateway applications, we recommend that you use direct connection between the LB and pods (bypassing NodePort). If you use the VPC-CNI and Global Router network modes at the same time, use this annotation to display the declaration of direct binding of the LB to pods (bypassing NodePort). If you selected the VPC-CNI network mode during cluster creation, the declaration need not be displayed (because, by default, the LB is directly connected to pods). For more information, see the official documentation at https://www.tencentcloud.com/document/product/457/38408.service.kubernetes.io/tke-existed-lbid: lb-lb57hvgl # Use this annotation to bind the LB created in advance, so that even if Traefik is rebuilt in the future, the traffic entry will remain unchanged. If you do not specify this annotation, a new LB will be automatically created by default. For more information, see the official documentation at https://www.tencentcloud.com/document/product/457/36835.ports:web:expose:default: trueexposedPort: 80 # HTTP port number that is externally exposed. To use a standard port number in the Chinese mainland, ICP filing is required.websecure:expose:default: trueexposedPort: 443 # HTTPS port number that is externally exposed. To use a standard port number in the Chinese mainland, ICP filing is required.deployment:enabled: truereplicas: 1podAnnotations:tke.cloud.tencent.com/networks: "tke-route-eni" # When VPC-CNI and Global Router network modes are used at the same time, display a statement to indicate the ENI to be used by pods. This should be used together with the request and limit of eni-ip below.resources:requests:tke.cloud.tencent.com/eni-ip: "1"limits:tke.cloud.tencent.com/eni-ip: "1"
helm show values traefik/traefik.kubectl create ns ingresshelm upgrade --install traefik -f values-traefik.yaml traefik/traefik
$ kubectl get service -n ingressNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEtraefik LoadBalancer 172.22.252.242 49.233.239.84 80:31650/TCP,443:32288/TCP 42h
apiVersion: networking.k8s.io/v1beta1kind: Ingressmetadata:name: test-ingressannotations:kubernetes.io/ingress.class: traefik # Indicates the ingress class name.spec:rules:- host: traefik.demo.comhttp:paths:- path: /testbackend:serviceName: nginxservicePort: 80
$ kubectl apply -f ingress-route.yaml
apiVersion: traefik.containo.us/v1alpha1kind: IngressRoutemetadata:name: test-ingressroutespec:entryPoints:- webroutes:- match: Host(`traefik.demo.com`) && PathPrefix(`/test`)kind: Ruleservices:- name: nginxport: 80
フィードバック