Flagger
Search…
Upgrade Guide
This document describes how to upgrade Flagger.

Upgrade canaries v1alpha3 to v1beta1

Canary CRD changes in canaries.flagger.app/v1beta1:
  • the spec.canaryAnalysis field has been deprecated and replaced with spec.analysis
  • the spec.analysis.interval and spec.analysis.threshold fields are required
  • the status.lastAppliedSpec and status.lastPromotedSpec hashing algorithm changed to hash/fnv
  • the spec.analysis.alerts array can reference alertproviders.flagger.app/v1beta1 resources
  • the spec.analysis.metrics[].templateRef can reference a metrictemplate.flagger.app/v1beta1 resource
  • the metric.threshold field has been deprecated and replaced with metric.thresholdRange
  • the metric.query field has been deprecated and replaced with metric.templateRef
  • the spec.ingressRef.apiVersion accepts networking.k8s.io/v1beta1
  • the spec.targetRef can reference DaemonSet kind
  • the spec.service.meshName field has been deprecated and no longer used for provider: appmesh:v1beta2
Upgrade procedure:
  • install the v1beta1 CRDs
  • update Flagger deployment
  • replace apiVersion: flagger.app/v1alpha3 with apiVersion: flagger.app/v1beta1 in all canary manifests
  • replace spec.canaryAnalysis with spec.analysis in all canary manifests
  • update canary manifests in cluster
Note that after upgrading Flagger, all canaries will be triggered as the hash value used for tracking changes is computed differently. You can set spec.skipAnalysis: true in all canary manifests before upgrading Flagger, do the upgrade, wait for Flagger to finish the no-op promotions and finally set skipAnalysis to false.
Update builtin metrics:
  • replace threshold with thresholdRange.min for request-success-rate
  • replace threshold with thresholdRange.max for request-duration
1
metrics:
2
- name: request-success-rate
3
thresholdRange:
4
min: 99
5
interval: 1m
6
- name: request-duration
7
thresholdRange:
8
max: 500
9
interval: 1m
Copied!

Istio telemetry v2

Istio 1.5 comes with a breaking change for Flagger uses. In Istio telemetry v2 the metric istio_request_duration_seconds_bucket has been removed and replaced with istio_request_duration_milliseconds_bucket and this breaks the request-duration metric check.
If are using Istio 1.4, you can create a metric template using the old duration metric like this:
1
apiVersion: flagger.app/v1beta1
2
kind: MetricTemplate
3
metadata:
4
name: latency
5
namespace: istio-system
6
spec:
7
provider:
8
type: prometheus
9
address: http://prometheus.istio-system:9090
10
query: |
11
histogram_quantile(
12
0.99,
13
sum(
14
rate(
15
istio_request_duration_seconds_bucket{
16
reporter="destination",
17
destination_workload_namespace="{{ namespace }}",
18
destination_workload=~"{{ target }}"
19
}[{{ interval }}]
20
)
21
) by (le)
22
)
Copied!
In the canary manifests, replace the request-duration metric with latency:
1
metrics:
2
- name: latency
3
templateRef:
4
name: latency
5
namespace: istio-system
6
thresholdRange:
7
max: 0.500
8
interval: 1m
Copied!
Last modified 9mo ago