Skip to content

Commit

Permalink
infra: RateLimit support IPv6 first cluster
Browse files Browse the repository at this point in the history
Signed-off-by: zirain <zirain2009@gmail.com>
  • Loading branch information
zirain committed Oct 31, 2024
1 parent 1a275b9 commit 8344a9a
Show file tree
Hide file tree
Showing 18 changed files with 101 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/redis/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ data:
kind: EnvoyGateway
provider:
type: Kubernetes
kubernetes:
rateLimitDeployment:
container:
# remove this line when https://github.com/envoyproxy/ratelimit/pull/748 merged
image: ghcr.io/zirain-dev/ratelimit:latest
gateway:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
extensionApis:
Expand Down
16 changes: 16 additions & 0 deletions internal/infrastructure/kubernetes/ratelimit/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8344a9a

Please sign in to comment.