everpeace / kube-throttler

throttling your pods in kubernetes cluster.
Apache License 2.0
32 stars 6 forks source link

support OR-ed selector, namespaceSelector support in ClusterThrottle #6

Closed everpeace closed 5 years ago

everpeace commented 5 years ago

This supports OR-ed label selector such that

keyX==valX OR keyY==valY

These are yaml example

# Throttle(it can select pods in the same namespace)
apiVersion: schedule.k8s.everpeace.github.com/v1alpha1
kind: Throttle
metadata:
  name: foo
spec:
  throttlerName: kube-throttler
  selector:
    selectorTerms:
    - podSelector:
        matchLabels:
          throttle: t1
..

# ClusterThrottle(it can select pods across multiple namespaces)
apiVersion: schedule.k8s.everpeace.github.com/v1alpha1
kind: ClusterThrottle
metadata:
  name: foo
spec:
  throttlerName: kube-throttler
  selector:
    selectorTerms:
    - namespaceSelector:
        matchLabels:
          throttle: 'true'
      podSelector:
        matchLabels:
          throttle: t1
...