diff --git a/.circleci/config.yml b/.circleci/config.yml index b5fbad2d..7e19e332 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -148,9 +148,9 @@ workflows: - e2e-smi-istio-testing: requires: - build-binary - - e2e-supergloo-testing: - requires: - - build-binary +# - e2e-supergloo-testing: +# requires: +# - build-binary - e2e-gloo-testing: requires: - build-binary @@ -165,7 +165,7 @@ workflows: - build-binary - e2e-istio-testing - e2e-smi-istio-testing - - e2e-supergloo-testing + #- e2e-supergloo-testing - e2e-gloo-testing - e2e-nginx-testing - e2e-linkerd-testing diff --git a/CHANGELOG.md b/CHANGELOG.md index c09358e8..963354d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to this project are documented in this file. +## 0.18.0 (2019-07-29) + +Adds support for [manual gating](https://docs.flagger.app/how-it-works#manual-gating) and pausing/resuming an ongoing analysis + +#### Features + +- Implement confirm rollout gate, hook and API [#251](https://github.com/weaveworks/flagger/pull/251) + +#### Improvements + +- Refactor canary change detection and status [#240](https://github.com/weaveworks/flagger/pull/240) +- Implement finalising state [#257](https://github.com/weaveworks/flagger/pull/257) +- Add gRPC load testing tool [#248](https://github.com/weaveworks/flagger/pull/248) + +#### Breaking changes + +- due to the status sub-resource changes in [#240](https://github.com/weaveworks/flagger/pull/240), when upgrading Flagger the canaries status phase will be reset to `Initialized` +- upgrading Flagger with Helm will fail due to Helm poor support of CRDs, see [workaround](https://github.com/weaveworks/flagger/issues/223) + ## 0.17.0 (2019-07-08) Adds support for Linkerd (SMI Traffic Split API), MS Teams notifications and HA mode with leader election diff --git a/README.md b/README.md index 3279e711..a598f509 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Flagger documentation can be found at [docs.flagger.app](https://docs.flagger.ap * [Custom metrics](https://docs.flagger.app/how-it-works#custom-metrics) * [Webhooks](https://docs.flagger.app/how-it-works#webhooks) * [Load testing](https://docs.flagger.app/how-it-works#load-testing) + * [Manual gating](https://docs.flagger.app/how-it-works#manual-gating) * [FAQ](https://docs.flagger.app/faq) * Usage * [Istio canary deployments](https://docs.flagger.app/usage/progressive-delivery) diff --git a/artifacts/cluster/releases/test/backend.yaml b/artifacts/cluster/releases/test/backend.yaml index d29e4903..79ac9bbb 100644 --- a/artifacts/cluster/releases/test/backend.yaml +++ b/artifacts/cluster/releases/test/backend.yaml @@ -5,17 +5,17 @@ metadata: namespace: test annotations: flux.weave.works/automated: "true" - flux.weave.works/tag.chart-image: regexp:^1.4.* + flux.weave.works/tag.chart-image: regexp:^1.7.* spec: releaseName: backend chart: repository: https://flagger.app/ name: podinfo - version: 2.0.0 + version: 2.2.0 values: image: repository: quay.io/stefanprodan/podinfo - tag: 1.4.0 + tag: 1.7.0 httpServer: timeout: 30s canary: diff --git a/artifacts/cluster/releases/test/frontend.yaml b/artifacts/cluster/releases/test/frontend.yaml index f2fa539c..0a62c895 100644 --- a/artifacts/cluster/releases/test/frontend.yaml +++ b/artifacts/cluster/releases/test/frontend.yaml @@ -5,17 +5,17 @@ metadata: namespace: test annotations: flux.weave.works/automated: "true" - flux.weave.works/tag.chart-image: semver:~1.4 + flux.weave.works/tag.chart-image: semver:~1.7 spec: releaseName: frontend chart: repository: https://flagger.app/ name: podinfo - version: 2.0.0 + version: 2.2.0 values: image: repository: quay.io/stefanprodan/podinfo - tag: 1.4.0 + tag: 1.7.0 backend: http://backend-podinfo:9898/echo canary: enabled: true diff --git a/artifacts/cluster/releases/test/loadtester.yaml b/artifacts/cluster/releases/test/loadtester.yaml index d098b9f2..bd742d60 100644 --- a/artifacts/cluster/releases/test/loadtester.yaml +++ b/artifacts/cluster/releases/test/loadtester.yaml @@ -11,8 +11,8 @@ spec: chart: repository: https://flagger.app/ name: loadtester - version: 0.1.0 + version: 0.6.0 values: image: - repository: quay.io/stefanprodan/flagger-loadtester - tag: 0.1.0 + repository: weaveworks/flagger-loadtester + tag: 0.6.1 diff --git a/artifacts/configs/canary.yaml b/artifacts/configs/canary.yaml deleted file mode 100644 index 9e666222..00000000 --- a/artifacts/configs/canary.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: flagger.app/v1alpha3 -kind: Canary -metadata: - name: podinfo - namespace: test -spec: - # deployment reference - targetRef: - apiVersion: apps/v1 - kind: Deployment - name: podinfo - # the maximum time in seconds for the canary deployment - # to make progress before it is rollback (default 600s) - progressDeadlineSeconds: 60 - # HPA reference (optional) - autoscalerRef: - apiVersion: autoscaling/v2beta1 - kind: HorizontalPodAutoscaler - name: podinfo - service: - # container port - port: 9898 - # Istio gateways (optional) - gateways: - - public-gateway.istio-system.svc.cluster.local - - mesh - # Istio virtual service host names (optional) - hosts: - - app.iowa.weavedx.com - canaryAnalysis: - # schedule interval (default 60s) - interval: 10s - # max number of failed metric checks before rollback - threshold: 10 - # max traffic percentage routed to canary - # percentage (0-100) - maxWeight: 50 - # canary increment step - # percentage (0-100) - stepWeight: 5 - # Istio Prometheus checks - metrics: - - name: request-success-rate - # minimum req success rate (non 5xx responses) - # percentage (0-100) - threshold: 99 - interval: 1m - - name: request-duration - # maximum req duration P99 - # milliseconds - threshold: 500 - interval: 30s - # external checks (optional) - webhooks: - - name: load-test - url: http://flagger-loadtester.test/ - timeout: 5s - metadata: - cmd: "hey -z 1m -q 10 -c 2 http://podinfo.test:9898/" diff --git a/artifacts/configs/configs.yaml b/artifacts/configs/configs.yaml deleted file mode 100644 index 8e3cfe50..00000000 --- a/artifacts/configs/configs.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: podinfo-config-env - namespace: test -data: - color: blue ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: podinfo-config-vol - namespace: test -data: - output: console - textmode: "true" diff --git a/artifacts/configs/deployment.yaml b/artifacts/configs/deployment.yaml deleted file mode 100644 index 1d2fbe45..00000000 --- a/artifacts/configs/deployment.yaml +++ /dev/null @@ -1,89 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: podinfo - namespace: test - labels: - app: podinfo -spec: - minReadySeconds: 5 - revisionHistoryLimit: 5 - progressDeadlineSeconds: 60 - strategy: - rollingUpdate: - maxUnavailable: 0 - type: RollingUpdate - selector: - matchLabels: - app: podinfo - template: - metadata: - annotations: - prometheus.io/scrape: "true" - labels: - app: podinfo - spec: - containers: - - name: podinfod - image: quay.io/stefanprodan/podinfo:1.3.0 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 9898 - name: http - protocol: TCP - command: - - ./podinfo - - --port=9898 - - --level=info - - --random-delay=false - - --random-error=false - env: - - name: PODINFO_UI_COLOR - valueFrom: - configMapKeyRef: - name: podinfo-config-env - key: color - - name: SECRET_USER - valueFrom: - secretKeyRef: - name: podinfo-secret-env - key: user - livenessProbe: - exec: - command: - - podcli - - check - - http - - localhost:9898/healthz - initialDelaySeconds: 5 - timeoutSeconds: 5 - readinessProbe: - exec: - command: - - podcli - - check - - http - - localhost:9898/readyz - initialDelaySeconds: 5 - timeoutSeconds: 5 - resources: - limits: - cpu: 2000m - memory: 512Mi - requests: - cpu: 100m - memory: 64Mi - volumeMounts: - - name: configs - mountPath: /etc/podinfo/configs - readOnly: true - - name: secrets - mountPath: /etc/podinfo/secrets - readOnly: true - volumes: - - name: configs - configMap: - name: podinfo-config-vol - - name: secrets - secret: - secretName: podinfo-secret-vol diff --git a/artifacts/configs/hpa.yaml b/artifacts/configs/hpa.yaml deleted file mode 100644 index 48ec76e8..00000000 --- a/artifacts/configs/hpa.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: podinfo - namespace: test -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: podinfo - minReplicas: 1 - maxReplicas: 4 - metrics: - - type: Resource - resource: - name: cpu - # scale up if usage is above - # 99% of the requested CPU (100m) - targetAverageUtilization: 99 diff --git a/artifacts/configs/secrets.yaml b/artifacts/configs/secrets.yaml deleted file mode 100644 index 73485871..00000000 --- a/artifacts/configs/secrets.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: podinfo-secret-env - namespace: test -data: - password: cGFzc3dvcmQ= - user: YWRtaW4= ---- -apiVersion: v1 -kind: Secret -metadata: - name: podinfo-secret-vol - namespace: test -data: - key: cGFzc3dvcmQ= diff --git a/artifacts/flagger/deployment.yaml b/artifacts/flagger/deployment.yaml index e387b095..23fa4698 100644 --- a/artifacts/flagger/deployment.yaml +++ b/artifacts/flagger/deployment.yaml @@ -22,7 +22,7 @@ spec: serviceAccountName: flagger containers: - name: flagger - image: weaveworks/flagger:0.17.0 + image: weaveworks/flagger:0.18.0 imagePullPolicy: IfNotPresent ports: - name: http diff --git a/artifacts/routing/destination-rule.yaml b/artifacts/routing/destination-rule.yaml deleted file mode 100644 index 2bdea8f2..00000000 --- a/artifacts/routing/destination-rule.yaml +++ /dev/null @@ -1,45 +0,0 @@ -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: podinfo - namespace: test -spec: - gateways: - - public-gateway.istio-system.svc.cluster.local - - mesh - hosts: - - podinfo.istio.weavedx.com - - podinfo - http: - - route: - - destination: - host: podinfo - subset: primary - weight: 50 - - destination: - host: podinfo - subset: canary - weight: 50 ---- -apiVersion: networking.istio.io/v1alpha3 -kind: DestinationRule -metadata: - name: podinfo-destination - namespace: test -spec: - host: podinfo - trafficPolicy: - loadBalancer: - consistentHash: - httpCookie: - name: istiouser - ttl: 30s - subsets: - - name: primary - labels: - app: podinfo - role: primary - - name: canary - labels: - app: podinfo - role: canary diff --git a/artifacts/routing/match.yaml b/artifacts/routing/match.yaml deleted file mode 100644 index edf76586..00000000 --- a/artifacts/routing/match.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: podinfo - namespace: test -spec: - gateways: - - public-gateway.istio-system.svc.cluster.local - - mesh - hosts: - - app.istio.weavedx.com - - podinfo - http: - - match: - - headers: - user-agent: - regex: ^(?!.*Chrome)(?=.*\bSafari\b).*$ - uri: - prefix: "/version/" - rewrite: - uri: /api/info - route: - - destination: - host: podinfo-primary - port: - number: 9898 - weight: 0 - - destination: - host: podinfo - port: - number: 9898 - weight: 100 - - match: - - uri: - prefix: "/version/" - rewrite: - uri: /api/info - route: - - destination: - host: podinfo-primary - port: - number: 9898 - weight: 100 diff --git a/artifacts/routing/mirror.yaml b/artifacts/routing/mirror.yaml deleted file mode 100644 index 274c0947..00000000 --- a/artifacts/routing/mirror.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: podinfo - namespace: test - labels: - app: podinfo -spec: - gateways: - - public-gateway.istio-system.svc.cluster.local - - mesh - hosts: - - podinfo.iowa.weavedx.com - - podinfo - http: - - route: - - destination: - host: podinfo-primary - port: - number: 9898 - weight: 100 - mirror: - host: podinfo - port: - number: 9898 diff --git a/artifacts/routing/weight.yaml b/artifacts/routing/weight.yaml deleted file mode 100644 index 5a16f5c3..00000000 --- a/artifacts/routing/weight.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: podinfo - namespace: test - labels: - app: podinfo -spec: - gateways: - - public-gateway.istio-system.svc.cluster.local - - mesh - hosts: - - podinfo.iowa.weavedx.com - - podinfo - http: - - route: - - destination: - host: podinfo-primary - port: - number: 9898 - weight: 100 - - destination: - host: podinfo - port: - number: 9898 - weight: 0 diff --git a/artifacts/workloads/canary-deployment.yaml b/artifacts/workloads/canary-deployment.yaml deleted file mode 100644 index 4baf9424..00000000 --- a/artifacts/workloads/canary-deployment.yaml +++ /dev/null @@ -1,69 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: podinfo - namespace: test - labels: - app: podinfo -spec: - replicas: 1 - strategy: - rollingUpdate: - maxUnavailable: 0 - type: RollingUpdate - selector: - matchLabels: - app: podinfo - template: - metadata: - annotations: - prometheus.io/scrape: "true" - labels: - app: podinfo - spec: - containers: - - name: podinfod - image: quay.io/stefanprodan/podinfo:1.7.0 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 9898 - name: http - protocol: TCP - command: - - ./podinfo - - --port=9898 - - --level=info - - --random-delay=false - - --random-error=false - env: - - name: PODINFO_UI_COLOR - value: green - livenessProbe: - exec: - command: - - podcli - - check - - http - - localhost:9898/healthz - failureThreshold: 3 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 2 - readinessProbe: - exec: - command: - - podcli - - check - - http - - localhost:9898/readyz - failureThreshold: 3 - periodSeconds: 3 - successThreshold: 1 - timeoutSeconds: 2 - resources: - limits: - cpu: 1000m - memory: 256Mi - requests: - cpu: 100m - memory: 16Mi diff --git a/artifacts/workloads/canary-destination.yaml b/artifacts/workloads/canary-destination.yaml deleted file mode 100644 index 761a21a7..00000000 --- a/artifacts/workloads/canary-destination.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: networking.istio.io/v1alpha3 -kind: DestinationRule -metadata: - name: podinfo-canary - namespace: test -spec: - host: podinfo-canary - trafficPolicy: - loadBalancer: - consistentHash: - httpCookie: - name: user - ttl: 0s \ No newline at end of file diff --git a/artifacts/workloads/canary-hpa.yaml b/artifacts/workloads/canary-hpa.yaml deleted file mode 100644 index 9ffce478..00000000 --- a/artifacts/workloads/canary-hpa.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: podinfo - namespace: test -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: podinfo - minReplicas: 2 - maxReplicas: 2 - metrics: - - type: Resource - resource: - name: cpu - # scale up if usage is above - # 99% of the requested CPU (100m) - targetAverageUtilization: 99 - - type: Resource - resource: - name: memory - targetAverageValue: 200Mi diff --git a/artifacts/workloads/canary-service.yaml b/artifacts/workloads/canary-service.yaml deleted file mode 100644 index 7a09e206..00000000 --- a/artifacts/workloads/canary-service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: podinfo-canary - namespace: test -spec: - type: ClusterIP - selector: - app: podinfo - ports: - - name: http - port: 9898 - protocol: TCP - targetPort: http diff --git a/artifacts/workloads/primary-deployment.yaml b/artifacts/workloads/primary-deployment.yaml deleted file mode 100644 index 6bc393a7..00000000 --- a/artifacts/workloads/primary-deployment.yaml +++ /dev/null @@ -1,71 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: podinfo-primary - namespace: test - labels: - app: podinfo-primary -spec: - replicas: 1 - strategy: - rollingUpdate: - maxUnavailable: 0 - type: RollingUpdate - selector: - matchLabels: - app: podinfo-primary - template: - metadata: - annotations: - prometheus.io/scrape: "true" - labels: - app: podinfo-primary - spec: - containers: - - name: podinfod - image: quay.io/stefanprodan/podinfo:1.7.1 - imagePullPolicy: IfNotPresent - ports: - - containerPort: 9898 - name: http - protocol: TCP - command: - - ./podinfo - - --port=9898 - - --level=info - - --random-delay=false - - --random-error=false - env: - - name: PODINFO_UI_COLOR - value: blue - livenessProbe: - exec: - command: - - podcli - - check - - http - - localhost:9898/healthz - initialDelaySeconds: 5 - failureThreshold: 3 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 1 - readinessProbe: - exec: - command: - - podcli - - check - - http - - localhost:9898/readyz - initialDelaySeconds: 5 - failureThreshold: 3 - periodSeconds: 3 - successThreshold: 1 - timeoutSeconds: 1 - resources: - limits: - cpu: 2000m - memory: 512Mi - requests: - cpu: 10m - memory: 64Mi diff --git a/artifacts/workloads/primary-destination.yaml b/artifacts/workloads/primary-destination.yaml deleted file mode 100644 index d84b1962..00000000 --- a/artifacts/workloads/primary-destination.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: networking.istio.io/v1alpha3 -kind: DestinationRule -metadata: - name: podinfo-primary - namespace: test -spec: - host: podinfo-primary - trafficPolicy: - loadBalancer: - consistentHash: - httpCookie: - name: user - ttl: 0s diff --git a/artifacts/workloads/primary-hpa.yaml b/artifacts/workloads/primary-hpa.yaml deleted file mode 100644 index 0b762122..00000000 --- a/artifacts/workloads/primary-hpa.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: podinfo-primary - namespace: test -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: podinfo-primary - minReplicas: 2 - maxReplicas: 2 - metrics: - - type: Resource - resource: - name: cpu - # scale up if usage is above - # 99% of the requested CPU (100m) - targetAverageUtilization: 99 diff --git a/artifacts/workloads/primary-service.yaml b/artifacts/workloads/primary-service.yaml deleted file mode 100644 index b5290e28..00000000 --- a/artifacts/workloads/primary-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: podinfo-primary - namespace: test - labels: - app: podinfo-primary -spec: - type: ClusterIP - selector: - app: podinfo-primary - ports: - - name: http - port: 9898 - protocol: TCP - targetPort: http diff --git a/artifacts/workloads/service.yaml b/artifacts/workloads/service.yaml deleted file mode 100644 index 3e98f1e0..00000000 --- a/artifacts/workloads/service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: podinfo - namespace: test -spec: - type: ClusterIP - selector: - app: podinfo-primary - ports: - - name: http - port: 9898 - protocol: TCP - targetPort: http diff --git a/artifacts/workloads/virtual-service.yaml b/artifacts/workloads/virtual-service.yaml deleted file mode 100644 index b2c59e45..00000000 --- a/artifacts/workloads/virtual-service.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: networking.istio.io/v1alpha3 -kind: VirtualService -metadata: - name: podinfo - namespace: test - labels: - app: podinfo -spec: - gateways: - - mesh - - public-gateway.istio-system.svc.cluster.local - hosts: - - podinfo - - app.istio.weavedx.com - http: - - route: - - destination: - host: podinfo-primary - weight: 50 - - destination: - host: podinfo-canary - weight: 50 - timeout: 5s diff --git a/charts/flagger/Chart.yaml b/charts/flagger/Chart.yaml index 959f0b00..6b2d7287 100644 --- a/charts/flagger/Chart.yaml +++ b/charts/flagger/Chart.yaml @@ -1,10 +1,10 @@ apiVersion: v1 name: flagger -version: 0.17.0 -appVersion: 0.17.0 +version: 0.18.0 +appVersion: 0.18.0 kubeVersion: ">=1.11.0-0" engine: gotpl -description: Flagger is a Kubernetes operator that automates the promotion of canary deployments using Istio, App Mesh or NGINX routing for traffic shifting and Prometheus metrics for canary analysis. +description: Flagger is a Kubernetes operator that automates the promotion of canary deployments using Istio, Linkerd, App Mesh, Gloo or NGINX routing for traffic shifting and Prometheus metrics for canary analysis. home: https://docs.flagger.app icon: https://raw.githubusercontent.com/weaveworks/flagger/master/docs/logo/flagger-icon.png sources: @@ -17,4 +17,5 @@ keywords: - canary - istio - appmesh +- linkerd - gitops diff --git a/charts/flagger/README.md b/charts/flagger/README.md index 12e91463..e5e9ba7a 100644 --- a/charts/flagger/README.md +++ b/charts/flagger/README.md @@ -1,10 +1,10 @@ # Flagger [Flagger](https://github.com/weaveworks/flagger) is a Kubernetes operator that automates the promotion of -canary deployments using Istio, App Mesh, NGINX or Gloo routing for traffic shifting and Prometheus metrics for canary analysis. +canary deployments using Istio, Linkerd, App Mesh, NGINX or Gloo routing for traffic shifting and Prometheus metrics for canary analysis. Flagger implements a control loop that gradually shifts traffic to the canary while measuring key performance indicators like HTTP requests success rate, requests average duration and pods health. -Based on the KPIs analysis a canary is promoted or aborted and the analysis result is published to Slack. +Based on the KPIs analysis a canary is promoted or aborted and the analysis result is published to Slack or MS Teams. ## Prerequisites @@ -16,7 +16,13 @@ Based on the KPIs analysis a canary is promoted or aborted and the analysis resu Add Flagger Helm repository: ```console -helm repo add flagger https://flagger.app +$ helm repo add flagger https://flagger.app +``` + +Install Flagger's custom resource definitions: + +```console +$ kubectl apply -f https://raw.githubusercontent.com/weaveworks/flagger/master/artifacts/flagger/crd.yaml ``` To install the chart with the release name `flagger` for Istio: @@ -24,6 +30,7 @@ To install the chart with the release name `flagger` for Istio: ```console $ helm upgrade -i flagger flagger/flagger \ --namespace=istio-system \ + --set crd.create=false \ --set meshProvider=istio \ --set metricsServer=http://prometheus:9090 ``` @@ -33,6 +40,7 @@ To install the chart with the release name `flagger` for Linkerd: ```console $ helm upgrade -i flagger flagger/flagger \ --namespace=linkerd \ + --set crd.create=false \ --set meshProvider=linkerd \ --set metricsServer=http://linkerd-prometheus:9090 ``` @@ -82,6 +90,7 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm ```console $ helm upgrade -i flagger flagger/flagger \ --namespace istio-system \ + --set crd.create=false \ --set slack.url=https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK \ --set slack.channel=general ``` diff --git a/charts/flagger/values.yaml b/charts/flagger/values.yaml index 7adea618..88523651 100644 --- a/charts/flagger/values.yaml +++ b/charts/flagger/values.yaml @@ -2,7 +2,7 @@ image: repository: weaveworks/flagger - tag: 0.17.0 + tag: 0.18.0 pullPolicy: IfNotPresent metricsServer: "http://prometheus:9090" diff --git a/docs/gitbook/how-it-works.md b/docs/gitbook/how-it-works.md index 829a2c41..34a0806d 100644 --- a/docs/gitbook/how-it-works.md +++ b/docs/gitbook/how-it-works.md @@ -142,7 +142,8 @@ status: type: Promoted ``` -The `Promoted` status condition can have one of the following reasons: Initialized, Waiting, Progressing, Succeeded or Failed. +The `Promoted` status condition can have one of the following reasons: +Initialized, Waiting, Progressing, Finalising, Succeeded or Failed. A failed canary will have the promoted status set to `false`, the reason to `failed` and the last applied spec will be different to the last promoted one. @@ -910,7 +911,7 @@ Change the URL to `/gate/approve` to start the canary analysis: ```yaml canaryAnalysis: webhooks: - - name: "start gate" + - name: "gate" type: confirm-rollout url: http://flagger-loadtester.test/gate/approve ``` @@ -920,7 +921,7 @@ Manual gating can be driven with Flagger's tester API. Set the confirmation URL ```yaml canaryAnalysis: webhooks: - - name: "ask confirmation" + - name: "ask for confirmation" type: confirm-rollout url: http://flagger-loadtester.test/gate/check ``` diff --git a/docs/gitbook/install/flagger-install-on-eks-appmesh.md b/docs/gitbook/install/flagger-install-on-eks-appmesh.md index 7e4edde1..b8bf41af 100644 --- a/docs/gitbook/install/flagger-install-on-eks-appmesh.md +++ b/docs/gitbook/install/flagger-install-on-eks-appmesh.md @@ -133,11 +133,18 @@ Add Flagger Helm repository: helm repo add flagger https://flagger.app ``` +Install Flagger's Canary CRD: + +```yaml +kubectl apply -f https://raw.githubusercontent.com/weaveworks/flagger/master/artifacts/flagger/crd.yaml +``` + Deploy Flagger and Prometheus in the _**appmesh-system**_ namespace: ```bash helm upgrade -i flagger flagger/flagger \ --namespace=appmesh-system \ +--set crd.create=false \ --set meshProvider=appmesh \ --set prometheus.install=true ``` @@ -150,6 +157,7 @@ You can enable **Slack** notifications with: ```bash helm upgrade -i flagger flagger/flagger \ --namespace=appmesh-system \ +--set crd.create=false \ --set meshProvider=appmesh \ --set metricsServer=http://prometheus.appmesh:9090 \ --set slack.url=https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK \ diff --git a/docs/gitbook/install/flagger-install-on-google-cloud.md b/docs/gitbook/install/flagger-install-on-google-cloud.md index 9f5a0011..e1a38452 100644 --- a/docs/gitbook/install/flagger-install-on-google-cloud.md +++ b/docs/gitbook/install/flagger-install-on-google-cloud.md @@ -354,11 +354,18 @@ Add Flagger Helm repository: helm repo add flagger https://flagger.app ``` +Install Flagger's Canary CRD: + +```yaml +kubectl apply -f https://raw.githubusercontent.com/weaveworks/flagger/master/artifacts/flagger/crd.yaml +``` + Deploy Flagger in the `istio-system` namespace with Slack notifications enabled: ```bash helm upgrade -i flagger flagger/flagger \ --namespace=istio-system \ +--set crd.create=false \ --set metricsServer=http://prometheus.istio-system:9090 \ --set slack.url=https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK \ --set slack.channel=general \ diff --git a/docs/gitbook/install/flagger-install-on-kubernetes.md b/docs/gitbook/install/flagger-install-on-kubernetes.md index 2a827bfd..5800e50f 100644 --- a/docs/gitbook/install/flagger-install-on-kubernetes.md +++ b/docs/gitbook/install/flagger-install-on-kubernetes.md @@ -17,11 +17,18 @@ Add Flagger Helm repository: helm repo add flagger https://flagger.app ``` +Install Flagger's Canary CRD: + +```yaml +kubectl apply -f https://raw.githubusercontent.com/weaveworks/flagger/master/artifacts/flagger/crd.yaml +``` + Deploy Flagger for Istio: ```bash helm upgrade -i flagger flagger/flagger \ --namespace=istio-system \ +--set crd.create=false \ --set meshProvider=istio \ --set metricsServer=http://prometheus:9090 ``` @@ -31,6 +38,7 @@ Deploy Flagger for Linkerd: ```bash helm upgrade -i flagger flagger/flagger \ --namespace=linkerd \ +--set crd.create=false \ --set meshProvider=linkerd \ --set metricsServer=http://linkerd-prometheus:9090 ``` @@ -42,6 +50,7 @@ Enable **Slack** notifications: ```bash helm upgrade -i flagger flagger/flagger \ --namespace=istio-system \ +--set crd.create=false \ --set slack.url=https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK \ --set slack.channel=general \ --set slack.user=flagger @@ -52,6 +61,7 @@ Enable **Microsoft Teams** notifications: ```bash helm upgrade -i flagger flagger/flagger \ --namespace=istio-system \ +--set crd.create=false \ --set msteams.url=https://outlook.office.com/webhook/YOUR/TEAMS/WEBHOOK ``` @@ -131,25 +141,38 @@ As an alternative to Helm, Flagger can be installed with Kustomize. Install Flagger for Istio: ```bash -kubectl apply -k github.com/weaveworks/flagger/kustomize/istio +kubectl apply -k github.com/weaveworks/flagger//kustomize/istio ``` -This deploys Flagger in the `istio-system` namespace and sets the metrics server URL to `http://prometheus.istio-system:9090`. +This deploys Flagger in the `istio-system` namespace and sets the metrics server URL to Istio's Prometheus instance. + +Note that you'll need kubectl 1.14 to run the above the command or you can download the +[kustomize binary](https://github.com/kubernetes-sigs/kustomize/releases) and run: + +```bash +kustomize build github.com/weaveworks/flagger//kustomize/istio | kubectl apply -f - +``` Install Flagger for Linkerd: ```bash -kubectl apply -k github.com/weaveworks/flagger/kustomize/linkerd +kubectl apply -k github.com/weaveworks/flagger//kustomize/linkerd ``` -This deploys Flagger in the `linkerd` namespace and sets the metrics server URL to `http://linkerd-prometheus.linkerd:9090`. +This deploys Flagger in the `linkerd` namespace and sets the metrics server URL to Linkerd's Prometheus instance. + +If you want to install a specific Flagger release, add the version number to the URL: + +```bash +kubectl apply -k github.com/weaveworks/flagger//kustomize/linkerd?ref=0.18.0 +``` **Generic installer** Install Flagger and Prometheus: ```bash -kubectl apply -k github.com/weaveworks/flagger/kustomize/kubernetes +kubectl apply -k github.com/weaveworks/flagger//kustomize/kubernetes ``` This deploys Flagger and Prometheus in the `flagger-system` namespace, @@ -158,7 +181,7 @@ sets the metrics server URL to `http://flagger-prometheus.flagger-system:9090` a The Prometheus instance has a two hours data retention and is configured to scrape all pods in your cluster that have the `prometheus.io/scrape: "true"` annotation. -To target a specific provider you need to specify it in the canary custom resource: +To target a different provider you can specify it in the canary custom resource: ```yaml apiVersion: flagger.app/v1alpha3 @@ -167,7 +190,7 @@ metadata: name: app namespace: test spec: - # can be: kubernetes, istio, appmesh, linkerd, smi, nginx, gloo, supergloo + # can be: kubernetes, istio, linkerd, appmesh, nginx, gloo # use the kubernetes provider for Blue/Green style deployments provider: nginx ``` @@ -213,3 +236,5 @@ Install Flagger with Slack: ```bash kubectl apply -k . ``` + +If you want to use MS Teams instead of Slack, replace `-slack-url` with `-msteams-url` and set the webhook address to `https://outlook.office.com/webhook/YOUR/TEAMS/WEBHOOK`. diff --git a/docs/gitbook/install/flagger-install-with-supergloo.md b/docs/gitbook/install/flagger-install-with-supergloo.md index 7ec10ed1..591de8df 100644 --- a/docs/gitbook/install/flagger-install-with-supergloo.md +++ b/docs/gitbook/install/flagger-install-with-supergloo.md @@ -115,11 +115,18 @@ Add Flagger Helm repository: helm repo add flagger https://flagger.app ``` +Install Flagger's Canary CRD: + +```yaml +kubectl apply -f https://raw.githubusercontent.com/weaveworks/flagger/master/artifacts/flagger/crd.yaml +``` + Deploy Flagger in the _**istio-system**_ namespace and set the service mesh provider to SuperGloo: ```bash helm upgrade -i flagger flagger/flagger \ --namespace=istio-system \ +--set crd.create=false \ --set metricsServer=http://prometheus.istio-system:9090 \ --set meshProvider=supergloo:istio.supergloo-system ``` diff --git a/kustomize/README.md b/kustomize/README.md index 343725aa..b9bdf981 100644 --- a/kustomize/README.md +++ b/kustomize/README.md @@ -1,37 +1,50 @@ # Flagger Kustomize installer -As an alternative to Helm, Flagger can be installed with Kustomize. +As an alternative to Helm, Flagger can be installed with [Kustomize](https://kustomize.io/). ## Service mesh specific installers Install Flagger for Istio: ```bash -kubectl apply -k github.com/weaveworks/flagger/kustomize/istio +kubectl apply -k github.com/weaveworks/flagger//kustomize/istio ``` -This deploys Flagger in the `istio-system` namespace and sets the metrics server URL to `http://prometheus.istio-system:9090`. +This deploys Flagger in the `istio-system` namespace and sets the metrics server URL to Istio's Prometheus instance. + +Note that you'll need kubectl 1.14 to run the above the command or you can download the +[kustomize binary](https://github.com/kubernetes-sigs/kustomize/releases) and run: + +```bash +kustomize build github.com/weaveworks/flagger//kustomize/istio | kubectl apply -f - +``` Install Flagger for Linkerd: ```bash -kubectl apply -k github.com/weaveworks/flagger/kustomize/linkerd +kubectl apply -k github.com/weaveworks/flagger//kustomize/linkerd ``` -This deploys Flagger in the `linkerd` namespace and sets the metrics server URL to `http://linkerd-prometheus.linkerd:9090`. +This deploys Flagger in the `linkerd` namespace and sets the metrics server URL to Linkerd's Prometheus instance. + +If you want to install a specific Flagger release, add the version number to the URL: + +```bash +kubectl apply -k github.com/weaveworks/flagger//kustomize/linkerd?ref=0.18.0 +``` ## Generic installer Install Flagger and Prometheus: ```bash -kubectl apply -k github.com/weaveworks/flagger/kustomize/kubernetes +kubectl apply -k github.com/weaveworks/flagger//kustomize/kubernetes ``` This deploys Flagger and Prometheus in the `flagger-system` namespace, sets the metrics server URL to `http://flagger-prometheus.flagger-system:9090` and the mesh provider to `kubernetes`. -To target a specific provider you need to specify it in the canary custom resource: +To target a different provider you can specify it in the canary custom resource: ```yaml apiVersion: flagger.app/v1alpha3 @@ -40,12 +53,16 @@ metadata: name: app namespace: test spec: - # can be: kubernetes, istio, appmesh, linkerd, smi, nginx, gloo, supergloo + # can be: kubernetes, istio, linkerd, appmesh, nginx, gloo # use the kubernetes provider for Blue/Green style deployments provider: nginx ``` -## Customized installer +You'll need Prometheus when using Flagger with AWS App Mesh, Gloo or NGINX ingress controller. +The Prometheus instance has a two hours data retention and is configured to scrape all pods in your cluster that +have the `prometheus.io/scrape: "true"` annotation. + +## Configure Slack notifications Create a kustomization file using flagger as base: @@ -81,9 +98,48 @@ spec: EOF ``` -Install Flagger with Slack: +Install Flagger for Istio with Slack notifications: ```bash kubectl apply -k . ``` +## Configure MS Teams notifications + +Create a kustomization file using flagger as base: + +```bash +cat > kustomization.yaml < patch.yaml <>> Load Flagger image in Kind' kind load docker-image test/flagger:latest echo '>>> Installing Flagger' -helm upgrade -i flagger ${REPO_ROOT}/charts/flagger \ ---namespace istio-system \ ---set meshProvider=istio +kubectl apply -k ${REPO_ROOT}/kustomize/istio kubectl -n istio-system set image deployment/flagger flagger=test/flagger:latest kubectl -n istio-system rollout status deployment/flagger \ No newline at end of file diff --git a/test/e2e-tests.sh b/test/e2e-tests.sh index 829fcf57..df5797d8 100755 --- a/test/e2e-tests.sh +++ b/test/e2e-tests.sh @@ -13,7 +13,7 @@ kubectl create namespace test kubectl label namespace test istio-injection=enabled echo '>>> Installing the load tester' -kubectl -n test apply -f ${REPO_ROOT}/artifacts/loadtester/ +kubectl apply -k ${REPO_ROOT}/kustomize/tester kubectl -n test rollout status deployment/flagger-loadtester echo '>>> Initialising canary'