Upgrade Guide
This document describes how to upgrade Flagger.
Upgrade canaries v1alpha3 to v1beta1
Canary CRD changes in canaries.flagger.app/v1beta1:
- the
spec.canaryAnalysisfield has been deprecated and replaced withspec.analysis - the
spec.analysis.intervalandspec.analysis.thresholdfields are required - the
status.lastAppliedSpecandstatus.lastPromotedSpechashing algorithm changed tohash/fnv - the
spec.analysis.alertsarray can referencealertproviders.flagger.app/v1beta1resources - the
spec.analysis.metrics[].templateRefcan reference ametrictemplate.flagger.app/v1beta1resource - the
metric.thresholdfield has been deprecated and replaced withmetric.thresholdRange - the
metric.queryfield has been deprecated and replaced withmetric.templateRef - the
spec.ingressRef.apiVersionacceptsnetworking.k8s.io/v1beta1 - the
spec.targetRefcan referenceDaemonSetkind - the
spec.service.meshNamefield has been deprecated and no longer used forprovider: appmesh:v1beta2
Upgrade procedure:
- install the
v1beta1CRDs - update Flagger deployment
- replace
apiVersion: flagger.app/v1alpha3withapiVersion: flagger.app/v1beta1in all canary manifests - replace
spec.canaryAnalysiswithspec.analysisin 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
thresholdwiththresholdRange.minfor request-success-rate - replace
thresholdwiththresholdRange.maxfor request-duration
metrics:
- name: request-success-rate
thresholdRange:
min: 99
interval: 1m
- name: request-duration
thresholdRange:
max: 500
interval: 1m
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:
apiVersion: flagger.app/v1beta1
kind: MetricTemplate
metadata:
name: latency
namespace: istio-system
spec:
provider:
type: prometheus
address: http://prometheus.istio-system:9090
query: |
histogram_quantile(
0.99,
sum(
rate(
istio_request_duration_seconds_bucket{
reporter="destination",
destination_workload_namespace="{{ namespace }}",
destination_workload=~"{{ target }}"
}[{{ interval }}]
)
) by (le)
)
In the canary manifests, replace the request-duration metric with latency:
metrics:
- name: latency
templateRef:
name: latency
namespace: istio-system
thresholdRange:
max: 0.500
interval: 1m