added rate limits

This commit is contained in:
Clemens 2024-03-15 11:52:10 +01:00
parent 3944c28562
commit e1d43cddc5
2 changed files with 14 additions and 3 deletions

View file

@ -16,6 +16,8 @@
(s/def ::unique-name ::web/unique-name)
(s/def ::issuer ::web/issuer)
(s/def ::volume-size ::web/volume-size)
(s/def ::average-rate ::ing/average-rate)
(s/def ::burst-rate ::ing/burst-rate)
(s/def ::authtoken ::web/authtoken)
(s/def ::fqdns ::web/fqdns)
@ -51,7 +53,9 @@
(def config? (s/keys :req-un [::websiteconfigs]
:opt-un [::issuer
::volume-size
::mon-cfg]))
::mon-cfg
::average-rate
::burst-rate]))
(def auth? (s/keys :req-un [::websiteauths]
:opt-un [::mon-auth]))
@ -64,7 +68,9 @@
:build-memory-request "256Mi"
:build-memory-limit "512Mi"
:volume-size "3"
:redirects []})
:redirects []
:average-rate 50
:burst-rate 30})
(defn-spec sort-config map?
[unsorted-config config?]
@ -86,7 +92,11 @@
(when (contains? config :issuer)
{:issuer (config :issuer)})
(when (contains? config :volume-size)
{:volume-size (config :volume-size)}))))
{:volume-size (config :volume-size)})
(when (contains? config :average-rate)
{:average-rate (config :average-rate)})
(when (contains? config :burst-rate)
{:burst-rate (config :burst-rate)}))))
(defn-spec flatten-and-reduce-auth map?
[auth auth?]

View file

@ -19,3 +19,4 @@ mon-cfg:
grafana-cloud-url: "url-for-your-prom-remote-write-endpoint"
cluster-name: "website"
cluster-stage: "test"
average-rate: 50