Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

limiter: support workloadselector #288

Merged
merged 2 commits into from
Feb 10, 2023
Merged

limiter: support workloadselector #288

merged 2 commits into from
Feb 10, 2023

Conversation

MouceL
Copy link
Contributor

@MouceL MouceL commented Feb 9, 2023

support workloadSelector , the priority is workloadSelector > name.namespace

the limiter rule will dispatch to pods which has labels app: productpage, env: test in same ns with SmartLimiter.

if SmartLimiter apply to istio root ns, it will match all pods in cluster with app: productpage, env: test

apiVersion: microservice.slime.io/v1alpha2
kind: SmartLimiter
metadata:
  name: productpage
  namespace: default
spec:
  workloadSelector:
    app: productpage
    env: test  
  sets:
    _base:
      descriptor:
      - action:
          fill_interval:
            seconds: 10
          quota: "2"
          strategy: "single"
        condition: "true"
        target:
          port: 9080

@MouceL MouceL marked this pull request as draft February 9, 2023 08:44
@MouceL MouceL marked this pull request as ready for review February 10, 2023 03:23
return nil
}
queryMap[metaInfo] = []metric.Handler{}
return queryMap
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can handle different cases in separated functions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

meta := SmartLimiterMeta{}

if outbound {
meta.outbound = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why outbound do not set workloadselector?

@YonkaFang YonkaFang merged commit 70af451 into slime-io:master Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants