KubernetesNotes11:Ingress限流

KubernetesNotes11:Ingress限流

Created
Nov 22, 2021 11:08 AM
Last Edited
Last updated December 3, 2021
Tags

1. 官方文档

2. 编辑文件

root@docker01:/home# vim ingress-rule-2.yaml
apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ingress-limit-rate annotations: nginx.ingress.kubernetes.io/limit-rps: "1" spec: ingressClassName: nginx rules: - host: "haha.henggao.com" http: paths: - pathType: Exact path: "/" backend: service: name: nginx-demo port: number: 8000

3. 运行规则

root@docker01:/home# kubectl apply -f ingress-rule-2.yaml
 

4. 查看

root@docker01:/home# kubectl get ingress
notion image
 

5. 模拟域名访问

  • 模拟域名,修改windows域名和端口映射
  • 文件目录: C:\Windows\System32\drivers\etc 的hosts文件
192.168.92.138 haha.henggao.com
 

6. 访问

notion image
刷新过快,会出现如下界面
notion image