zufardhiyaulhaq / istio-ratelimit-operator

Automatically create global & local rate limit in Istio, support EnvoyFilter versioning, ratelimit metrics, shadow mode, and ratelimit based on route!
MIT License
39 stars 9 forks source link

Configurable RateLimitService image and tag #19

Closed deferraz closed 2 years ago

deferraz commented 2 years ago

Summary

This PR includes two new properties for RateLimitService Spec inside Kubernetes object Image and ImageTag, this is necessary if we need to adjust the image of the RateLimitService that will be deployed by the RateLimitController

Type of Change

This PR fixes/implements the following bugs/features:

Test

ratelimitservice manifest file:

---
apiVersion: ratelimit.zufardhiyaulhaq.com/v1alpha1
kind: RateLimitService
metadata:
  name: istio-test-ratelimit-service
  namespace: istio-system
spec:
  kubernetes:
    image: envoyproxy/ratelimit
    imageTag: 7b60ac79
    replica_count: 2
    auto_scaling:
      max_replicas: 3
      min_replicas: 2
    resources:
      limits:
        cpu: "256m"
        memory: "256Mi"
      requests:
        cpu: "128m"
        memory: "128Mi"
  backend:
    redis:
      type: "single"
      url: "redis.istio-system.svc.cluster.local:6379"

After applying the RatelimitService/GlobalRatelimitConfig/GlobalRatelimit the deployment of the service: Screen Shot 2022-09-06 at 11 52 40 AM

Closes #15

zufardhiyaulhaq commented 2 years ago

I think rather than adding it to the CRDs, can we add that to the operator environment variable? cc @deferraz it's more clear and simple.

deferraz commented 2 years ago

I think rather than adding it to the CRDs, can we add that to the operator environment variable? cc @deferraz it's more clear and simple.

Hi @zufardhiyaulhaq! Sure we can, what's your idea? Maybe I can try to implement it, can you elaborate more on your idea? My reasoning behind including inside the RatelimitService was to be flexible enough if you want to try the same set of rate rules but with different releases of the Ratelimit GRPC project

zufardhiyaulhaq commented 2 years ago

make sense @deferraz , let me merge this and fix several things on master.