<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Flux – Dev</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flagger/dev/</link><description>Recent content in Dev on Flux</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://deploy-preview-2413--fluxcd.netlify.app/flagger/dev/index.xml" rel="self" type="application/rss+xml"/><item><title>Flagger: Development Guide</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flagger/dev/dev-guide/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2413--fluxcd.netlify.app/flagger/dev/dev-guide/</guid><description>
&lt;p>This document describes how to build, test and run Flagger from source.&lt;/p>
&lt;h2 id="setup-dev-environment">Setup dev environment&lt;/h2>
&lt;p>Flagger is written in Go and uses Go modules for dependency management.&lt;/p>
&lt;p>On your dev machine install the following tools:&lt;/p>
&lt;ul>
&lt;li>go &amp;gt;= 1.18&lt;/li>
&lt;li>git &amp;gt;;= 2.20&lt;/li>
&lt;li>bash &amp;gt;= 5.0&lt;/li>
&lt;li>make &amp;gt;= 3.81&lt;/li>
&lt;li>kubectl &amp;gt;= 1.22&lt;/li>
&lt;li>kustomize &amp;gt;= 4.4&lt;/li>
&lt;li>helm &amp;gt;= 3.0&lt;/li>
&lt;li>docker &amp;gt;= 19.03&lt;/li>
&lt;/ul>
&lt;p>You&amp;rsquo;ll also need a Kubernetes cluster for testing Flagger.
You can use Minikube, Kind, Docker desktop or any remote cluster (AKS/EKS/GKE/etc) Kubernetes version 1.22 or newer.&lt;/p>
&lt;p>To start contributing to Flagger, fork the
&lt;a href="https://github.com/fluxcd/flagger" target="_blank">repository&lt;/a> on GitHub.&lt;/p>
&lt;p>Create a dir inside your &lt;code>GOPATH&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>mkdir -p &lt;span style="color:#bb60d5">$GOPATH&lt;/span>/src/github.com/fluxcd
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Clone your fork:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#007020">cd&lt;/span> &lt;span style="color:#bb60d5">$GOPATH&lt;/span>/src/github.com/fluxcd
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>git clone https://github.com/YOUR_USERNAME/flagger
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#007020">cd&lt;/span> flagger
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Set Flagger repository as upstream:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>git remote add upstream https://github.com/fluxcd/flagger.git
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Sync your fork regularly to keep it up-to-date with upstream:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>git fetch upstream
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>git checkout main
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>git merge upstream/main
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="build">Build&lt;/h2>
&lt;p>Download Go modules:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>go mod download
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Build Flagger binary:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make build
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Build load tester binary:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make loadtester-build
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="code-changes">Code changes&lt;/h2>
&lt;p>We require all commits to be signed. By signing off with your signature, you
certify that you wrote the patch or otherwise have the right to contribute the
material by the rules of the
&lt;a href="https://raw.githubusercontent.com/fluxcd/flagger/main/DCO" target="_blank">DCO&lt;/a>.&lt;/p>
&lt;p>If your &lt;code>user.name&lt;/code> and &lt;code>user.email&lt;/code> are configured in your Git config,
you can sign your commit automatically with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>git commit -s
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Before submitting a PR, make sure your changes are covered by unit tests.&lt;/p>
&lt;p>If you made changes to &lt;code>go.mod&lt;/code> run:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>go mod tidy
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>If you made changes to &lt;code>pkg/apis&lt;/code> regenerate Kubernetes client sets with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make codegen
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Run code formatters:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>go install golang.org/x/tools/cmd/goimports@latest
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>make fmt
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Run unit tests:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make &lt;span style="color:#007020">test&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="api-changes">API changes&lt;/h2>
&lt;p>If you made changes to &lt;code>pkg/apis&lt;/code> regenerate the Kubernetes client sets with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make codegen
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Update the validation spec in &lt;code>artifacts/flagger/crd.yaml&lt;/code> and run:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make crd
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Note that any change to the CRDs must be accompanied by an update to the Open API schema.&lt;/p>
&lt;h2 id="manual-testing">Manual testing&lt;/h2>
&lt;p>Install a service mesh and/or an ingress controller on your cluster
and deploy Flagger using one of the install options
&lt;a href="https://deploy-preview-2413--fluxcd.netlify.app/flagger/install/flagger-install-on-kubernetes/">listed here&lt;/a>.&lt;/p>
&lt;p>If you made changes to the CRDs, apply your local copy with:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl apply -f artifacts/flagger/crd.yaml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Shutdown the Flagger instance installed on your cluster (replace the namespace with your mesh/ingress one):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n istio-system scale deployment/flagger --replicas&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#40a070">0&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Port forward to your Prometheus instance:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n istio-system port-forward svc/prometheus 9090:9090
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Run Flagger locally against your remote cluster by specifying a kubeconfig path:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>go run cmd/flagger/ -kubeconfig&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#bb60d5">$HOME&lt;/span>/.kube/config &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span>-log-level&lt;span style="color:#666">=&lt;/span>info &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span>-mesh-provider&lt;span style="color:#666">=&lt;/span>istio &lt;span style="color:#4070a0;font-weight:bold">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-weight:bold">&lt;/span>-metrics-server&lt;span style="color:#666">=&lt;/span>http://localhost:9090
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Another option to manually test your changes is to build and push the image to your container registry:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make build
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>docker build -t &amp;lt;YOUR-DOCKERHUB-USERNAME&amp;gt;/flagger:&amp;lt;YOUR-TAG&amp;gt; .
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>docker push &amp;lt;YOUR-DOCKERHUB-USERNAME&amp;gt;/flagger:&amp;lt;YOUR-TAG&amp;gt;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Deploy your image on the cluster and scale up Flagger:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl -n istio-system &lt;span style="color:#007020">set&lt;/span> image deployment/flagger &lt;span style="color:#bb60d5">flagger&lt;/span>&lt;span style="color:#666">=&lt;/span>&amp;lt;YOUR-DOCKERHUB-USERNAME&amp;gt;/flagger:&amp;lt;YOUR-TAG&amp;gt;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>kubectl -n istio-system scale deployment/flagger --replicas&lt;span style="color:#666">=&lt;/span>&lt;span style="color:#40a070">1&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Now you can use one of the
&lt;a href="https://deploy-preview-2413--fluxcd.netlify.app/flagger/">tutorials&lt;/a> to manually test your changes.&lt;/p>
&lt;h2 id="integration-testing">Integration testing&lt;/h2>
&lt;p>Flagger end-to-end tests can be run locally with
&lt;a href="https://github.com/kubernetes-sigs/kind" target="_blank">Kubernetes Kind&lt;/a>.&lt;/p>
&lt;p>Create a Kind cluster:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kind create cluster
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Build Flagger container image and load it on the cluster:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>make build
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>docker build -t test/flagger:latest .
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>kind load docker-image test/flagger:latest
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Run the Istio e2e tests:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>./test/istio/run.sh
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For each service mesh and ingress controller, there is a dedicated e2e test suite,
choose one that matches your changes from this
&lt;a href="https://github.com/fluxcd/flagger/tree/main/test" target="_blank">list&lt;/a>.&lt;/p>
&lt;p>When you open a pull request on Flagger repo, the unit and integration tests will be run in CI.&lt;/p></description></item><item><title>Flagger: Release Guide</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flagger/dev/release-guide/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2413--fluxcd.netlify.app/flagger/dev/release-guide/</guid><description>
&lt;p>This document describes how to release Flagger.&lt;/p>
&lt;h2 id="release">Release&lt;/h2>
&lt;h3 id="flagger">Flagger&lt;/h3>
&lt;p>To release a new Flagger version (e.g. &lt;code>2.0.0&lt;/code>) follow these steps:&lt;/p>
&lt;ul>
&lt;li>create a branch &lt;code>git checkout -b release-2.0.0&lt;/code>&lt;/li>
&lt;li>set the version in code and manifests &lt;code>TAG=2.0.0 make version-set&lt;/code>&lt;/li>
&lt;li>commit changes and merge PR&lt;/li>
&lt;li>checkout main &lt;code>git checkout main &amp;amp;&amp;amp; git pull&lt;/code>&lt;/li>
&lt;li>tag main &lt;code>make release&lt;/code>&lt;/li>
&lt;/ul>
&lt;h3 id="flagger-load-tester">Flagger load tester&lt;/h3>
&lt;p>To release a new Flagger load tester version (e.g. &lt;code>2.0.0&lt;/code>) follow these steps:&lt;/p>
&lt;ul>
&lt;li>create a branch &lt;code>git checkout -b release-ld-2.0.0&lt;/code>&lt;/li>
&lt;li>set the version in code (&lt;code>cmd/loadtester/main.go#VERSION&lt;/code>)&lt;/li>
&lt;li>set the version in the Helm chart (&lt;code>charts/loadtester/Chart.yaml&lt;/code> and &lt;code>values.yaml&lt;/code>)&lt;/li>
&lt;li>set the version in manifests (&lt;code>kustomize/tester/deployment.yaml&lt;/code>)&lt;/li>
&lt;li>commit changes and push the branch upstream&lt;/li>
&lt;li>in GitHub UI, navigate to Actions and run the &lt;code>push-ld&lt;/code> workflow selecting the release branch&lt;/li>
&lt;li>after the workflow finishes, open the PR which will run the e2e tests using the new tester version&lt;/li>
&lt;li>merge the PR if the tests pass&lt;/li>
&lt;/ul>
&lt;h2 id="ci">CI&lt;/h2>
&lt;p>After the tag has been pushed to GitHub, the CI release pipeline does the following:&lt;/p>
&lt;ul>
&lt;li>creates a GitHub release&lt;/li>
&lt;li>pushes the Flagger binary and change log to GitHub release&lt;/li>
&lt;li>pushes the Flagger container image to GitHub Container Registry&lt;/li>
&lt;li>pushed the Flagger install manifests to GitHub Container Registry&lt;/li>
&lt;li>signs all OCI artifacts and release assets with Cosign and GitHub OIDC&lt;/li>
&lt;li>pushes the Helm chart to github-pages branch&lt;/li>
&lt;li>GitHub pages publishes the new chart version on the Helm repository&lt;/li>
&lt;/ul>
&lt;h2 id="docs">Docs&lt;/h2>
&lt;p>The documentation
&lt;a href="https://docs.flagger.app" target="_blank">website&lt;/a> is built from the &lt;code>docs&lt;/code> branch.&lt;/p>
&lt;p>After a Flagger release, publish the docs with:&lt;/p>
&lt;ul>
&lt;li>&lt;code>git checkout main &amp;amp;&amp;amp; git pull&lt;/code>&lt;/li>
&lt;li>&lt;code>git checkout docs&lt;/code>&lt;/li>
&lt;li>&lt;code>git rebase main&lt;/code>&lt;/li>
&lt;li>&lt;code>git push origin docs&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Lastly open a PR with all the docs changes on
&lt;a href="https://github.com/fluxcd/website" target="_blank">fluxcd/website&lt;/a> to
update
&lt;a href="https://fluxcd.io/flagger/" target="_blank">fluxcd.io/flagger&lt;/a>.&lt;/p></description></item><item><title>Flagger: Upgrade Guide</title><link>https://deploy-preview-2413--fluxcd.netlify.app/flagger/dev/upgrade-guide/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-2413--fluxcd.netlify.app/flagger/dev/upgrade-guide/</guid><description>
&lt;p>This document describes how to upgrade Flagger.&lt;/p>
&lt;h2 id="upgrade-canaries-v1alpha3-to-v1beta1">Upgrade canaries v1alpha3 to v1beta1&lt;/h2>
&lt;p>Canary CRD changes in &lt;code>canaries.flagger.app/v1beta1&lt;/code>:&lt;/p>
&lt;ul>
&lt;li>the &lt;code>spec.canaryAnalysis&lt;/code> field has been deprecated and replaced with &lt;code>spec.analysis&lt;/code>&lt;/li>
&lt;li>the &lt;code>spec.analysis.interval&lt;/code> and &lt;code>spec.analysis.threshold&lt;/code> fields are required&lt;/li>
&lt;li>the &lt;code>status.lastAppliedSpec&lt;/code> and &lt;code>status.lastPromotedSpec&lt;/code> hashing algorithm changed to &lt;code>hash/fnv&lt;/code>&lt;/li>
&lt;li>the &lt;code>spec.analysis.alerts&lt;/code> array can reference &lt;code>alertproviders.flagger.app/v1beta1&lt;/code> resources&lt;/li>
&lt;li>the &lt;code>spec.analysis.metrics[].templateRef&lt;/code> can reference a &lt;code>metrictemplate.flagger.app/v1beta1&lt;/code> resource&lt;/li>
&lt;li>the &lt;code>metric.threshold&lt;/code> field has been deprecated and replaced with &lt;code>metric.thresholdRange&lt;/code>&lt;/li>
&lt;li>the &lt;code>metric.query&lt;/code> field has been deprecated and replaced with &lt;code>metric.templateRef&lt;/code>&lt;/li>
&lt;li>the &lt;code>spec.ingressRef.apiVersion&lt;/code> accepts &lt;code>networking.k8s.io/v1beta1&lt;/code>&lt;/li>
&lt;li>the &lt;code>spec.targetRef&lt;/code> can reference &lt;code>DaemonSet&lt;/code> kind&lt;/li>
&lt;li>the &lt;code>spec.service.meshName&lt;/code> field has been deprecated and no longer used for &lt;code>provider: appmesh:v1beta2&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>Upgrade procedure:&lt;/p>
&lt;ul>
&lt;li>install the &lt;code>v1beta1&lt;/code> CRDs&lt;/li>
&lt;li>update Flagger deployment&lt;/li>
&lt;li>replace &lt;code>apiVersion: flagger.app/v1alpha3&lt;/code> with &lt;code>apiVersion: flagger.app/v1beta1&lt;/code> in all canary manifests&lt;/li>
&lt;li>replace &lt;code>spec.canaryAnalysis&lt;/code> with &lt;code>spec.analysis&lt;/code> in all canary manifests&lt;/li>
&lt;li>update canary manifests in cluster&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Note&lt;/strong> that after upgrading Flagger, all canaries will be triggered as the hash value used for tracking changes is computed differently. You can set &lt;code>spec.skipAnalysis: true&lt;/code> in all canary manifests before upgrading Flagger, do the upgrade, wait for Flagger to finish the no-op promotions and finally set &lt;code>skipAnalysis&lt;/code> to &lt;code>false&lt;/code>.&lt;/p>
&lt;p>Update builtin metrics:&lt;/p>
&lt;ul>
&lt;li>replace &lt;code>threshold&lt;/code> with &lt;code>thresholdRange.min&lt;/code> for request-success-rate&lt;/li>
&lt;li>replace &lt;code>threshold&lt;/code> with &lt;code>thresholdRange.max&lt;/code> for request-duration&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">metrics&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>- &lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>request-success-rate&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">thresholdRange&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">min&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">99&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>1m&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>- &lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>request-duration&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">thresholdRange&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">max&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">500&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>1m&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="istio-telemetry-v2">Istio telemetry v2&lt;/h2>
&lt;p>Istio 1.5 comes with a breaking change for Flagger uses. In Istio telemetry v2 the metric &lt;code>istio_request_duration_seconds_bucket&lt;/code> has been removed and replaced with &lt;code>istio_request_duration_milliseconds_bucket&lt;/code> and this breaks the &lt;code>request-duration&lt;/code> metric check.&lt;/p>
&lt;p>If are using &lt;strong>Istio 1.4&lt;/strong>, you can create a metric template using the old duration metric like this:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">apiVersion&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>flagger.app/v1beta1&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">kind&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>MetricTemplate&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">metadata&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>latency&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>istio-system&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>&lt;span style="color:#062873;font-weight:bold">spec&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">provider&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">type&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>prometheus&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">address&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>http://prometheus.istio-system:9090&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">query&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>|&lt;span style="color:#4070a0;font-style:italic">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> histogram_quantile(
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> 0.99,
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> sum(
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> rate(
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> istio_request_duration_seconds_bucket{
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> reporter=&amp;#34;destination&amp;#34;,
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> destination_workload_namespace=&amp;#34;{{ namespace }}&amp;#34;,
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> destination_workload=~&amp;#34;{{ target }}&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> }[{{ interval }}]
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> )
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> ) by (le)
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#4070a0;font-style:italic"> )&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>In the canary manifests, replace the &lt;code>request-duration&lt;/code> metric with &lt;code>latency&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-yaml" data-lang="yaml">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#062873;font-weight:bold">metrics&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb">&lt;/span>- &lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>latency&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">templateRef&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">name&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>latency&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">namespace&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>istio-system&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">thresholdRange&lt;/span>:&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">max&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#40a070">0.500&lt;/span>&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#bbb"> &lt;/span>&lt;span style="color:#062873;font-weight:bold">interval&lt;/span>:&lt;span style="color:#bbb"> &lt;/span>1m&lt;span style="color:#bbb">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item></channel></rss>