envoy-v3-api.yaml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. apiVersion: v1
  2. kind: ConfigMap
  3. metadata:
  4. name: envoy-cm-17
  5. data:
  6. envoy-yml: |-
  7. admin:
  8. access_log_path: /tmp/admin_access.log
  9. address:
  10. socket_address:
  11. protocol: TCP
  12. address: 127.0.0.1
  13. port_value: 9901
  14. static_resources:
  15. listeners:
  16. - name: listener_0
  17. address:
  18. socket_address:
  19. protocol: TCP
  20. address: 0.0.0.0
  21. port_value: 10000
  22. filter_chains:
  23. - filters:
  24. - name: envoy.filters.network.http_connection_manager
  25. typed_config:
  26. "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
  27. stat_prefix: ingress_http
  28. route_config:
  29. name: local_route
  30. virtual_hosts:
  31. - name: local_service
  32. domains: ["*"]
  33. routes:
  34. - match:
  35. prefix: "/"
  36. route:
  37. cluster: service_httpbin
  38. typed_per_filter_config:
  39. envoy.filters.http.dynamic_forward_proxy:
  40. "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_forward_proxy.v3.PerRouteConfig
  41. host_rewrite_literal: httpbin.org
  42. rate_limits:
  43. - stage: 0
  44. actions:
  45. - {destination_cluster: {}}
  46. http_filters:
  47. - name: envoy.filters.http.ratelimit
  48. typed_config:
  49. "@type": type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimit
  50. domain: foo
  51. request_type: external
  52. failure_mode_deny: false
  53. stage: 0
  54. rate_limit_service:
  55. grpc_service:
  56. envoy_grpc:
  57. cluster_name: rate_limit_cluster
  58. timeout: 2s
  59. transport_api_version: V3
  60. - name: envoy.filters.http.router
  61. typed_config:
  62. "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
  63. clusters:
  64. - name: service_httpbin
  65. connect_timeout: 0.5s
  66. type: LOGICAL_DNS
  67. # Comment out the following line to test on v6 networks
  68. dns_lookup_family: V4_ONLY
  69. lb_policy: ROUND_ROBIN
  70. load_assignment:
  71. cluster_name: service_httpbin
  72. endpoints:
  73. - lb_endpoints:
  74. - endpoint:
  75. address:
  76. socket_address:
  77. address: httpbin.org
  78. port_value: 80
  79. - name: rate_limit_cluster
  80. type: STRICT_DNS
  81. connect_timeout: 10s
  82. lb_policy: ROUND_ROBIN
  83. http2_protocol_options: {}
  84. load_assignment:
  85. cluster_name: rate_limit_cluster
  86. endpoints:
  87. - lb_endpoints:
  88. - endpoint:
  89. address:
  90. socket_address:
  91. address: sentinel-rls-service
  92. port_value: 10245
  93. ---
  94. apiVersion: apps/v1
  95. kind: Deployment
  96. metadata:
  97. name: envoy-deployment-basic-17
  98. labels:
  99. app: envoy-17
  100. spec:
  101. replicas: 1
  102. selector:
  103. matchLabels:
  104. app: envoy-17
  105. template:
  106. metadata:
  107. labels:
  108. app: envoy-17
  109. spec:
  110. containers:
  111. - name: envoy
  112. image: envoyproxy/envoy:v1.17.3
  113. ports:
  114. - containerPort: 10000
  115. command: ["envoy"]
  116. args: ["-c", "/tmp/envoy/envoy.yaml"]
  117. volumeMounts:
  118. - name: envoy-config
  119. mountPath: /tmp/envoy
  120. volumes:
  121. - name: envoy-config
  122. configMap:
  123. name: envoy-cm-17
  124. items:
  125. - key: envoy-yml
  126. path: envoy.yaml
  127. ---
  128. apiVersion: v1
  129. kind: Service
  130. metadata:
  131. name: envoy-service-17
  132. labels:
  133. name: envoy-service-17
  134. spec:
  135. type: NodePort
  136. ports:
  137. - port: 10000
  138. targetPort: 10000
  139. protocol: TCP
  140. selector:
  141. app: envoy-17