diff --git a/examples/redis/redis.yaml b/examples/redis/redis.yaml index cee4a37c559..98d1c20902b 100644 --- a/examples/redis/redis.yaml +++ b/examples/redis/redis.yaml @@ -60,6 +60,10 @@ data: kind: EnvoyGateway provider: type: Kubernetes + kubernetes: + rateLimitDeployment: + container: + image: ghcr.io/zirain-dev/ratelimit:latest # remove this line when upstream PR merged gateway: controllerName: gateway.envoyproxy.io/gatewayclass-controller extensionApis: diff --git a/internal/infrastructure/kubernetes/ratelimit/resource.go b/internal/infrastructure/kubernetes/ratelimit/resource.go index 4785a700d40..0d35196d629 100644 --- a/internal/infrastructure/kubernetes/ratelimit/resource.go +++ b/internal/infrastructure/kubernetes/ratelimit/resource.go @@ -277,6 +277,22 @@ func expectedRateLimitContainerEnv(rateLimit *egv1a1.RateLimit, rateLimitDeploym namespace string, ) []corev1.EnvVar { env := []corev1.EnvVar{ + { + Name: "PROTO", + Value: "tcp6", + }, + { + Name: "HOST", + Value: "", + }, + { + Name: "DEBUG_HOST", + Value: "", + }, + { + Name: "GRPC_HOST", + Value: "", + }, { Name: RuntimeRootEnvVar, Value: "/data", diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/custom.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/custom.yaml index 0c1be549e83..fc06ce0e6ba 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/custom.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/custom.yaml @@ -41,6 +41,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/default-env.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/default-env.yaml index 0c1be549e83..fc06ce0e6ba 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/default-env.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/default-env.yaml @@ -41,6 +41,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/default.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/default.yaml index 32e56a1ea5c..b4de59b7fc5 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/default.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/default.yaml @@ -40,6 +40,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/disable-prometheus.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/disable-prometheus.yaml index 449ed2c1d70..0295426a38d 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/disable-prometheus.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/disable-prometheus.yaml @@ -36,6 +36,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/enable-tracing-custom.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/enable-tracing-custom.yaml index 320497017f7..00bac21b020 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/enable-tracing-custom.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/enable-tracing-custom.yaml @@ -40,6 +40,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/enable-tracing.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/enable-tracing.yaml index 5b01b9ef319..8610989b103 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/enable-tracing.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/enable-tracing.yaml @@ -40,6 +40,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/extension-env.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/extension-env.yaml index 65c68972f9d..290e9f656ab 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/extension-env.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/extension-env.yaml @@ -41,6 +41,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/merge-annotations.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/merge-annotations.yaml index 4bc241198c6..7ae57f84ab9 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/merge-annotations.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/merge-annotations.yaml @@ -42,6 +42,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/merge-labels.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/merge-labels.yaml index 6681232eeb8..e8d5445a482 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/merge-labels.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/merge-labels.yaml @@ -42,6 +42,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/override-env.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/override-env.yaml index 0c0f73f3c83..915e44b0893 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/override-env.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/override-env.yaml @@ -41,6 +41,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/patch-deployment.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/patch-deployment.yaml index 773607b225a..ecca9ce7c69 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/patch-deployment.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/patch-deployment.yaml @@ -40,6 +40,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/redis-tls-settings.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/redis-tls-settings.yaml index 29428fc447b..a5406052825 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/redis-tls-settings.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/redis-tls-settings.yaml @@ -41,6 +41,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/tolerations.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/tolerations.yaml index a2478222625..41ac3eef2ca 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/tolerations.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/tolerations.yaml @@ -41,6 +41,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/volumes.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/volumes.yaml index 30d8852d642..be42c7e0f8d 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/volumes.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/volumes.yaml @@ -41,6 +41,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/with-node-selector.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/with-node-selector.yaml index 9cf4e01fbff..046ad33ea36 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/with-node-selector.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/with-node-selector.yaml @@ -40,6 +40,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY diff --git a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/with-topology-spread-constraints.yaml b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/with-topology-spread-constraints.yaml index 5625daf61a0..74eb16a010c 100644 --- a/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/with-topology-spread-constraints.yaml +++ b/internal/infrastructure/kubernetes/ratelimit/testdata/deployments/with-topology-spread-constraints.yaml @@ -40,6 +40,11 @@ spec: - command: - /bin/ratelimit env: + - name: PROTO + value: tcp6 + - name: HOST + - name: DEBUG_HOST + - name: GRPC_HOST - name: RUNTIME_ROOT value: /data - name: RUNTIME_SUBDIRECTORY