K8s 环境下使用 HostNetwork 模式部署 Envoy Gateway
185 字
1 分钟
K8s 环境下使用 HostNetwork 模式部署 Envoy Gateway
记录一下,后续完善
root@k8s-master:~/gateway/deploy# lsapp-httproute-nginx.yaml gatewayclass.yaml infra-envoyproxy.yaml infra-gateway.yamlroot@k8s-master:~/gateway/deploy# cat gatewayclass.yamlapiVersion: gateway.networking.k8s.io/v1kind: GatewayClassmetadata: name: shared-gw-classspec: controllerName: gateway.envoyproxy.io/gatewayclass-controllerroot@k8s-master:~/gateway/deploy# cat infra-envoyproxy.yamlapiVersion: gateway.envoyproxy.io/v1alpha1kind: EnvoyProxymetadata: name: shared-gw-proxy namespace: infra-gwspec: provider: type: Kubernetes kubernetes: useListenerPortAsContainerPort: true envoyService: type: ClusterIP envoyDaemonSet: patch: value: spec: template: spec: hostNetwork: true dnsPolicy: ClusterFirstWithHostNet # 添加这个容忍配置 tolerations: - key: node-role.kubernetes.io/control-plane operator: Exists effect: NoSchedule container: securityContext: runAsUser: 0 allowPrivilegeEscalation: true #image: envoyproxy/envoy:distroless-v1.36.2root@k8s-master:~/gateway/deploy# cat infra-gateway.yamlapiVersion: gateway.networking.k8s.io/v1kind: Gatewaymetadata: name: shared-gateway namespace: infra-gwspec: gatewayClassName: shared-gw-class infrastructure: parametersRef: group: gateway.envoyproxy.io kind: EnvoyProxy name: shared-gw-proxy listeners: - name: http protocol: HTTP port: 80 allowedRoutes: namespaces: from: All # 允许所有 namespace 的 Route 绑定到这个 Gatewayroot@k8s-master:~/gateway/deploy# cat app-httproute-nginx.yamlapiVersion: gateway.networking.k8s.io/v1kind: HTTPRoutemetadata: name: nginx namespace: nginx-deploy-nsspec: parentRefs: - name: shared-gateway namespace: infra-gw # 指向基础设施 ns 的共享 Gateway rules: - matches: - path: type: PathPrefix value: / backendRefs: - name: nginx-service # app-namespace 里的 nginx Service port: 80文章分享
如果这篇文章对你有帮助,欢迎分享给更多人!
K8s 环境下使用 HostNetwork 模式部署 Envoy Gateway
https://blog.nwn.moe/posts/k8s-gateway-envoy-hostnetwork/相关文章智能推荐
1
Alpine 中以二进制方式部署 EasyTier
部署介绍如何在 Alpine Linux 中以二进制方式部署 EasyTier,包括环境准备、OpenRC 开机自启配置、TUN 模式启用,以及非 root 用户运行时通过 setcap 授予 CAP_NET_ADMIN 权限解决网卡创建失败问题。
2
解决 VS Code 中 Claude Code 新版插件无法使用
技术2025-10-17
3
Nginx 通过 AutoIndex 实现目录浏览功能
技术2024-08-06
4
Docker 自建 Umami 网站流量统计工具
技术2024-07-23
5
Windows 10及11开启虚拟 WLAN
技术2024-02-23
随机文章随机推荐

