当前位置:网站首页>New generation agent weapon - traefik
New generation agent weapon - traefik
2022-04-22 19:49:00 【CylonChau】
traefik Introduce
traefik- Modern reverse agent , It can also be called modern edge routing ;traefik Soundtrack compatible with mainstream clusters ,Kubernetes,Docker,AWS etc. . Official positioning traefik It is a function that allows developers to spend their time on system development and deployment , Not configuration and maintenance . also traefik Officials also provide their own service grid solutions
As a modern edge router ,traefik Have and envoy Similar characteristics
- be based on go Language development , The purpose is to simplify the configuration and maintenance of developers
- tcp/udp Support
- http L7 Support
- GRPC Support
- Service discovery and dynamic configuration
- front/ edge prory Support
- Observability
- Traffic management
- …
traefik The term
To understand trafik, First of all, we need to understand of trafik Some terms in .
- EntryPoints entry point , Is a named network location that can be connected by downstream clients , Be similar to envoy Of listener and nginx Of listen
- services service , Load balancing , The upstream host receives from traefik Connect and request and return a response . Be similar to nginx upstream envoy Of clusters
- Providers Provider , Provides the backend of the configuration file , Such as file ,consul,redis,etcd etc. , Can make traefik Auto update
- routers Router , Analysis request , Transfer the request processing of the downstream host to services
- middlewares: middleware , Transfer the request of the downstream host to services Flow adjustment at
traefik Deployment installation
traefik by go Language development , You can download and run it directly . Here is how to run binary programs directly
Back end environment preparation , Here is docker Two back ends running .
version: '3'
services:
webserver1:
image: sealloong/envoy-end:latest
ports:
- 91:90
networks:
envoymesh:
aliases:
- v1_server
- default_server
environment:
- VERSION=v1
- COLORFUL=blue
expose:
- 90
webserver2:
image: sealloong/envoy-end:latest
ports:
- 92:90
networks:
envoymesh:
aliases:
- v1_server
- default_server
environment:
- VERSION=v1
- COLORFUL=blue
expose:
- 90
networks:
envoymesh: {
}
traefik Configuration instructions
Traefik The configuration in can reference two different contents :
- Fully dynamic routing configuration ( Dynamic configuration )
- Configure at startup ( Static configuration )
Static configuration is generally defined traefik Of endpoints And providers, These don't change very often
General definition of dynamic configuration traefik The part that handles browsing , Such as middleware , route , Browse management, etc .
- traefik1 And traefik2 Your configuration file is not compatible
The configuration here is mainly based on file How to explain .
Static configuration part :
entryPoints:
web:
address: :8081
[api]
dashboard = true
insecure = true
providers:
file:
filename: ./root.yaml
[accessLog]
filePath = "/root/access.log"
format = "json"
Dynamic configuration part
http:
routers:
router0:
rule: "Host(`test.com`)"
service: "service-foo"
entryPoints:
- web
router1:
rule: "Path(`/`)"
service: "baidu"
entryPoints:
- web
services:
service-foo:
loadBalancer:
servers:
- url: "http://10.0.0.4:91/"
- url: "http://10.0.0.4:92/"
baidu:
loadBalancer:
servers:
- url: http://www.baidu.com/


版权声明
本文为[CylonChau]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204221946338415.html
边栏推荐
猜你喜欢

Software testing industry must see, a text of 800 words to teach you how to build the allure test report environment

The available space of SQL server is too large. Recycle the unused space

树的那些破事~模板小结

DNS资源记录详解&权威|递归解析区别(超细致)

Speak through object prototype. toString. call()

微日记:那些看起来并不起眼的细节体验

【八股文】JUC的使用场景及特点

Talking about time series database market

【H5】微信端H5页面制作

EasyCVR流媒体内核无法启动是什么原因?
随机推荐
Recursive data query of tree structure in a table in SQL Server
[leetcode daily question] rotation function
无法登录远程MySQL服务器 1045错误
Internet News: Lenovo announced the new progress of ESG; Excellent sound and painting of Jimi h3s and z6x Pro were highly praised; Little red book responded to "layoffs of 20%"
2022年中国数字科技专题分析
DNS资源记录详解&权威|递归解析区别(超细致)
代码中的位运算
sql语句之根据起始结束日期获取每一天、周、月、年
2-way can / can FD data recording diagnostic instrument solves the difficulty of accidental errors for enterprises
一百多天,0基础自学转行软件测试,从月薪3000到15k,我整理的超全学习指南
Deux mécanismes de désactivation de la vérification des messages courts et leurs différences
10.4.4 experiment of 8 LED "running lights" in 51 single chip microcomputer control system
[eight part essay] thread safety
5篇关于强化学习在金融领域中应用的论文推荐
听不懂梗怎么办?谷歌5400亿参数新模型可以给你解释笑点,还能通过emoji表情猜电影
【自动化测试基础知识】自动化测试的基本概念及常用框架
SqlServer判断表中某列是否包含中文,英文,纯数字
怎么才能申购新股呢?申购新股安全吗?
C#开发OPC客户端
【实习总结】