trafik-ingress-controller
Traefik部署篇
1、helm安装traefik
1 2 3 4 5 6 7 8
| helm repo add traefik https://traefik.github.io/charts
helm repo update
helm fetch traefik traefik/traefik
tar xf traefik-25.0.0.tgz
|
2、自定义value值部署traefik
本地部署的kubernetes集群没有云厂商的loadBalancer,需要借助于k8s集群节点的端口去映射traefik的web端口
- 端口部分修改(基于hostNetwork: true的情况修改)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| ports: traefik: port: 9000 expose: true exposedPort: 9000 protocol: TCP web: port: 80 expose: true exposedPort: 80 protocol: TCP websecure: port: 443 expose: true exposedPort: 443 protocol: TCP http3: enabled: false tls: enabled: true options: "" certResolver: "" domains: [] middlewares: [] metrics: port: 9600 expose: false exposedPort: 9600 protocol: TCP
|
- 端口绑定的安全机制(需要用到80和443端口,1024以下的端口只允许root用户使用)
1 2 3 4 5 6 7 8
| securityContext: capabilities: drop: [ALL] add: [NET_BIND_SERVICE] readOnlyRootFilesystem: true runAsGroup: 0 runAsNonRoot: false runAsUser: 0
|
3、使用自定的values.yaml文件进行部署
1
| helm install -f values.yaml traefik traefik/traefik
|