freundcloud

Progressive Delivery

Progressive delivery is an advanced deployment strategy that extends continuous delivery by gradually rolling out changes to a subset of users while evaluating key metrics before proceeding.

Core Components

Flux CD Setup

apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: GitRepository
metadata:
  name: app-repository
  namespace: flux-system
spec:
  interval: 1m
  url: https://github.com/org/app
  ref:
    branch: main
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: app-release
spec:
  interval: 5m
  chart:
    spec:
      chart: ./charts/app
      sourceRef:
        kind: GitRepository
        name: app-repository
  values:
    replicaCount: 3
    strategy:
      canary:
        steps:
          - setWeight: 20
          - pause: {duration: "5m"}
          - setWeight: 40
          - pause: {duration: "5m"}
          - setWeight: 60
          - pause: {duration: "5m"}
          - setWeight: 80
          - pause: {duration: "5m"}

Canary Deployment Configuration

apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
  name: app-canary
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: app-deployment
  service:
    port: 80
  analysis:
    interval: 1m
    threshold: 10
    maxWeight: 50
    stepWeight: 10
    metrics:
    - name: request-success-rate
      threshold: 99
      interval: "1m"
    - name: request-duration
      threshold: 500
      interval: "1m"
    webhooks:
      - name: load-test
        url: http://flagger-loadtester.test/
        timeout: 5s
        metadata:
          type: cmd
          cmd: "hey -z 1m -q 10 -c 2 http://app-canary.test/"

Monitoring Integration

Prometheus Configuration

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: app-monitor
spec:
  selector:
    matchLabels:
      app: progressive-app
  endpoints:
  - port: metrics
    interval: 15s

Grafana Dashboard

apiVersion: integreatly.org/v1alpha1
kind: GrafanaDashboard
metadata:
  name: progressive-delivery
spec:
  json: |
    {
      "panels": [
        {
          "title": "Success Rate",
          "type": "graph",
          "datasource": "Prometheus"
        },
        {
          "title": "Latency",
          "type": "graph",
          "datasource": "Prometheus"
        }
      ]
    }

Rollback Strategy

apiVersion: flagger.app/v1beta1
kind: Canary
metadata:
  name: app-rollback
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: app-deployment
  analysis:
    rollback:
      threshold: 5
      step: 1m
      metrics:
      - name: error-rate
        threshold: 1
        interval: "30s"

Best Practices

  1. Metric Selection
    • Response time
    • Error rates
    • Resource utilization
    • Business metrics
  2. Release Strategies
    • Canary deployments
    • Blue/Green deployments
    • A/B testing
    • Feature flags
  3. Security Considerations
    • RBAC configuration
    • Network policies
    • Secret management
    • Audit logging
  4. Observability
    • Distributed tracing
    • Centralized logging
    • Metric aggregation
    • Alert configuration