envoy-legacy-v2-api.yml 3.5 KB

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