Reducing the blast radius during application deployment

Written by Consultant James Mak, at Airwalk Reply.

Kubernetes controls

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-proxy-v1
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-proxy
  template:
    metadata:
      labels:
        app: my-proxy
        version: v1
    spec:
      containers:
      - name: nginx
        image: nginx:v1
        ports:
        - containerPort: 80---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-proxy-v2
spec:
  replicas: 3
  selector:
    matchLabels:
      app: my-proxy
  template:
    metadata:
      labels:
        app: my-proxy
        version: v2
    spec:
      containers:
      - name: nginx
        image: nginx:v2
        ports:
        - containerPort: 80---
apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  selector:
    app: my-proxy
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80

Istio controls

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: my-service-vs
spec:
  hosts:
  - my-service-vs
  http:
    route:
    - destination:
        host: my-service.default.svc.cluster.local
        subset: v1
      weight: 75
    - destination:
        host: my-service.default.svc.cluster.local
        subset: v2
      weight: 25----apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: my-service-dr
spec:
  host: my-service.default.svc.cluster.local
  subsets:
  - name: v1
    labels:
      version: v1
  - name: v2
    labels:
      version: v2

Which deployment strategy should I use?