Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: fluxcd/flagger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.22.0
Choose a base ref
...
head repository: fluxcd/flagger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.22.1
Choose a head ref
  • 13 commits
  • 21 files changed
  • 7 contributors

Commits on Jul 13, 2022

  1. Update README

    Signed-off-by: Owly <59724243+ImOwly@users.noreply.github.com>
    ImOwly authored Jul 13, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1abb1f1 View commit details

Commits on Jul 20, 2022

  1. clarify HPA API requirement

    Signed-off-by: David Harris <david.harris@weave.works>
    David Harris authored Jul 20, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bab12dc View commit details

Commits on Jul 29, 2022

  1. 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>
    2 people authored and Sanskar Jaiswal committed Jul 29, 2022
    Copy the full SHA
    25a33fe View commit details
  2. fix KEDA version typo in tutorial

    Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
    Sanskar Jaiswal committed Jul 29, 2022
    Copy the full SHA
    f5c2671 View commit details
  3. Merge pull request #1241 from vidhartbhatia/fixKEDASO

    Update KEDA ScaledObject API to include MetricType for Triggers
    aryan9600 authored Jul 29, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    80bae41 View commit details
  4. fix fallback logic for HPAv2 to v2beta2

    Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
    Sanskar Jaiswal committed Jul 29, 2022
    Copy the full SHA
    a5c284c View commit details
  5. Merge pull request #1242 from aryan9600/fix-hpa-fallback

    Fix fallback logic for HPAv2 to v2beta2
    stefanprodan authored Jul 29, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d4e54fe View commit details
  6. Merge pull request #1239 from sympatheticmoose/patch-1

    Clarify HPA API requirement
    stefanprodan authored Jul 29, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d337344 View commit details
  7. Merge pull request #1233 from ImOwly/main

    Update README
    stefanprodan authored Jul 29, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    09c1eec View commit details
  8. Update Go to 1.18 and Alpine to 3.16

    Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
    stefanprodan committed Jul 29, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    stefanprodan Stefan Prodan
    Copy the full SHA
    11209fe View commit details
  9. Merge pull request #1243 from fluxcd/update-go-alpine

    Update Go to 1.18 and Alpine to 3.16
    stefanprodan authored Jul 29, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1a4d8b9 View commit details

Commits on Aug 1, 2022

  1. Release v1.22.1

    Signed-off-by: Sanskar Jaiswal <sanskar.jaiswal@weave.works>
    Sanskar Jaiswal committed Aug 1, 2022
    Copy the full SHA
    5285b76 View commit details
  2. Merge pull request #1244 from aryan9600/release-v1.22.1

    Release v1.22.1
    stefanprodan authored Aug 1, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f93708e View commit details
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x
go-version: 1.18.x
- name: Download modules
run: |
go mod download
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,29 @@

All notable changes to this project are documented in this file.

## 1.22.1

**Release date:** 2022-08-01

This minor release fixes a bug related to the use of HPA v2beta2 and updates
the KEDA ScaledObject API to include `MetricType` for `ScaleTriggers`.

Furthermore, the project has been updated to use Go 1.18 and Alpine 3.16.

#### Fixes:

- Update KEDA ScaledObject API to include MetricType for Triggers
[#1241](https://github.com/fluxcd/flagger/pull/1241)
- Fix fallback logic for HPAv2 to v2beta2
[#1242](https://github.com/fluxcd/flagger/pull/1242)

#### Improvements:
- Update Go to 1.18 and Alpine to 3.16
[#1243](https://github.com/fluxcd/flagger/pull/1243)
- Clarify HPA API requirement
[#1239](https://github.com/fluxcd/flagger/pull/1239)
- Update README
[#1233](https://github.com/fluxcd/flagger/pull/1233)

## 1.22.0

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-alpine as builder
FROM golang:1.18-alpine as builder

ARG TARGETPLATFORM
ARG REVISON
@@ -21,7 +21,7 @@ RUN CGO_ENABLED=0 go build \
-ldflags "-s -w -X github.com/fluxcd/flagger/pkg/version.REVISION=${REVISON}" \
-a -o flagger ./cmd/flagger

FROM alpine:3.15
FROM alpine:3.16

RUN apk --no-cache add ca-certificates

2 changes: 1 addition & 1 deletion Dockerfile.loadtester
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.17-alpine as builder
FROM golang:1.18-alpine as builder

ARG TARGETPLATFORM
ARG TARGETARCH
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ build:
CGO_ENABLED=0 go build -a -o ./bin/flagger ./cmd/flagger

tidy:
rm -f go.sum; go mod tidy -compat=1.17
rm -f go.sum; go mod tidy -compat=1.18

vet:
go vet ./...
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -13,10 +13,10 @@ by gradually shifting traffic to the new version while measuring metrics and run
![flagger-overview](https://raw.githubusercontent.com/fluxcd/flagger/main/docs/diagrams/flagger-overview.png)

Flagger implements several deployment strategies (Canary releases, A/B testing, Blue/Green mirroring)
and integrates with various Kubernetes ingress controllers, service mesh and monitoring solutions.
and integrates with various Kubernetes ingress controllers, service mesh, and monitoring solutions.

Flagger is a [Cloud Native Computing Foundation](https://cncf.io/) project
and part of [Flux](https://fluxcd.io) family of GitOps tools.
and part of the [Flux](https://fluxcd.io) family of GitOps tools.

### Documentation

@@ -53,11 +53,11 @@ If you are using Flagger, please [submit a PR to add your organization](https://
### Canary CRD

Flagger takes a Kubernetes deployment and optionally a horizontal pod autoscaler (HPA),
then creates a series of objects (Kubernetes deployments, ClusterIP services, service mesh or ingress routes).
then creates a series of objects (Kubernetes deployments, ClusterIP services, service mesh, or ingress routes).
These objects expose the application on the mesh and drive the canary analysis and promotion.

Flagger keeps track of ConfigMaps and Secrets referenced by a Kubernetes Deployment and triggers a canary analysis if any of those objects change.
When promoting a workload in production, both code (container images) and configuration (config maps and secrets) are being synchronised.
When promoting a workload in production, both code (container images) and configuration (config maps and secrets) are being synchronized.

For a deployment named _podinfo_, a canary promotion can be defined using Flagger's custom resource:

@@ -239,7 +239,7 @@ can be used to implement the request success rate and request duration checks.
#### Integrations
* Add support for ingress controllers like HAProxy, ALB and Apache APISIX
* Add support for ingress controllers like HAProxy, ALB, and Apache APISIX
### Contributing
@@ -260,7 +260,7 @@ If you have any questions about Flagger and progressive delivery:
* Read the Flagger [docs](https://docs.flagger.app).
* Invite yourself to the [CNCF community slack](https://slack.cncf.io/)
and join the [#flagger](https://cloud-native.slack.com/messages/flagger/) channel.
* Check out the **[Flux events calendar](https://fluxcd.io/#calendar)**, both with upcoming talks, events and meetings you can attend.
* Check out the **[Flux events calendar](https://fluxcd.io/#calendar)**, both with upcoming talks, events, and meetings you can attend.
* Or view the **[Flux resources section](https://fluxcd.io/resources)** with past events videos you can watch.
* File an [issue](https://github.com/fluxcd/flagger/issues/new).
2 changes: 1 addition & 1 deletion artifacts/flagger/deployment.yaml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ spec:
serviceAccountName: flagger
containers:
- name: flagger
image: ghcr.io/fluxcd/flagger:1.22.0
image: ghcr.io/fluxcd/flagger:1.22.1
imagePullPolicy: IfNotPresent
ports:
- name: http
4 changes: 2 additions & 2 deletions charts/flagger/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: flagger
version: 1.22.0
appVersion: 1.22.0
version: 1.22.1
appVersion: 1.22.1
kubeVersion: ">=1.19.0-0"
engine: gotpl
description: Flagger is a progressive delivery operator for Kubernetes
2 changes: 1 addition & 1 deletion charts/flagger/values.yaml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

image:
repository: ghcr.io/fluxcd/flagger
tag: 1.22.0
tag: 1.22.1
pullPolicy: IfNotPresent
pullSecret:

2 changes: 1 addition & 1 deletion docs/gitbook/dev/dev-guide.md
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ Flagger is written in Go and uses Go modules for dependency management.

On your dev machine install the following tools:

* go >= 1.17
* go >= 1.18
* git >;= 2.20
* bash >= 5.0
* make >= 3.81
2 changes: 1 addition & 1 deletion docs/gitbook/tutorials/keda-scaledobject.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ you can use any deployment strategy combined with any supported provider.

## Prerequisites

Flagger requires a Kubernetes cluster **v1.16** or newer. For this tutorial, we'll need KEDA **2.71** or newer.
Flagger requires a Kubernetes cluster **v1.16** or newer. For this tutorial, we'll need KEDA **2.7.1** or newer.

Install KEDA:

2 changes: 2 additions & 0 deletions docs/gitbook/usage/how-it-works.md
Original file line number Diff line number Diff line change
@@ -120,6 +120,8 @@ in the primary autoscaler when a rollout for the deployment starts and completes
Optionally, you can create two HPAs, one for canary and one for the primary to update the HPA without
doing a new rollout. As the canary deployment will be scaled to 0, the HPA on the canary will be inactive.

**Note** Flagger requires `autoscaling/v2` or `autoscaling/v2beta2` API version for HPAs.

The progress deadline represents the maximum time in seconds for the canary deployment to
make progress before it is rolled back, defaults to ten minutes.

9 changes: 4 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/fluxcd/flagger

go 1.17
go 1.18

require (
cloud.google.com/go/monitoring v1.5.0
@@ -27,7 +27,7 @@ require (
)

// Fix CVE-2022-28948
replace gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.0
replace gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.1

require (
cloud.google.com/go/compute v1.6.1 // indirect
@@ -68,15 +68,14 @@ require (
go.opencensus.io v0.23.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717 // indirect
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
golang.org/x/tools v0.1.11 // indirect
google.golang.org/appengine v1.6.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -466,8 +466,9 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o=
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -703,8 +704,9 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717 h1:hI3jKY4Hpf63ns040onEbB3dAkR/H/P83hw1TG8dD3Y=
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
golang.org/x/tools v0.1.11 h1:loJ25fNOEhSXfHrpoGj91eCUThwdNX6u24rO1xnNteY=
golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -906,8 +908,8 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
2 changes: 1 addition & 1 deletion kustomize/base/flagger/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -9,4 +9,4 @@ resources:
images:
- name: ghcr.io/fluxcd/flagger
newName: ghcr.io/fluxcd/flagger
newTag: 1.22.0
newTag: 1.22.1
4 changes: 3 additions & 1 deletion pkg/apis/keda/v1alpha1/scaledobject.go
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ type ScaleTriggers struct {
// +optional
AuthenticationRef *ScaledObjectAuthRef `json:"authenticationRef,omitempty"`
// +optional
FallbackReplicas *int32 `json:"fallback,omitempty"`
MetricType autoscalingv2beta2.MetricTargetType `json:"metricType,omitempty"`
}

// +k8s:openapi-gen=true
@@ -151,6 +151,8 @@ type ScaledObjectStatus struct {
Conditions Conditions `json:"conditions,omitempty"`
// +optional
Health map[string]HealthStatus `json:"health,omitempty"`
// +optional
PausedReplicaCount *int32 `json:"pausedReplicaCount,omitempty"`
}

// +kubebuilder:object:root=true
10 changes: 5 additions & 5 deletions pkg/apis/keda/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/canary/hpa_reconciler.go
Original file line number Diff line number Diff line change
@@ -38,7 +38,8 @@ func (hr *HPAReconciler) reconcilePrimaryHpa(cd *flaggerv1.Canary, init bool) er
var betaHpa *hpav2beta2.HorizontalPodAutoscaler
hpa, err := hr.kubeClient.AutoscalingV2().HorizontalPodAutoscalers(cd.Namespace).Get(context.TODO(), cd.Spec.AutoscalerRef.Name, metav1.GetOptions{})
if err != nil {
hr.logger.Debugf("v2 HorizontalPodAutoscaler %s.%s get query error: %w; falling back to v2beta2",
hpa = nil
hr.logger.Debugf("v2 HorizontalPodAutoscaler %s.%s get query error: %s; falling back to v2beta2",
cd.Namespace, cd.Spec.AutoscalerRef.Name, err)
var betaErr error
betaHpa, betaErr = hr.kubeClient.AutoscalingV2beta2().HorizontalPodAutoscalers(cd.Namespace).Get(context.TODO(), cd.Spec.AutoscalerRef.Name, metav1.GetOptions{})
3 changes: 2 additions & 1 deletion pkg/canary/scaler_reconciler_fixture_test.go
Original file line number Diff line number Diff line change
@@ -164,7 +164,8 @@ func newScaledObject() *keda.ScaledObject {
MaxReplicaCount: int32p(4),
Triggers: []keda.ScaleTriggers{
{
Type: "prometheus",
Type: "prometheus",
MetricType: "AverageValue",
Metadata: map[string]string{
"serverAddress": "http://flagger-prometheus.projectcontour:9090",
"metricName": "http_requests_total",
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
@@ -16,5 +16,5 @@ limitations under the License.

package version

var VERSION = "1.22.0"
var VERSION = "1.22.1"
var REVISION = "unknown"
1 change: 1 addition & 0 deletions test/keda/test-scaledobject.sh
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ spec:
maxReplicaCount: 3
triggers:
- type: prometheus
metricType: AverageValue
metadata:
serverAddress: http://flagger-prometheus.flagger-system:9090
metricName: http_requests_total