131 Commits

Author SHA1 Message Date
Aurel Canciu
5d3ab056f0 Support for overriding primary scaler replicas
Adding support for overriding the primary scaler replica count via
.spec.autoscalerRef.primaryScalerReplicas, a feature which would enable
users to define a different scaling configurations for the primary.

This can be useful in the situation where the user does not want to
scale the canary workload to the exact same size as the primary,
especially when opting for a canary deployment pattern where only a
small portion of traffic is routed to the canary workload pods.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2023-01-16 18:47:14 +01:00
Sanskar Jaiswal
3418488902 update Go to 1.19
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2022-10-12 12:40:15 +05:30
Andy Librian
8b1155123d use min replicas set by autoscaler in ScaleFromZero if autoscaler is specified
Without this, the canary replicas are updated twice:
to 1 replica then after a few seconds to the value of HPA minReplicas.

In some cases, when updated to 1 replica (before updated by HPA
controller to the minReplicas), it's considered ready: 1 of 1 (readyThreshold 100%),
and the canary weight is advanced to receive traffic with less capacity
than expected.

Co-Authored-By: Joshua Gibeon <joshuagibeon7719@gmail.com>
Co-authored-by: Sanskar Jaiswal <hey@aryan.lol>

Signed-off-by: Andy Librian <andylibrian@gmail.com>
2022-08-18 13:23:46 +07:00
Sanskar Jaiswal
a5c284cabb fix fallback logic for HPAv2 to v2beta2
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-07-29 16:33:30 +05:30
Vidhart Bhatia
25a33fe58f Update ScaledObject API to KEDA 2.7.1
Signed-off-by: Vidhart Bhatia <vidhartbhatia@hotmail.com>
Co-authored-by: Sanskar Jaiswal <sanskar.jaiswal@weave.worksl>
2022-07-29 14:50:29 +05:30
Sanskar Jaiswal
b108672fad use a better query to test primary scaledobject reconciliation
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-07-01 09:43:46 +05:30
Sanskar Jaiswal
a098d04d64 update primary scaler query handling to consider mutliple triggers
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-06-30 17:06:45 +05:30
Sanskar Jaiswal
6a1b765a77 add unit tests for ScaledObjectReconciler
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-06-09 21:38:10 +05:30
Sanskar Jaiswal
b2dc762937 add support for KEDA ScaledObjects via ScaledObjectReconciler
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-06-09 21:36:57 +05:30
Sanskar Jaiswal
9d8941176b fix primary hpa label reconciliation
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-06-09 20:30:53 +05:30
Sanskar Jaiswal
e0e2d5c0e6 refactor hpa reconcile logic to be generic for both versions
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>

for objectmeta as well
2022-06-08 12:25:35 +05:30
Sanskar Jaiswal
f23be1d0ec add unit tests for hpa reconciler
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-06-07 13:43:11 +05:30
Sanskar Jaiswal
fa595e160c add ScalerReconciler to canary and refactor hpa out of deployment controller
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-06-07 13:43:11 +05:30
Sanskar Jaiswal
7df1beef85 Add flag to disable cross namespace refs to AlertProviders and MetricTemplates
Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-04-27 17:09:07 +05:30
Sanskar Jaiswal
c7c0c76bd3 fix canary rollback behaviour
Prevents the canary from getting triggered, when a canary deploy is
updated to match the primary deploy after an analysis fails.

Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
2022-04-15 13:49:05 +05:30
Stefan Prodan
67a2cd6a48 Merge pull request #1139 from cdlliuy/ying_short_metric_analysis_waiting_promption
shorten the metric analysis cycle after confirm promotion gate is open
2022-03-18 11:34:21 +02:00
Ying Liu
ab84ac207a shorten the metric analysis cycle after confirmpromption gate is open and make the analysis check still works during waitingpromption status
Signed-off-by: Ying Liu <ying.liu.lying@gmail.com>
2022-03-17 10:32:01 +08:00
Stefan Prodan
210e21176b Merge pull request #1138 from fluxcd/release-1.19.0
Release v1.19.0
2022-03-14 14:47:33 +02:00
Stefan Prodan
0a0c3835d6 Release v1.19.0
This release comes with support for Kubernetes Gateway API v1alpha2.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-14 12:09:01 +02:00
Moscagus
f7fd6cce8c If HPA isn't set and replicas are not specified, it uses the primary replicas when scaling up the canary
Signed-off-by: Moscagus <gustavo.varisco@gmail.com>
2022-03-09 22:16:47 -03:00
Somtochi Onyekwere
085639bbde Set primary deployment replicas when autoscaler isn't used
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-14 10:54:24 +01:00
Somtochi Onyekwere
215c859619 add field for configuring canary threshold
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-08 13:52:28 +01:00
Stefan Prodan
7071d42152 Merge pull request #1100 from SomtochiAma/topology-spread
Update matchLabels for TopologySpreadContstraints in Deployments
2022-02-07 15:13:52 +02:00
Somtochi Onyekwere
08b1e52278 Add extra check for name
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-07 13:00:43 +01:00
Somtochi Onyekwere
fe7615afb4 Update matchLabels in LabelSelectors
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2022-02-07 11:30:21 +01:00
Karl Heins
121eb767cb Update metadata during subsequent promote
Signed-off-by: Karl Heins <karlheins@northwesternmutual.com>

Support updating primary Deployment/DaemonSet/HPA/Service labels and annotations after first-time rollout
2022-01-24 14:41:24 -06:00
Stefan Prodan
30ab182b2e Merge pull request #1052 from zeot/append-ownerreferences-configmaps-and-secrets
Append to list of ownerReferences for primary configmaps and secrets
2021-11-18 10:51:36 +02:00
Zacharias Taubert
50800857b6 Append to list of ownerReferences for cm and secrets
If a "primary" ConfigMap or Secret already exists, keep the list of
ownerReferences and append the updating Canary as ownerReference if it's
not already in the list. This will prevent the GC from deleting primary
ConfigMaps and Secrets used by multiple primary deployments when one is
deleted.

Signed-off-by: Zacharias Taubert <zacharias.taubert@gmail.com>
2021-11-14 23:30:30 +01:00
Mahdi Dibaiee
8f50521435 [feat] primaryReadyThreshold: allow configuring threshold for primary
see #639

Signed-off-by: Mahdi Dibaiee <mdibaiee@pm.me>
2021-11-11 14:44:52 +00:00
Stefan Prodan
36584826bb Merge pull request #1022 from menglingwei/main
Fix tyops in code comments
2021-10-26 12:52:29 +03:00
xiaobing.meng
fb621ec465 fix comments
Signed-off-by: xiaobing.meng <xiaobing.meng@alibaba-inc.com>
2021-09-26 15:14:47 +08:00
Somtochi Onyekwere
00e993c686 Add test for fieldIsMandatory
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-09-20 23:17:27 +01:00
kyanagimoto
873b74561c fix: 🐛 trigger unexpected canary deployment.
https://github.com/fluxcd/flagger/issues/989

Signed-off-by: kyanagimoto <koichiyanagimoto@gmail.com>
2021-09-01 19:17:17 +09:00
Stefan Prodan
e6b5ee2042 Merge pull request #958 from GregoryVds/fix-typo
pkg:canary: fix typos in logs
2021-07-26 18:37:20 +03:00
Mike Ball
4cc2ada2a2 correct spelling of 'Secrets' in code comments
Signed-off-by: Mike Ball <mike.ball@warnermedia.com>
2021-07-23 06:54:26 -04:00
Gregory Vander Schueren
a5d3e4f6a6 pkg:canary: fix typos in logs
Signed-off-by: Gregory Vander Schueren <gregory.vanderschueren@sortlist.com>
2021-07-21 15:44:56 +02:00
Stefan Prodan
c36a13ccff Remove the GitOps Toolkit metadata from generated objects
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-17 17:49:22 +03:00
Stefan Prodan
cc673159d7 Remove Flux GC markers from generated objects
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-06-15 17:45:33 +03:00
kazukousen
b26b49fac2 add unit tests
Signed-off-by: kazukousen <mmchari.0228@gmail.com>
2021-05-25 23:21:34 +09:00
kazukousen
17557dc206 fixed ConfigTracker to be able to scan envFrom in init-containers
Signed-off-by: kazukousen <mmchari.0228@gmail.com>
2021-05-24 14:09:04 +09:00
Olivier Michaelis
d7b878f980 style: rename CanaryWaitingPromotion to CanaryPhaseWaitingPromotion
Renames the CanaryPhase to be more consistent with the existing phases.

Signed-off-by: Olivier Michaelis <38879457+oliviermichaelis@users.noreply.github.com>
2021-05-01 00:21:13 +02:00
Jason Blackburn
f0bf5219d4 added WaitingPromotion phase and only generate one alert when transitioning into the phase
Signed-off-by: Jason Blackburn <jason.blackburn@outlook.com>
2021-03-19 08:04:18 -05:00
Marcus Rodan
8cb147920b Adds suffix for spread constraints
Added unit test assertions

Changed comment

Signed-off-by: Marcus Rodan <marcus.rodan@sinch.com>
2021-02-08 19:47:58 +01:00
Stefan Prodan
5cb343d89f Merge pull request #799 from Nerja/main
Check if mandatory secrets/configmaps exist
2021-02-04 18:32:26 +02:00
Marcus Rodan
349d781085 Fixed antiaffinity suffixing
Signed-off-by: Marcus Rodan <marcus.rodan@sinch.com>
2021-02-04 17:02:40 +01:00
Marcus Rodan
565b99e210 Added check for optional
Signed-off-by: Marcus Rodan <marcus.rodan@sinch.com>
2021-02-02 09:56:14 +01:00
Marcus Rodan
56c77085bf Added checks for API server errors
Signed-off-by: Marcus Rodan <marcus.rodan@sinch.com>
2021-02-01 17:36:47 +01:00
Marcus Rodan
f2beab1fdc Moved implementation
Signed-off-by: Marcus Rodan <marcus.rodan@sinch.com>
2021-01-26 19:27:50 +01:00
Marcus Rodan
85af1abb26 Added suffix -primary to antiaffinity values
Signed-off-by: Marcus Rodan <marcus.rodan@sinch.com>
2021-01-26 19:27:50 +01:00
Stefan Prodan
cd75c5fa25 Copyright Flux authors
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2020-12-21 19:44:52 +02:00