I want my kubedownscaler to downscale particular stateful set. Below is the config map i'm using.
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-downscaler
data:
DEFAULT_DOWNTIME: "Sat-Sun 00:00-06:30 Asia/Kolkata,Mon-Fri 15:33-15:43 Asia/Kolkata"
INCLUDE_RESOURCES: "deployments,horizontalpodautoscalers,statefulsets"
EXCLUDE_NAMESPACES: "kube-system, kube-downscaler, cert-manager, default, monitoring, operator, dev"
Here is it possible to add 3or4 statefulset
Or can I use just use one namespace like this <INCLUDE_NAMESPACES: "test">
I tried this, but I was out of luck.
I think you are referring to the Kube-Downscaler open source project here: https://codeberg.org/hjacobs/kube-downscaler
I see that you already have some resources targeted to be downscaled so we won't touch them. Instead we will create a second deployment of the Kube Downscaler and we will call it
kube-downscaler-second
done that, remove the namespace we are going to target from the rule of the first kube-downscaler. Then, in order to target only the StatefulSets present in the "test-namespace", you need to give only that namespace as a target. You can do something like that using this regex inside the
EXCLUDE_NAMESPACES
environment variable of the ConfigMap.If you have additional statefulsets inside that namespace that you don't want to scale down you can insert them inside the
EXCLUDE_DEPLOYMENTS
environment variable (that despite its name, it works for every type of resource)Your config map should look like something like this:
This should work, let me know!